LR(1) grammar/parser and lookahead-restrictions

Michael Dyck jmdyck at ibiblio.org
Wed Jan 11 18:28:33 UTC 2017


In the past, it has been said (usually by Brendan Eich) that TC39 intends 
that the ECMAScript grammar be LR(1). Is that still the case? (I'm not so 
much asking about the "1", but more about the "LR".)

If so, I'm wondering how lookahead-restrictions (e.g., [lookahead <! 
terminals]) fit into the LR approach. It seems like there are three 
possibilities:
   - modify the grammar (before the parser is constructed),
   - modify the construction of the parser, and/or
   - modify the operation of the parser.
It's not clear to me that any of these (or any combination of these) will work.

Has anyone algorithmically generated an LR parser from the spec grammar? If 
so, how did you you handle lookahead-restrictions?

-Michael


More information about the es-discuss mailing list