File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
org.metaborg.sdf2table/src/main/java/org/metaborg/sdf2table/parsetable Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1616
1717import com .google .common .collect .*;
1818
19+ import static org .metaborg .parsetable .characterclasses .CharacterClassFactory .EOF_SINGLETON ;
20+
1921public class ParseTable implements IParseTable , Serializable {
2022
2123 // FIXME Currently generating an LR(0) table, compute first/follow sets to generate SLR(1)
@@ -198,6 +200,11 @@ private void calculateFirst() {
198200 s .setFirst (((CharacterClassSymbol ) s ).getCC ());
199201 continue ;
200202 }
203+ // The FIRST set of an EOFSymbol is equal to the EOF singleton character class.
204+ if (s instanceof EOFSymbol ) {
205+ s .setFirst (EOF_SINGLETON );
206+ continue ;
207+ }
201208
202209 for (IProduction p : symbolProductionsMapping .get (s )) {
203210 // Direct contributions:
You can’t perform that action at this time.
0 commit comments