diff --git a/tool/src/org/antlr/v4/tool/DOTGenerator.java b/tool/src/org/antlr/v4/tool/DOTGenerator.java index 3788310dd..59ade7691 100644 --- a/tool/src/org/antlr/v4/tool/DOTGenerator.java +++ b/tool/src/org/antlr/v4/tool/DOTGenerator.java @@ -284,7 +284,7 @@ public class DOTGenerator { SetTransition set = (SetTransition)edge; String label = set.label().toString(); if ( isLexer ) label = set.label().toString(true); - else if ( grammar!=null ) label = set.label().toString(grammar.getTokenNames()); + else if ( grammar!=null ) label = set.label().toString(grammar.getTokenDisplayNames()); if ( edge instanceof NotSetTransition ) label = "~"+label; edgeST.add("label", getEdgeLabel(label)); } @@ -293,7 +293,7 @@ public class DOTGenerator { RangeTransition range = (RangeTransition)edge; String label = range.label().toString(); if ( isLexer ) label = range.toString(); - else if ( grammar!=null ) label = range.label().toString(grammar.getTokenNames()); + else if ( grammar!=null ) label = range.label().toString(grammar.getTokenDisplayNames()); edgeST.add("label", getEdgeLabel(label)); } else { diff --git a/tool/src/org/antlr/v4/tool/Grammar.java b/tool/src/org/antlr/v4/tool/Grammar.java index acf7d00d7..fbdcbdf17 100644 --- a/tool/src/org/antlr/v4/tool/Grammar.java +++ b/tool/src/org/antlr/v4/tool/Grammar.java @@ -1121,7 +1121,7 @@ public class Grammar implements AttributeResolver { char[] serializedAtn = ATNSerializer.getSerializedAsChars(atn); ATN deserialized = new ATNDeserializer().deserialize(serializedAtn); - return new LexerInterpreter(fileName, Arrays.asList(getTokenNames()), Arrays.asList(getRuleNames()), ((LexerGrammar)this).modes.keySet(), deserialized, input); + return new LexerInterpreter(fileName, Arrays.asList(getTokenDisplayNames()), Arrays.asList(getRuleNames()), ((LexerGrammar)this).modes.keySet(), deserialized, input); } public ParserInterpreter createParserInterpreter(TokenStream tokenStream) { @@ -1131,6 +1131,6 @@ public class Grammar implements AttributeResolver { char[] serializedAtn = ATNSerializer.getSerializedAsChars(atn); ATN deserialized = new ATNDeserializer().deserialize(serializedAtn); - return new ParserInterpreter(fileName, Arrays.asList(getTokenNames()), Arrays.asList(getRuleNames()), deserialized, tokenStream); + return new ParserInterpreter(fileName, Arrays.asList(getTokenDisplayNames()), Arrays.asList(getRuleNames()), deserialized, tokenStream); } }