Class TokenVocabParser

java.lang.Object
org.antlr.v4.parse.TokenVocabParser

public class TokenVocabParser extends Object
  • Field Details

  • Constructor Details

    • TokenVocabParser

      public TokenVocabParser(Grammar g)
  • Method Details

    • load

      public Map<String,Integer> load()
      Load a vocab file <vocabName>.tokens and return mapping.
    • getImportedVocabFile

      public File getImportedVocabFile()
      Return a File descriptor for vocab file. Look in library or in -o output path. antlr -o foo T.g4 U.g4 where U needs T.tokens won't work unless we look in foo too. If we do not find the file in the lib directory then must assume that the .tokens file is going to be generated as part of this build and we have defined .tokens files so that they ALWAYS are generated in the base output directory, which means the current directory for the command line tool if there was no output directory specified.