Skip to content
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

definitions inconsistencies between lex and jison #333

Open
mbroadst opened this issue Oct 10, 2016 · 1 comment
Open

definitions inconsistencies between lex and jison #333

mbroadst opened this issue Oct 10, 2016 · 1 comment

Comments

@mbroadst
Copy link

Hi, I'm attempting to port the ansi C lex grammar here and running into issues with the initial definitions, specifically with the sections:

FS          (f|F|l|L)
IS          (u|U|l|L)*

throwing an Error: Could not parse lex grammar error.

It's my understanding that these should just be regular expressions, so I'm not sure why jison is having trouble parsing them. I'm sure I'm missing something very simple here, but a cursory perusal of the documentation didn't elicit anything on this end - hopefully someone can correct me.

@GerHobbelt
Copy link
Contributor

AFAICT this is a 'problem' in the 'vanilla' lexer, which requires double-quotes around literal parts of a lexer rule regex, i.e.

FS          ("f"|"F"|"l"|"L")
IS          ("u"|"U"|"l"|"L")*

should work.

The GerHobbelt fork doesn't exhibit this problem as I augmented the lexer to recognize literal regex parts without the need for quotes, whenever possible, as this was pretty frustrating to me, back when I started out using jison (and having grown up on yacc/bison/lex/flex and similar code generators)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants