How to match "TOKEN anything up to the next newline" #4817
Replies: 1 comment
-
I finally worked it out. Here's the modified grammar:
|
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 am learning Antlr 4.
To start with I'm trying to devise a simple
.ini
parser.Example
.ini
file:Here's the grammar I've come up with:
And here's the output when I dump the results:
The second line of the error message says "no viable alternative at input ';'", i.e., at the very first character in the example. However, as far as I can tell antlr should try
comment
which it should match at the;
. Nor do I understand why it has eaten the/
s in the last line. So I can't see what I'm doing wrong.Beta Was this translation helpful? Give feedback.
All reactions