This document explains the usage of cobparse, the Rigi COBOL-Language parser. The Rigi COBOL-language parser is designed to extract entities and the relationships between entities from files of COBOL source code. Currently the entities that the parser extracts are program names, sections, paragraphs, files, and records. The relationships that the parser extracts are calls between programs, performs between sections and paragraphs, and operations on files and records.
cobparse reads preprocessed C programs from standard input and writes the entities, relationships, and attributes it extracts as RSF (Rigi Standard Format) 3-tuples to standard output.
Note: This COBOL parser is highly incomplete and will likely report errors on many programs. It is, however, quite good in recovering from these errors. If you are interested in extending the parser for your needs, you are welcome to request its C++ source code.
Besides the standard Rigi node types (Unknown and Collapse), the COBOL domain contains the following node types:
Besides the standard Rigi node types (level, composite, and multiarc), the COBOL domain contains the following arc types. If you read the elements of an arc in the order element 2, element 1, element 3, then you will have an English sentence that explains the relation:
cobparse does not currently emit node or arc attributes. The htmlrsf program can be used to create standard Rigi nodeurl from 4-tuple RSF files (see Command Line Parameters below).
cobparse accepts the following command line parameters:
-h: print help on cobparse usage
-q: issue no relations in output
-s[<n>]>: stop at nth [1st] syntax error
If this option is used, cobparse will stop parsing when it has encountered n [1] errors.
-d: lex debug (start at <line>), used for debugging cobparse
-4 emit file name and line number as element 4 of tuple
If this option is used, cobparse will emit 4 element tuples. The fourth element of each node, arc, or attribute tuple will contain the file name, line number, and column of the artifact that triggered the creation of the tuple.
-k use a smaller set of reserved words (early COBOL programs).
-7 ignore all lines starting in columns 1-7.
-j ignore all lines starting with '/' in column 1 (JCL).