Package com.javacc
Class Grammar.Utils
- java.lang.Object
-
- com.javacc.Grammar.Utils
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
-
-
-
Method Detail
-
pushNodeVariableName
public void pushNodeVariableName(String jjtThis)
-
popNodeVariableName
public void popNodeVariableName()
-
toHexString
public String toHexString(int i)
-
toHexStringL
public String toHexStringL(long l)
-
toOctalString
public String toOctalString(int i)
-
nodeIsInterface
public boolean nodeIsInterface(String nodeName)
-
bitSetToLongArray
public long[] bitSetToLongArray(BitSet bs, int numLongs)
-
codePointAsString
public String codePointAsString(int ch)
-
isBitSet
public boolean isBitSet(long num, int bit)
-
firstCharAsInt
public int firstCharAsInt(String s)
-
powerOfTwoInHex
public String powerOfTwoInHex(int i)
-
displayChar
public String displayChar(int ch)
- 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
public String displayChars(int[] char_array)
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.
-
startProduction
public String startProduction()
-
endProduction
public String endProduction()
-
translateParameters
public String translateParameters(String parameterList) throws ParseException
- Throws:
ParseException
-
translateString
public String translateString(String expr) throws ParseException
- Throws:
ParseException
-
translateCodeBlock
public String translateCodeBlock(String cb, int indent) throws ParseException
- Throws:
ParseException
-
translateInjectedClass
public String translateInjectedClass(CodeInjector injector, String name)
-
translateInjections
public String translateInjections(String className, CodeInjector injector, boolean fields)
-
injectedFieldNames
public List<String> injectedFieldNames(String className, CodeInjector injector)
-
injectedTokenFieldNames
public List<String> injectedTokenFieldNames(CodeInjector injector)
-
injectedLexerFieldNames
public List<String> injectedLexerFieldNames(CodeInjector injector)
-
injectedParserFieldNames
public List<String> injectedParserFieldNames(CodeInjector injector)
-
translateTokenInjections
public String translateTokenInjections(CodeInjector injector, boolean fields)
-
translateLexerInjections
public String translateLexerInjections(CodeInjector injector, boolean fields)
-
translateParserInjections
public String translateParserInjections(CodeInjector injector, boolean fields)
-
translateTokenSubclassInjections
public String translateTokenSubclassInjections(String className, CodeInjector injector, boolean fields)
-
-