Hello,
I would like to make my own translator but has faced with one problem - lexer's
rules overlapping. I want to have two lexer rules like this:
ID 'a'..'z'+;
ENG 'a'..'z';
and
INT '0'..'9'+;
DIG '0'..'9;
I need it because it is necessary to catch input text errors while parsing.
The purpose of these lexer rules is demonstrated below:
word:
'inputword' ':' (ENG|DIG) 'in' '['axsis']' ';'
;
axis:
INT (',' INT)*
;
I have find only one solution of this problem
word:
'inputword' ':' (ID|INT) 'in' '['axsis']' ';'
; //^ it is important that here was placed only one
character
and then find input errors (like this 123 in [1,2,3]) by the tree grammar
Thank you,
John
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---