getting Error in AQL.g4

20 views
Skip to first unread message

Sourabh Gupta

unread,
Feb 7, 2017, 9:42:55 PM2/7/17
to antlr-di...@googlegroups.com
fragment
URISTRING : ALPHANUM|'_'|'-'|'/'|':'|'.'|'?'|'&'|'%'|'$'|'#'|'@'|'!'|'+'|'='|'*';
fragment
REGEXCHAR : URISTRING|'('|')'|'\\'|'^'|'{'|'}'|']'|'[';
// Terminal Definitions
BOOLEAN : 'true' | 'false' | 'TRUE' | 'FALSE' ;
NODEID : 'at' DIGIT+;
IDENTIFIER : ('a'|'A') (ALPHANUM|'_')*
| LETTERMINUSA IDCHAR*;
INTEGER : '\''? '-'? DIGIT+ '\''?;
FLOAT : '\''? '-'? DIGIT+ '.' DIGIT+ '\''?;
DATE : '\'' DIGIT DIGIT DIGIT DIGIT '-' DIGIT
DIGIT '-' DIGIT DIGIT 'T' DIGIT DIGIT ':' DIGIT DIGIT
':' DIGIT DIGIT ',' DIGIT DIGIT DIGIT '+' DIGIT DIGIT
':' DIGIT DIGIT '\'';
PARAMETER : '$' LETTER IDCHAR*;
UNIQUEID : DIGIT+ ('.' DIGIT+)+ '.' DIGIT+ // OID
| HEXCHAR+ ('-' HEXCHAR+)+ // UUID;
ARCHETYPEID : LETTER+ '-' LETTER+ '-' (LETTER|'_')+ '.'(IDCHAR|'-')+ '.v' DIGIT+ ('.' DIGIT+)? ;
EQUALTO : '=' ;
NOTEQUALTO : '!=' ;
GREATERTHAN : '>' ;
GREATERTHANEQUALTO : '>=' ;
LESSTHAN : '<' ;
LESSTHANEQUALTO : '<=' ;
URIVALUE : LETTER+ '://' (URISTRING|'['|']'|', \''|'\'')* ;
REGEXPATTERN : '{/' REGEXCHAR+ '/}';
STRING : '"' ( ESC_SEQ | ~('\\'|'"') )* '"'
| '\'' ( ESC_SEQ | ~('\\'|'\'') )* '\''
| '\''? ('a'|'A') (ALPHANUM|'_')* '\''?
| '\''? LETTERMINUSA IDCHAR* '\''?;
SLASH : '/';
COMMA : ',';
CURLYOPEN : '{';
CURLYCLOSE : '}';
OPENBRACKET : '[';
CLOSEBRACKET : ']';
OPEN : '(';
CLOSE : ')';


I am getting error
error(50): Aql.g4:247:0: syntax error: unterminated rule (missing ';') detected at 'ARCHETYPEID :' while looking for lexer rule element
Aql.g4

Jim Idle

unread,
Feb 7, 2017, 9:44:50 PM2/7/17
to antlr-di...@googlegroups.com

On Wed, Feb 8, 2017 at 10:42 AM, Sourabh Gupta <saura...@gmail.com> wrote:
UNIQUEID : DIGIT+ ('.' DIGIT+)+ '.' DIGIT+ // OID
| HEXCHAR+ ('-' HEXCHAR+)+ // UUID

​Neither of the above rules have a terminating ';' :)

Jim​

Sourabh Gupta

unread,
Feb 7, 2017, 9:48:22 PM2/7/17
to antlr-discussion
Even after adding ';' in UNIQUEID : DIGIT+ ('.' DIGIT+)+ '.' DIGIT+ // OID
| HEXCHAR+ ('-' HEXCHAR+)+ // UUID 
I get same error message

Norman Dunbar

unread,
Feb 8, 2017, 3:43:52 AM2/8/17
to antlr-di...@googlegroups.com, Sourabh Gupta
Silly question, but, did you add the semicolon before or after the comment?
If you still get the error, I'm thinking that you might inadvertently have added it after the comment .


Cheers,
Norm.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Reply all
Reply to author
Forward
0 new messages