-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ANTLR - mismatched input error #1602
Comments
Hi,
please close this and get support from the google discussion group.
Eric
… Le 13 janv. 2017 à 12:45, ssdimmanuel ***@***.***> a écrit :
I have a grammar which looks like this consisting of comment and control statements of a particular language:
Grammar:
grammar DD;
ddlist: (ddstmt| jclcomment)+;
ddstmt: dd1 | dd2 | dd3 | dd4 ;
dd1: JCLBEGIN ddname DDWORD 'DUMMY';
dd2: JCLBEGIN ddname DDWORD 'DYNAM';
dd3: JCLBEGIN ddname DDWORD NAME'=' (''|NAME);
dd4: JCLBEGIN ddname DDWORD '' inlinerec INLINESTMTEND?;
inlinerec: (INLINEDATA )+ ;
fragment INLINEDATA: (~[\r\n])*;
ddname: NAME;
jclcomment: JCLCOMMENT+;
JCLCOMMENT: COMMENTBEGIN ~[\r\n]*;
DDWORD: 'DD';
JCLBEGIN: '//' ;
COMMENTBEGIN: '//' ;
INLINESTMTEND: '/' ;
NAME : [A-Z#] (ALPHA | NUMBER | SPECIALCHARS)*;
NUMBER: [0-9];
ALPHA: [A-Z];
SPECIALCHARS: '#' | '@' | '$';
STRING
: ''' ([\r\n"])* '''
| '"' ([\r\n"])* '"'
;
WS : [ \r\n] -> channel(HIDDEN);
My input is this:
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND
/*
//SYSPRINT DD SYSOUT=*
//* Comment line #1 <#1>
//* Comment line #2 <#2>
//SYSOUT DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//* Comment line #3 <#3>
//SYSUDUMP DD SYSOUT=A
When I use AntlrWorks to run this grammar with the input, I get the following error:
line 2:0 mismatched input 'SORT' expecting INLINEDATA
How can this error be resolved ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#1602>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADLYJMWFEndUKWhEe20B2hMSl6HiW5j3ks5rRwF8gaJpZM4LihX7>.
|
Thanks Eric. Closing this issue and opened the same question in the google forum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a grammar which looks like this consisting of comment and control statements of a particular language:
Grammar:
grammar DD;
ddlist: (ddstmt| jclcomment)+;
ddstmt: dd1 | dd2 | dd3 | dd4 ;
dd1: JCLBEGIN ddname DDWORD 'DUMMY';
dd2: JCLBEGIN ddname DDWORD 'DYNAM';
dd3: JCLBEGIN ddname DDWORD NAME'=' (''|NAME);
dd4: JCLBEGIN ddname DDWORD '' inlinerec INLINESTMTEND?;
inlinerec: (INLINEDATA )+ ;
fragment INLINEDATA: (~[\r\n])*;
ddname: NAME;
jclcomment: JCLCOMMENT+;
JCLCOMMENT: COMMENTBEGIN ~[\r\n]*;
DDWORD: 'DD';
JCLBEGIN: '//' ;
COMMENTBEGIN: '//' ;
INLINESTMTEND: '/' ;
NAME : [A-Z#] (ALPHA | NUMBER | SPECIALCHARS)*;
NUMBER: [0-9];
ALPHA: [A-Z];
SPECIALCHARS: '#' | '@' | '$';
WS : [ \r\n] -> channel(HIDDEN);
My input is this:
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND
/*
//SYSPRINT DD SYSOUT=*
//* Comment line #1
//* Comment line #2
//SYSOUT DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//* Comment line #3
//SYSUDUMP DD SYSOUT=A
When I use AntlrWorks to run this grammar with the input, I get the following error:
line 2:0 mismatched input 'SORT' expecting INLINEDATA
How can this error be resolved ?
The text was updated successfully, but these errors were encountered: