Class TokenVocabParser


  • public class TokenVocabParser
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Grammar g  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File getImportedVocabFile()
      Return a File descriptor for vocab file.
      java.util.Map<java.lang.String,​java.lang.Integer> load()
      Load a vocab file <vocabName>.tokens and return mapping.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TokenVocabParser

        public TokenVocabParser​(Grammar g)
    • Method Detail

      • load

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

        public java.io.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.