Top Fields Constructors Methods
org.antlr.v4.parse

public Class TokenVocabParser

extends Object
Class Inheritance
Imports
org.antlr.runtime.Token, org.antlr.v4.Tool, org.antlr.v4.codegen.CodeGenerator, org.antlr.v4.tool.ErrorType, .Grammar, org.antlr.v4.tool.ast.GrammarAST, java.io.BufferedReader, .File, .FileInputStream, .FileNotFoundException, .IOException, .InputStreamReader, java.util.LinkedHashMap, .Map, java.util.regex.Matcher, .Pattern

Field Summary

Modifier and TypeField and Description
protected final Grammar
g

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public File
getImportedVocabFile()

Return a File descriptor for vocab file.

public Map<String, Integer>
load()

Load a vocab file <vocabName>.tokens and return mapping.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

gback to summary
protected final Grammar g

Constructor Detail

TokenVocabParserback to summary
public TokenVocabParser(Grammar g)

Method Detail

getImportedVocabFileback to summary
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.

loadback to summary
public Map<String, Integer> load()

Load a vocab file <vocabName>.tokens and return mapping.