I have the following ANTLR grammar.
grammar DDGrammar;
ddstmt: dd2 EOF;
dd2: splddstart inlinerec;
splddstart: '//' NAME DDWORD '*' NL;
inlinerec: NON_JCL_CARD* END_OF_FILE ;
DDWORD:'DD';
//DUMMYWORD: 'DUMMY';
NAME: [A-Z@#$]+;
NON_JCL_CARD : ~'/' {getCharPositionInLine() == 1}? .*? ( NL | EOF ) ;
END_OF_FILE : '/' {getCharPositionInLine() == 1}? '*' ;
NL : '\r' '\n' ;
WS : [ \t]+ -> skip ;
For the input :
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND
any other program input @ $ ! & %
/*
I get the following error.
DDGrammar::ddstmt:1:2: mismatched input 'SYSIN DD * \r\n' expecting NAME Looks like SYSIN is not recognised as a NAME token. Actually a similar grammar did work sometime back. See mismatched input error. But now the same doesnt seem to work for me.