[antlr-interest] COBOL question

Putrycz, Erik Erik.Putrycz at nrc-cnrc.gc.ca
Fri Feb 10 10:23:22 PST 2006


I'm trying to adapt the Open COBOL grammar to ANTLR and I'm struggling a
little... My goal is to build an AST of a COBOL program. I'm not too
familiar with lexers/parsers... 

How can I deal with the line number that starts each line?

It seems in the OpenCobol grammar, it is suppressed by a pre-processor
but I wouldn't mind having it in the AST.

How to build a Lexer rule for the line number?

Here is a COBOL line example

000010 IDENTIFICATION DIVISION.

And I want to deal with the starting 6 numbers...

 

Thanks,

 

Erik Putrycz, Ph.D - Research Associate /
<mailto:erik.putrycz at nrc-cnrc.gc.ca> erik.putrycz at nrc-cnrc.gc.ca / (613)
990 0681

Institute for Information Technology - Software Engineering Group

National Research Council, Canada - Building M-50, 1200 Montreal Road

Ottawa, Ontario, CANADA K1A 0R6

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060210/a8f7fb5f/attachment.html


More information about the antlr-interest mailing list