| java.lang.Object org.antlr.codegen.Target org.antlr.codegen.CPPTarget
escapeString | public String escapeString(String s)(Code) | | Converts a String into a representation that can be use as a literal
when surrounded by double-quotes.
Used for escaping semantic predicate strings for exceptions.
Parameters: s - The String to be changed into a literal |
getMaxCharValue | public int getMaxCharValue(CodeGenerator codegen)(Code) | | Character constants get truncated to this value.
TODO: This should be derived from the charVocabulary. Depending on it
being 255 or 0xFFFF the templates should generate normal character
constants or multibyte ones.
|
getTargetCharLiteralFromANTLRCharLiteral | public String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator codegen, String literal)(Code) | | Convert from an ANTLR char literal found in a grammar file to
an equivalent char literal in the target language. For Java, this
is the identify translation; i.e., '\n' -> '\n'. Most languages
will be able to use this 1-to-1 mapping. Expect single quotes
around the incoming literal.
Depending on the charvocabulary the charliteral should be prefixed with a 'L'
|
getTargetStringLiteralFromANTLRStringLiteral | public String getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator codegen, String literal)(Code) | | Convert from an ANTLR string literal found in a grammar file to
an equivalent string literal in the target language. For Java, this
is the identify translation; i.e., "\"\n" -> "\"\n". Most languages
will be able to use this 1-to-1 mapping. Expect double quotes
around the incoming literal.
Depending on the charvocabulary the string should be prefixed with a 'L'
|
Methods inherited from org.antlr.codegen.Target | protected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, StringTemplate outputFileST) throws IOException(Code)(Java Doc) protected void genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, StringTemplate headerFileST, String extName) throws IOException(Code)(Java Doc) public int getMaxCharValue(CodeGenerator generator)(Code)(Java Doc) public String getTarget64BitStringFromValue(long word)(Code)(Java Doc) public String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)(Code)(Java Doc) public String getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator, String literal)(Code)(Java Doc) public String getTargetStringLiteralFromString(String s, boolean quoted)(Code)(Java Doc) public String getTargetStringLiteralFromString(String s)(Code)(Java Doc) public String getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)(Code)(Java Doc) public boolean isValidActionScope(int grammarType, String scope)(Code)(Java Doc) protected void performGrammarAnalysis(CodeGenerator generator, Grammar grammar)(Code)(Java Doc) public List postProcessAction(List chunks, antlr.Token actionToken)(Code)(Java Doc)
|
|
|