Package org.javacc.parser
Class JavaCCGlobals
java.lang.Object
org.javacc.parser.JavaCCGlobals
- Direct Known Subclasses:
CPPFiles
,JavaCCParserInternals
,JavaFiles
,JJDocGlobals
,LookaheadCalc
,OtherFilesGen
,OtherFilesGenCPP
,Semanticize
This package contains data created as a result of parsing and semanticizing
a JavaCC input file. This data is what is used by the back-ends of JavaCC as
well as any other back-end of JavaCC related tools such as JJTree.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic List
<NormalProduction> A list of all grammar productions - normal and JAVACODE - in the order they appear in the input file.protected static int
protected static int
This is the list of all tokens that appear after the tokens in "cu_to_insertion_point_2" and until "PARSER_END(name)".static String
The name of the parser class (what appears in PARSER_BEGIN and PARSER_END).This is a list of tokens that appear after "PARSER_BEGIN(name)" all the way until (but not including) the opening brace "{" of the class "name".This is the list of all tokens that appear after the tokens in "cu_to_insertion_point_1" and until (but not including) the closing brace "}" of the class "name".static String
The name of the grammar file being processed.protected static int
static boolean
Set to true if this file has been processed by JJTree.A mapping of the internal integer representations of lexical states to their strings.A mapping of lexical state strings to their integer internal representation.static boolean
protected static int
maskindex, jj2index, maskVals are variables that are shared between ParseEngine and ParseGen.protected static List
static Map
This is a symbol table that contains all named tokens (those that are defined with a label).A mapping of ordinal values (represented as objects of type "Integer") to the corresponding labels (of type "String").static List
<RegularExpression> Contains the same entries as "named_tokens_table", but this is an ordered list which is ordered by the order of appearance in the input file.static String
The name of the original file (before processing by JJTree).static Token
static Token
static Map
A symbol table of all grammar productions - normal and JAVACODE.static List
<TokenProduction> The list of all TokenProductions from the input file.static Map
<Integer, RegularExpression> A mapping of ordinal values (represented as objects of type "Integer") to the corresponding RegularExpression's.static Hashtable
This is a three-level symbol table that contains all simple tokens (those that are defined using a single string (with or without a label).static List
The declarations to be inserted into the TokenManager class.static int
The total number of distinct tokens.protected static final String
String that identifies the JavaCC generated files.The list of tools that have participated in generating the input grammar file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
add_escapes
(String str) static String
addUnicodeEscapes
(String str) static void
bannerLine
(String fullName, String ver) This prints the banner line when the various tools are invoked.static void
createOutputDir
(File outputDir) static String
getIdString
(String toolName, String fileName) Returns the identifying string for the file name, given a toolname used to generate it.static String
getIdString
(List<String> toolNames, String fileName) Returns the identifying string for the file name, given a set of tool names that are used to generate it.getToolNames
(String fileName) Returns a List of names of the tools that have been used to generate the given file.static boolean
isGeneratedBy
(String toolName, String fileName) Returns true if tool name passed is one of the tool names returned by getToolNames(fileName).protected static String
protected static void
printLeadingComments
(Token t, PrintWriter ostr) protected static String
printToken
(Token t) protected static void
printToken
(Token t, PrintWriter ostr) protected static void
printTokenList
(List<Token> list, PrintWriter ostr) protected static String
protected static void
printTokenOnly
(Token t, PrintWriter ostr) protected static void
protected static String
protected static void
printTrailingComments
(Token t, PrintWriter ostr) static void
reInit()
static String
-
Field Details
-
toolName
String that identifies the JavaCC generated files.- See Also:
-
fileName
The name of the grammar file being processed. -
origFileName
The name of the original file (before processing by JJTree). Currently this is the same as fileName. -
jjtreeGenerated
public static boolean jjtreeGeneratedSet to true if this file has been processed by JJTree. -
toolNames
The list of tools that have participated in generating the input grammar file. -
cu_name
The name of the parser class (what appears in PARSER_BEGIN and PARSER_END). -
cu_to_insertion_point_1
This is a list of tokens that appear after "PARSER_BEGIN(name)" all the way until (but not including) the opening brace "{" of the class "name". -
cu_to_insertion_point_2
This is the list of all tokens that appear after the tokens in "cu_to_insertion_point_1" and until (but not including) the closing brace "}" of the class "name". -
cu_from_insertion_point_2
This is the list of all tokens that appear after the tokens in "cu_to_insertion_point_2" and until "PARSER_END(name)". -
bnfproductions
A list of all grammar productions - normal and JAVACODE - in the order they appear in the input file. Each entry here will be a subclass of "NormalProduction". -
production_table
A symbol table of all grammar productions - normal and JAVACODE. The symbol table is indexed by the name of the left hand side non-terminal. Its contents are of type "NormalProduction". -
lexstate_S2I
A mapping of lexical state strings to their integer internal representation. Integers are stored as java.lang.Integer's. -
lexstate_I2S
A mapping of the internal integer representations of lexical states to their strings. Integers are stored as java.lang.Integer's. -
token_mgr_decls
The declarations to be inserted into the TokenManager class. -
rexprlist
The list of all TokenProductions from the input file. This list includes implicit TokenProductions that are created for uses of regular expressions within BNF productions. -
tokenCount
public static int tokenCountThe total number of distinct tokens. This is therefore one more than the largest assigned token ordinal. -
named_tokens_table
This is a symbol table that contains all named tokens (those that are defined with a label). The index to the table is the image of the label and the contents of the table are of type "RegularExpression". -
ordered_named_tokens
Contains the same entries as "named_tokens_table", but this is an ordered list which is ordered by the order of appearance in the input file. -
names_of_tokens
A mapping of ordinal values (represented as objects of type "Integer") to the corresponding labels (of type "String"). An entry exists for an ordinal value only if there is a labeled token corresponding to this entry. If there are multiple labels representing the same ordinal value, then only one label is stored. -
rexps_of_tokens
A mapping of ordinal values (represented as objects of type "Integer") to the corresponding RegularExpression's. -
simple_tokens_table
This is a three-level symbol table that contains all simple tokens (those that are defined using a single string (with or without a label). The index to the first level table is a lexical state which maps to a second level hashtable. The index to the second level hashtable is the string of the simple token converted to upper case, and this maps to a third level hashtable. This third level hashtable contains the actual string of the simple token and maps it to its RegularExpression. -
maskindex
protected static int maskindexmaskindex, jj2index, maskVals are variables that are shared between ParseEngine and ParseGen. -
jj2index
protected static int jj2index -
lookaheadNeeded
public static boolean lookaheadNeeded -
maskVals
-
otherLanguageDeclTokenBeg
-
otherLanguageDeclTokenEnd
-
cline
protected static int cline -
ccol
protected static int ccol
-
-
Constructor Details
-
JavaCCGlobals
public JavaCCGlobals()
-
-
Method Details
-
bannerLine
This prints the banner line when the various tools are invoked. This takes as argument the tool's full name and its version. -
getIdString
Returns the identifying string for the file name, given a toolname used to generate it. -
getIdString
Returns the identifying string for the file name, given a set of tool names that are used to generate it. -
isGeneratedBy
Returns true if tool name passed is one of the tool names returned by getToolNames(fileName). -
getToolNames
Returns a List of names of the tools that have been used to generate the given file. -
createOutputDir
-
staticOpt
-
add_escapes
-
addUnicodeEscapes
-
printTokenSetup
-
printTokenOnly
-
printToken
-
printTokenList
-
printLeadingComments
-
printTrailingComments
-
printTokenOnly
-
printToken
-
printLeadingComments
-
printTrailingComments
-
reInit
public static void reInit()
-