Package com.javacc
Class Grammar.Utils
java.lang.Object
com.javacc.Grammar.Utils
- Enclosing class:
Grammar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEscapes(String input) long[]bitSetToLongArray(BitSet bs, int numLongs) codePointAsString(int ch) displayChar(int ch) displayChars(int[] char_array) This method is only here to help with debugging NFA state-related logic in templates.intgetPreprocessorSymbol(String key, String defaultValue) injectedFieldNames(String className, CodeInjector injector) injectedLexerFieldNames(CodeInjector injector) injectedParserFieldNames(CodeInjector injector) injectedTokenFieldNames(CodeInjector injector) booleanisBitSet(long num, int bit) booleannodeIsInterface(String nodeName) voidpowerOfTwoInHex(int i) voidpushNodeVariableName(String jjtThis) toHexString(int i) toHexStringL(long l) toOctalString(int i) translateCodeBlock(String cb, int indent) translateExpression(Node expr) translateIdentifier(String ident) translateInjectedClass(CodeInjector injector, String name) translateInjections(String className, CodeInjector injector, boolean fields) translateLexerInjections(CodeInjector injector, boolean fields) translateParameters(String parameterList) translateParserInjections(CodeInjector injector, boolean fields) translateString(String expr) translateTokenInjections(CodeInjector injector, boolean fields) translateTokenSubclassInjections(String className, CodeInjector injector, boolean fields)
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
pushNodeVariableName
-
popNodeVariableName
public void popNodeVariableName() -
toHexString
-
toHexStringL
-
toOctalString
-
lastPart
-
nodeIsInterface
-
addEscapes
-
bitSetToLongArray
-
codePointAsString
-
isBitSet
public boolean isBitSet(long num, int bit) -
firstCharAsInt
-
powerOfTwoInHex
-
getID
-
getPreprocessorSymbol
-
displayChar
- Parameters:
ch- the code point. If it is not ASCII, we just display the integer in hex.- Returns:
- a String to use in generated Java code. Rather than display the integer 97, we display 'a', for example.
-
displayChars
This method is only here to help with debugging NFA state-related logic in templates. Sometimes, you want to see ASCII rather than code points.- Parameters:
char_array- a list of code points.- Returns:
- a String to use in generated template code.
-
tokenSubClassInfo
-
translateIdentifier
-
startProduction
-
endProduction
-
translateParameters
- Throws:
ParseException
-
translateExpression
-
translateString
- Throws:
ParseException
-
getTokenNames
-
translateCodeBlock
- Throws:
ParseException
-
translateNonterminalArgs
-
translateInjectedClass
-
translateInjections
-
injectedFieldNames
-
injectedTokenFieldNames
-
injectedLexerFieldNames
-
injectedParserFieldNames
-
translateTokenInjections
-
translateLexerInjections
-
translateParserInjections
-
translateTokenSubclassInjections
public String translateTokenSubclassInjections(String className, CodeInjector injector, boolean fields) -
getSortedNodeClassNames
-