Document the decision
This commit is contained in:
parent
fb2dff51df
commit
c82f53c346
2 changed files with 12 additions and 2 deletions
1
TODO
1
TODO
|
|
@ -1,3 +1,2 @@
|
||||||
- Make terminal and nonterminal spaces disjoint, allow gammars to name them the same way
|
|
||||||
- Generate LALR lookaheads directly from LR0 states, not as LR1 + Merge, for speed
|
- Generate LALR lookaheads directly from LR0 states, not as LR1 + Merge, for speed
|
||||||
(Alternately, implement the Pager/Chen algorithm on LR1 for state merging)
|
(Alternately, implement the Pager/Chen algorithm on LR1 for state merging)
|
||||||
|
|
@ -3,7 +3,18 @@ import pytest
|
||||||
|
|
||||||
|
|
||||||
def test_conflicting_names():
|
def test_conflicting_names():
|
||||||
"""Terminals and nonterminals can have the same name."""
|
"""Terminals and nonterminals cannot have the same name.
|
||||||
|
|
||||||
|
I think that ultimately this gives a nicer experience, in error messages and
|
||||||
|
understandability. The input grammar can distinguish between them throughout,
|
||||||
|
and the system can always be unambiguous when it's working, but at times it
|
||||||
|
needs to report errors or display the grammar to humans. There is no clean
|
||||||
|
notation I can use at that time to distinguish between a terminal an a
|
||||||
|
nonterminal.
|
||||||
|
|
||||||
|
I think this restriction ultimately makes the grammars and the tooling easier
|
||||||
|
to understand.
|
||||||
|
"""
|
||||||
|
|
||||||
IDENTIFIER = parser.Terminal("Identifier")
|
IDENTIFIER = parser.Terminal("Identifier")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue