OCamlPro / gnucobol

A clone of the sourceforge GnuCOBOL compiler from COBOL to C.
https://get-superbol.com
GNU Lesser General Public License v3.0
16 stars 20 forks source link

remove 78-level constants from the lexer #134

Open lefessan opened 6 months ago

lefessan commented 6 months ago

To get better error messages.

If I understand well, the idea is to remove 78-level constants from the lexer, and replace all the places where they can replace a LITERAL by a rule that also accepts a WORD and checks if it is a 78-level ?

Originally posted by @lefessan in https://github.com/OCamlPro/gnucobol/issues/133#issuecomment-1918624473

GitMensch commented 6 months ago

Not completely, the lexer would return a new token (which gets a new tree if CB_CONST is not good enough), so the parser knows that this is a constant.

Note: This should be handled identical for both the extension level 78 constant and the standard 01 CONSTANT AS.