Stumped by an initial very simple grammar #4012
Unanswered
The-Futurist
asked this question in
Q&A
Replies: 1 comment
-
|
Some suggestions:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm reading through Terence Parr's book and experimenting as I go, I'm a Windows user.
The tools seem to work, everything it setup and I'm generating Java for now (will do C# later when I'm more accustomed to all this).
Anyway, I'm stumped, a tiny grammar (literally a tweak from what's in the book) causes me issues, look, here's the grammar and a sample input file:
This is the output from the
gruncommand:I cannot understand why the simplest input
a=1causes a problem! Surely a single digit1meets the definition ofINTin that grammar?Here is the file itself as a raw data dump:
If I change the definition of
INTto be simplyINT: '1' ;then it parses that file fine.Resolved
Ok its Unicode again, here is what's actually in the
g4file:Note, that's actually a 'EN DASH' character with code
E28093- see here.Beta Was this translation helpful? Give feedback.
All reactions