diff --git a/runtime/Java/src/org/antlr/v4/runtime/Vocabulary.java b/runtime/Java/src/org/antlr/v4/runtime/Vocabulary.java index 0b6386c8e..46c4af1f7 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/Vocabulary.java +++ b/runtime/Java/src/org/antlr/v4/runtime/Vocabulary.java @@ -37,6 +37,14 @@ package org.antlr.v4.runtime; * @author Sam Harwell */ public interface Vocabulary { + + /** + * Returns the highest token type value. It can be used to iterate from + * zero to that number, thus querying all stored entries. + * @return the highest token type value + */ + int getMaxTokenType(); + /** * Gets the string literal associated with a token type. The string returned * by this method, when not {@code null}, can be used unaltered in a parser @@ -85,7 +93,7 @@ public interface Vocabulary { * *