Top Fields Constructors Methods
org.antlr.codegen

public Class ObjCTarget

extends Target
Class Inheritance
Imports
org.antlr.Tool, org.antlr.misc.Utils, org.stringtemplate.v4.ST, org.antlr.tool.Grammar, java.io.IOException

Field Summary

Inherited from org.antlr.codegen.Target:
targetCharValueEscape

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public String
getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)

Overrides org.antlr.codegen.Target.getTargetCharLiteralFromANTLRCharLiteral.

Convert from an ANTLR char literal found in a grammar file to an equivalent char literal in the target language.
public String
getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator, String literal)

Overrides org.antlr.codegen.Target.getTargetStringLiteralFromANTLRStringLiteral.

Convert from an ANTLR string literal found in a grammar file to an equivalent string literal in the target language.
public String
getTokenTextAndTypeAsTargetLabel(CodeGenerator generator, String text, int tokenType)

Target must be able to override the labels used for token types.

public String
getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)

Overrides org.antlr.codegen.Target.getTokenTypeAsTargetLabel.

If we have a label, prefix it with the recognizer's name
Inherited from org.antlr.codegen.Target:
encodeIntAsCharEscapegenRecognizerFilegetMaxCharValuegetTarget64BitStringFromValuegetTargetStringLiteralFromStringgetTargetStringLiteralFromStringisValidActionScopeperformGrammarAnalysispostProcessActionuseBaseTemplatesForSynPredFragments

Constructor Detail

ObjCTargetback to summary
public ObjCTarget()

Method Detail

genRecognizerHeaderFileback to summary
protected void genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, ST headerFileST, String extName) throws IOException

Overrides org.antlr.codegen.Target.genRecognizerHeaderFile.

Annotations
@Override
getTargetCharLiteralFromANTLRCharLiteralback to summary
public String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)

Overrides org.antlr.codegen.Target.getTargetCharLiteralFromANTLRCharLiteral.

Doc from org.antlr.codegen.Target.getTargetCharLiteralFromANTLRCharLiteral.

Convert from an ANTLR char literal found in a grammar file to an equivalent char literal in the target language. For most languages, this means leaving 'x' as 'x'. Actually, we need to escape ' ' so that it doesn't get converted to \n by the compiler. Convert the literal to the char value and then to an appropriate target char literal. Expect single quotes around the incoming literal.

Annotations
@Override
getTargetStringLiteralFromANTLRStringLiteralback to summary
public String getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator, String literal)

Overrides org.antlr.codegen.Target.getTargetStringLiteralFromANTLRStringLiteral.

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 \"

Annotations
@Override
getTokenTextAndTypeAsTargetLabelback to summary
public String getTokenTextAndTypeAsTargetLabel(CodeGenerator generator, String text, int tokenType)

Target must be able to override the labels used for token types. Sometimes also depends on the token text.

getTokenTypeAsTargetLabelback to summary
public String getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)

Overrides org.antlr.codegen.Target.getTokenTypeAsTargetLabel.

If we have a label, prefix it with the recognizer's name

Annotations
@Override