Package org.antlr.v4.codegen.target
Class SwiftTarget
- java.lang.Object
-
- org.antlr.v4.codegen.Target
-
- org.antlr.v4.codegen.target.SwiftTarget
-
public class SwiftTarget extends Target
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.HashSet<java.lang.String>
reservedWords
protected static java.util.Map<java.lang.Character,java.lang.String>
targetCharValueEscape
-
Fields inherited from class org.antlr.v4.codegen.Target
defaultCharValueEscape, gen
-
-
Constructor Summary
Constructors Constructor Description SwiftTarget(CodeGenerator gen)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
escapeChar(int v)
protected java.lang.String
escapeWord(java.lang.String word)
protected java.util.Set<java.lang.String>
getReservedWords()
java.util.Map<java.lang.Character,java.lang.String>
getTargetCharValueEscape()
For pure strings of Unicode char, how can we display it in the target language as a literal.-
Methods inherited from class org.antlr.v4.codegen.Target
addEscapedChar, addEscapedChar, appendUnicodeEscapedCodePoint, encodeInt16AsCharEscape, escapeIfNeeded, genFile, getAltLabelContextStructName, getBaseListenerFileName, getBaseVisitorFileName, getCodeGenerator, getElementListName, getElementName, getImplicitRuleLabel, getImplicitSetLabel, getImplicitTokenLabel, getInlineTestSetWordSize, getLanguage, getListenerFileName, getListLabel, getLoopCounter, getLoopLabel, getRecognizerFileName, getRuleFunctionContextStructName, getRuleFunctionContextStructName, getSerializedATNSegmentLimit, getTargetStringLiteralFromANTLRStringLiteral, getTargetStringLiteralFromANTLRStringLiteral, getTargetStringLiteralFromString, getTargetStringLiteralFromString, getTemplates, getTokenTypeAsTargetLabel, getTokenTypesAsTargetLabels, getVersion, getVisitorFileName, grammarSymbolCausesIssueInGeneratedCode, isATNSerializedAsInts, loadTemplates, needsHeader, shouldUseUnicodeEscapeForCodePointInDoubleQuotedString, supportsOverloadedMethods, templatesExist, visibleGrammarSymbolCausesIssueInGeneratedCode, wantsBaseListener, wantsBaseVisitor
-
-
-
-
Constructor Detail
-
SwiftTarget
public SwiftTarget(CodeGenerator gen)
-
-
Method Detail
-
getTargetCharValueEscape
public java.util.Map<java.lang.Character,java.lang.String> getTargetCharValueEscape()
Description copied from class:Target
For pure strings of Unicode char, how can we display it in the target language as a literal. Useful for dumping predicates and such that may refer to chars that need to be escaped when represented as strings. Also, templates need to be escaped so that the target language can hold them as a string. Each target can have a different set in memory at same time.- Overrides:
getTargetCharValueEscape
in classTarget
-
getReservedWords
protected java.util.Set<java.lang.String> getReservedWords()
- Specified by:
getReservedWords
in classTarget
-
escapeWord
protected java.lang.String escapeWord(java.lang.String word)
- Overrides:
escapeWord
in classTarget
-
escapeChar
protected java.lang.String escapeChar(int v)
- Overrides:
escapeChar
in classTarget
-
-