File tree 1 file changed +7
-0
lines changed
org.metaborg.sdf2table/src/main/java/org/metaborg/sdf2table/parsetable
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 15
15
16
16
import com .google .common .collect .*;
17
17
18
+ import static org .metaborg .parsetable .characterclasses .CharacterClassFactory .EOF_SINGLETON ;
19
+
18
20
public class ParseTable implements IParseTable , Serializable {
19
21
20
22
// FIXME Currently generating an LR(0) table, compute first/follow sets to generate SLR(1)
@@ -178,6 +180,11 @@ private void calculateFirst() {
178
180
s .setFirst (((CharacterClassSymbol ) s ).getCC ());
179
181
continue ;
180
182
}
183
+ // The FIRST set of an EOFSymbol is equal to the EOF singleton character class.
184
+ if (s instanceof EOFSymbol ) {
185
+ s .setFirst (EOF_SINGLETON );
186
+ continue ;
187
+ }
181
188
182
189
for (IProduction p : symbolProductionsMapping .get (s )) {
183
190
// Direct contributions:
You can’t perform that action at this time.
0 commit comments