[antlr-interest] IBM MVS JCL recognition
Jim.OConnor at microfocus.com
Thu Mar 13 10:58:41 PST 2003
JCL has a number of fun recognition problems for which ANTLR might have
solutions. There hasn't been a publicly available JCL grammar, as far as I
know. I'll start with a direct ANTLR related question, just to get the ball
JCL has "symbolic replacement". For example, "OBJECT" below would be
assigned a value, say "FILE.NAME".
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1)
which results in
//SYSLIN DD DSN=FILE.NAME,UNIT=SYSDA,SPACE=(CYL,1)
For this example I see a TokenStreamFilter working nicely. I gather the
definitions (Hashtable), get a "symbolic" token, look up the definition and
replace the text.
Another example gets more complicated. Setting OBJECT =
"FILE.NEW,MYOPTION(1,4)", would translate to
//SYSLIN DD DSN=FILE.NEW,MYOPTION(1,4),UNIT=SYSDA,SPACE=(CYL,1)
I don't have a token for token match. I would be more comfortable
resorting back to a character stream and re-lexing. I'd be glad to make the
example clearer if it isn't well described.
Looking forward to hearing opinions, comments and being directed down
productive paths..... if there is such parsing JCL.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest