public class CSharpTarget extends Target
targetCharValueEscape| Constructor and Description |
|---|
CSharpTarget(CodeGenerator
|
| Modifier and Type | Method and Description |
|---|---|
String |
encodeIntAsCharEscape(int v)
Assume 16-bit char
|
String |
getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator
Convert from an ANTLR string literal found in a grammar file to an equivalent string literal in the target language.
|
String |
getVersion()
ANTLR tool should check output templates / target are compatible with tool code generation.
|
protected STGroup |
loadTemplates()
|
protected boolean |
visibleGrammarSymbolCausesIssueInGeneratedCode(GrammarAST
|
genFile, genListenerFile, genRecognizerHeaderFile, getAltLabelContextStructName, getCodeGenerator, getElementListName, getElementName, getImplicitRuleLabel, getImplicitSetLabel, getImplicitTokenLabel, getInlineTestSetWordSize, getLanguage, getListLabel, getLoopCounter, getLoopLabel, getRuleFunctionContextStructName, getRuleFunctionContextStructName, getSerializedATNSegmentLimit, getTargetStringLiteralFromString, getTargetStringLiteralFromString, getTemplates, getTokenTypeAsTargetLabel, getTokenTypesAsTargetLabels, grammarSymbolCausesIssueInGeneratedCode, supportsOverloadedMethods, templatesExist, wantsBaseListener, wantsBaseVisitorpublic CSharpTarget(CodeGeneratorgen)
public StringgetVersion()
Target
public StringencodeIntAsCharEscape(int v)
Target
public StringgetTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator, String literal, boolean addQuotes)
Target
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 translation 'a\n"' → "a\n\"". Expect single quotes around the incoming literal. Just flip the quotes and replace double quotes with \".
Note that we have decided to allow people to use '\"' without penalty, so we must build the target string in a loop as String cannot handle both \" and " without a lot of messing around.
protected boolean visibleGrammarSymbolCausesIssueInGeneratedCode(GrammarASTidNode)
protected STGroup loadTemplates()