Merge pull request #1484 from parrt/fix-1042

Fixes #1042
This commit is contained in:
Terence Parr 2016-12-10 14:51:42 -08:00 committed by GitHub
commit 89bfd56a76
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ public abstract class Recognizer<Symbol, ATNInterpreter extends ATNSimulator> {
Map<String, Integer> result = tokenTypeMapCache.get(vocabulary);
if (result == null) {
result = new HashMap<String, Integer>();
for (int i = 0; i < getATN().maxTokenType; i++) {
for (int i = 0; i <= getATN().maxTokenType; i++) {
String literalName = vocabulary.getLiteralName(i);
if (literalName != null) {
result.put(literalName, i);