-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jison not assuming correct grammar #394
Comments
For the AND and OR tokens in your grammar rules, your rules' action code takes their value ( Two ways about it (not tested; YMMV as this should work for the jison-gho fork at least, but not sure about jison itself): 1:
2: augment the lexer to return different token values (which will then be used by the
Second approach is cleaner IMO (and more akin to what you'ld do when doing this in classic |
I'm creating a grammar in jison
This is my jison file:
In my lexical grammar definition i have:
so, whenever in my testfile "e" or "ou" were found they should return "AND" and "OR" respectively.
The problem is, when i test it, instead of returning me "AND" and "OR" it is returning me "e" and "ou".
Take a look:
This is my testfile:
The outputs should be:
However the outputs are:
What i've done wrong?
The text was updated successfully, but these errors were encountered: