You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following fragment of an LALR(1) automaton as produced by Grammophone:
I was wondering, do you know if this approach to introducing the EOF $ lookahead/follow symbol is the standard approach for doing that, or is this an extension that Grammophone decided to introduce?
What I'm doing in my implementation is to simply give the starting production with the dot on the rightmost side (e.g. S -> A B C •) a $ starting lookahead which should then be propagated to wherever it is expected. One benefit of this approach is that there's no special casing needed for the constituents of a DFA node, that is, all constituents are a real production with a dot. In your case, the constituents of a DFA node can be a production with a dot, or a synthetic production with a dot (e.g. Start •, • Start).
Just wanted to hear your thoughts on that. Do you know which approach is more common?
The text was updated successfully, but these errors were encountered:
So, I’m pretty sure now that this is an extension that is not common outside of grammophone. Items are defined as a production with a dot where a production is defined as a nonterminal symbol and a finite word consisting of terminal and nonterminal symbols. The extension highlighted here introduces a new type of item. I’m going to close this issue as I see it as resolved now.
Hello @mdaines,
Consider the following fragment of an LALR(1) automaton as produced by Grammophone:
I was wondering, do you know if this approach to introducing the EOF
$
lookahead/follow symbol is the standard approach for doing that, or is this an extension that Grammophone decided to introduce?What I'm doing in my implementation is to simply give the starting production with the dot on the rightmost side (e.g.
S -> A B C •
) a$
starting lookahead which should then be propagated to wherever it is expected. One benefit of this approach is that there's no special casing needed for the constituents of a DFA node, that is, all constituents are a real production with a dot. In your case, the constituents of a DFA node can be a production with a dot, or a synthetic production with a dot (e.g.Start •
,• Start
).Just wanted to hear your thoughts on that. Do you know which approach is more common?
The text was updated successfully, but these errors were encountered: