Menu ▾ ▴

COBOL comments

MadCompie
2009-06-12
2012-11-13
  • MadCompie

    MadCompie - 2009-06-12

    COBOL handles 2 types of comments:
    1) line comment = an asterisk "*" at column 7
    2) partial line comment = a "*>" anywhere after column 7 on the line (like the C "//" equivalent)

    How to integrate this in the syntax?
    Can I use regexp in the comment definition for this user defined language?
    By the way: I can't find anywhere the explanation of the comment syntax?

    This is my userDefineLang.xml :

    <UserLang name="cobol" ext="COB cbl">
            <Settings>
                <Global caseIgnored="yes" />
                <TreatAsSymbol comment="no" commentLine="no" />
                <Prefix words1="yes" words2="yes" words3="yes" words4="yes" />
            </Settings>
            <KeywordLists>
                <Keywords name="Delimiters">(00)00</Keywords>
                <Keywords name="Folder+">blockBegin IF</Keywords>
                <Keywords name="Folder-">blockEnd END-IF</Keywords>
                <Keywords name="Operators">&lt; = &gt;</Keywords>
                <Keywords name="Comment">1* 2* 2 0* /* /-*</Keywords>

    The folder+ and folder- also don't work ?

     
    • cchris

      cchris - 2009-06-12

      First, I'd advise using the User Defined Language dialog instead of tweaking the xml directly. It's easier and less error prone I think.

      Uncheck the prefix checkboxes, they probably interfere fith some of your folder keywords.
      Check that your regular keyword lists don't include anything listed in the folder+/folder- lists.
      Your >* is a line comment, add it in that edit area.
      The "* at column 7" won't be supported, because LexUser.cxx does not make any processing based on exact position in the file.
      I don't really understand what you wrote in the Comment tag. If there is no block comment, ie a way to comment from any position to any position downstream, then remove these contents.

      HTH
      CChris