Replies: 4 comments 8 replies
-
I suggest debugging by seeing the emitted tokens to get the better idea as the issue is not on the parser level but the lexer level - the lexer tries to give the longest possible string to a rule, no matter the order so if you have xstringa it will return an identifier 'xstringa' and not 'x' 'string' 'a' tokens. The other issue is that you define the digits as speical tokens which will cause some problems. I suggest removing the W_НОМЕР_НОЛЬ and inlining the values. |
Beta Was this translation helpful? Give feedback.
-
The Eclipse IDE does not show the token type, which is again why you need to stop using it. Please read this carefully: An Antlr4 lexer works independently from the parser. The lexer matches the LONGEST string first regardless of the order of the lexer rules. But, if two or more lexer rules match a string of the same length, the first one listed is selected. "E+3456" is matched by |
Beta Was this translation helpful? Give feedback.
-
the problem means separately recogninition except full recognition ? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
https://www.youtube.com/watch?v=rfr-CSKrues&feature=youtu.be
In single file it works fine except single character numbers, but after combining into one file it enexpective behave into errors that i can't understand. Why its happens.
Repo : https://gitflic.ru/project/nightmare0/rossijskij-yap
Beta Was this translation helpful? Give feedback.
All reactions