[antlr-interest] Parsing OpenEdge (4GL database language) without preprocessor phase

Pieter van Ginkel pvginkel at gmail.com
Fri Jan 28 04:56:06 PST 2011


I need to write a parser for OpenEdge (a 4GL database language), but I need
to preserve facts of the source files that would otherwise be lost through
the preprocessor.

E.g., the following contrived example:

assign customer.name = {myinc.i}.

And an include myinc.i with the contents:

7 * 14

I need to have an AST that contains the fact that customer.name was assigned
with {myinc.i} and not 7 * 14. The includes are normally processed using a
preprocessor, so theoretically it's possible that the includes are accessed
anywhere within a file (not in a neat location like after the assign in the
above example). However, the code base is quite clean and this shouldn't
pose much of a problem.

The reason I need this is that I am writing an application for source
analysis for which I need to know every detail of the source file.

Can this be done with ANTLR? Any tips?


More information about the antlr-interest mailing list