public final class JavaCCGlobals extends Object
| Modifier and Type | Field and Description |
|---|---|
static List<NormalProduction> |
BNF_PRODUCTIONS
A list of all grammar productions - normal and JAVACODE - in the order they
appear in the input file.
|
static com.helger.commons.collection.impl.ICommonsList<Token> |
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)".
|
static com.helger.commons.collection.impl.ICommonsList<Token> |
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".
|
static com.helger.commons.collection.impl.ICommonsList<Token> |
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".
|
static Map<Integer,String> |
LEXSTATE_I2S
A mapping of the internal integer representations of lexical states to
their strings.
|
static Map<String,Integer> |
LEXSTATE_S2I
A mapping of lexical state strings to their integer internal
representation.
|
protected static List<int[]> |
MASK_VALS |
static Map<String,AbstractExpRegularExpression> |
NAMED_TOKENS_TABLE
This is a symbol table that contains all named tokens (those that are
defined with a label).
|
static Map<Integer,String> |
NAMES_OF_TOKENS
A mapping of ordinal values (represented as objects of type "Integer") to
the corresponding labels (of type "String").
|
static List<AbstractExpRegularExpression> |
ORDERED_NAME_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.
|
static Map<String,NormalProduction> |
PRODUCTION_TABLE
A symbol table of all grammar productions - normal and JAVACODE.
|
static List<TokenProduction> |
REXPR_LIST
The list of all TokenProductions from the input file.
|
static Map<Integer,AbstractExpRegularExpression> |
REXPS_OF_TOKENS
A mapping of ordinal values (represented as objects of type "Integer") to
the corresponding RegularExpression's.
|
static int |
s_ccol |
static int |
s_cline |
static String |
s_cu_name
The name of the parser class (what appears in PARSER_BEGIN and PARSER_END).
|
static String |
s_fileName
The name of the grammar file being processed.
|
protected static int |
s_jj2index |
static boolean |
s_jjtreeGenerated
Set to true if this file has been processed by JJTree.
|
protected static int |
s_maskindex
maskindex, jj2index, maskVals are variables that are shared between
ParseEngine and ParseGen.
|
static String |
s_origFileName
The name of the original file (before processing by JJTree).
|
static com.helger.commons.collection.impl.ICommonsList<Token> |
s_token_mgr_decls
The declarations to be inserted into the TokenManager class.
|
static int |
s_tokenCount
The total number of distinct tokens.
|
static List<String> |
s_toolNames
The list of tools that have participated in generating the input grammar
file.
|
static Map<String,Map<String,Map<String,AbstractExpRegularExpression>>> |
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).
|
| Constructor and Description |
|---|
JavaCCGlobals() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addEscapes(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(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.
|
static String |
getIdString(String toolName,
String fileName)
Returns the identifying string for the file name, given a toolname used to
generate it.
|
static Token |
getOtherLanguageDeclTokenBegin() |
static Token |
getOtherLanguageDeclTokenEnd() |
static List<String> |
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) |
static boolean |
isLookAheadNeeded() |
protected static String |
printLeadingComments(Token t) |
protected static void |
printLeadingComments(Token t,
PrintWriter ostr) |
static String |
printToken(Token t) |
static void |
printToken(Token t,
PrintWriter ostr) |
protected static void |
printTokenList(List<Token> list,
PrintWriter ostr) |
static String |
printTokenOnly(Token t) |
protected static void |
printTokenOnly(Token t,
PrintWriter ostr) |
static void |
printTokenSetup(Token t) |
static String |
printTrailingComments(Token t) |
static void |
reInitStatic() |
static String |
replaceBackslash(String str)
Replaces all backslashes with double backslashes.
|
static void |
setLookAheadNeeded(boolean bLookAheadNeeded) |
static void |
setOtherLanguageDeclTokenBegin(Token t) |
static void |
setOtherLanguageDeclTokenEnd(Token t) |
public static String s_fileName
public static String s_origFileName
public static boolean s_jjtreeGenerated
public static List<String> s_toolNames
public static String s_cu_name
public static final com.helger.commons.collection.impl.ICommonsList<Token> CU_TO_INSERTION_POINT_1
public static final com.helger.commons.collection.impl.ICommonsList<Token> CU_TO_INSERTION_POINT_2
public static final com.helger.commons.collection.impl.ICommonsList<Token> CU_FROM_INSERTION_POINT_2
public static final List<NormalProduction> BNF_PRODUCTIONS
public static final Map<String,NormalProduction> PRODUCTION_TABLE
public static final Map<String,Integer> LEXSTATE_S2I
public static final Map<Integer,String> LEXSTATE_I2S
public static com.helger.commons.collection.impl.ICommonsList<Token> s_token_mgr_decls
public static final List<TokenProduction> REXPR_LIST
public static int s_tokenCount
public static final Map<String,AbstractExpRegularExpression> NAMED_TOKENS_TABLE
public static final List<AbstractExpRegularExpression> ORDERED_NAME_TOKENS
public static final Map<Integer,String> NAMES_OF_TOKENS
public static final Map<Integer,AbstractExpRegularExpression> REXPS_OF_TOKENS
public static final Map<String,Map<String,Map<String,AbstractExpRegularExpression>>> SIMPLE_TOKENS_TABLE
protected static int s_maskindex
protected static int s_jj2index
protected static final List<int[]> MASK_VALS
public static int s_cline
public static int s_ccol
public static void bannerLine(String fullName, String ver)
fullName - full application namever - version stringpublic static boolean isLookAheadNeeded()
public static void setLookAheadNeeded(boolean bLookAheadNeeded)
public static String getIdString(String toolName, String fileName)
toolName - tool namefileName - file namepublic static String getIdString(List<String> toolNames, String fileName)
toolNames - tool namesfileName - file namespublic static boolean isGeneratedBy(String toolName, String fileName)
toolName - tool namefileName - file nametrue if tool name passed is one of the tool names
returned by getToolNames(fileName).@Nonnull public static List<String> getToolNames(String fileName)
fileName - file namepublic static void createOutputDir(File outputDir)
public static void printTokenSetup(Token t)
protected static void printTokenOnly(@Nonnull Token t, @Nonnull PrintWriter ostr)
public static void printToken(@Nonnull Token t, @Nonnull PrintWriter ostr)
protected static void printTokenList(@Nonnull List<Token> list, @Nonnull PrintWriter ostr)
protected static void printLeadingComments(@Nonnull Token t, @Nonnull PrintWriter ostr)
public static void reInitStatic()
Copyright © 2017–2022 Philip Helger. All rights reserved.