[antlr-interest] Having the "include" file as part the AST

Silvain Piree s.piree at enneya.com
Mon May 12 09:09:12 PDT 2003


> I am struggling with the INCLUDE file mechanism.  It hides 
> the INCLUDE file statement from the main parser. 
> An INCLUDE statement is not part of the C language.  

There are several constructs in JCL that need to be handled 
before actual parsing can be performed, e.g.

- symbol substitution (EXEC PROC, SET, PROC, etc.)
- file include (EXEC PROC, INCLUDE)
- inline data (DD *, DD DLM=...)
- etc.

I would advise you to take the preprocessor route. It would be 
VERY difficult to build a one-pass parser that does both
preprocessing and parsing.

In fact, even the preprocessing of JCL is pretty complex.

Hope this helps, kind greetings,

Silvain Piree
Refactive (www.refactive.com)


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list