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

mzukowski at yci.com mzukowski at yci.com
Mon May 12 08:59:24 PDT 2003


Although the lexer will be switching the lexers to actually include those
files (to avoid feedback from the parser), you can still pass the tokens on
to the parser and from there invoke the parser top-level rule.  When it
finishes you can put the resulting tree under an INCLUDE root.  

Monty

-----Original Message-----
From: Jim O'Connor [mailto:Jim.OConnor at microfocus.com]
Sent: Monday, May 12, 2003 8:33 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Having the "include" file as part the AST


Hi All,
	I am working with the Job Control Language (JCL).  It has statements
that "describe" INCLUDE-type files.

//**** Main File ****/
//LABEL1   EXEC PROC=MYPROC,SYMB1=VALUE1


/*********  Proc file: MYPROC.PRC *********/
//D1      DD       DSN=DATAFILE,DISP=&SYMB1
//D2      DD      DUMMY



What would result for processing is

//LABEL1   EXEC PROC=MYPROC,SYMB1=VALUE1
//D1      DD       DSN=DATAFILE,DISP=VALUE1
//D2      DD      DUMMY



	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.  It is part of pre-processing.

	With my JCL parser, I am trying to create an AST that contains the
EXEC PROC statement.  Is there a mechanism that passes the "//" "LABEL1"
"EXEC" "PROC" "=" "MYPROC" tokens to the parser while starting the new lexer
at the correct time?  Is this description clear?
Jim


 

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


 

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




More information about the antlr-interest mailing list