Remove tree parser reference
This commit is contained in:
parent
922fe53bdd
commit
fbfa61c3dd
|
@ -46,7 +46,6 @@ public class ATN {
|
|||
|
||||
public static final int PARSER = 1;
|
||||
public static final int LEXER = 2;
|
||||
public static final int TREE_PARSER = 3;
|
||||
|
||||
@NotNull
|
||||
public final List<ATNState> states = new ArrayList<ATNState>();
|
||||
|
|
|
@ -90,9 +90,20 @@ public class ATNSerializer {
|
|||
IntegerList data = new IntegerList();
|
||||
data.add(ATNSimulator.SERIALIZED_VERSION);
|
||||
// convert grammar type to ATN const to avoid dependence on ANTLRParser
|
||||
if ( g.getType()== ANTLRParser.LEXER ) data.add(ATN.LEXER);
|
||||
else if ( g.getType()== ANTLRParser.PARSER ) data.add(ATN.PARSER);
|
||||
else data.add(ATN.TREE_PARSER);
|
||||
switch (g.getType()) {
|
||||
case ANTLRParser.LEXER:
|
||||
data.add(ATN.LEXER);
|
||||
break;
|
||||
|
||||
case ANTLRParser.PARSER:
|
||||
case ANTLRParser.COMBINED:
|
||||
data.add(ATN.PARSER);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new UnsupportedOperationException("Invalid grammar type.");
|
||||
}
|
||||
|
||||
data.add(g.getMaxTokenType());
|
||||
int nedges = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue