Top Fields Constructors Methods
org.antlr.codegen

public Class DelphiTarget

extends Target
Class Inheritance
Imports
org.antlr.Tool, org.antlr.analysis.Label, org.antlr.misc.Utils, org.stringtemplate.v4.ST, org.antlr.tool.Grammar

Field Summary

Inherited from org.antlr.codegen.Target:
targetCharValueEscape

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ST
chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST)

public String
public String
getTarget64BitStringFromValue(long word)

Overrides org.antlr.codegen.Target.getTarget64BitStringFromValue.

Convert long to 0xNNNNNNNNNNNNNNNN by default for spitting out with bitsets.
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
getTargetStringLiteralFromString(String s, boolean quoted)

Overrides org.antlr.codegen.Target.getTargetStringLiteralFromString.

Given a random string of Java unicode chars, return a new string with optionally appropriate quote characters for target language and possibly with some escaped characters.
Inherited from org.antlr.codegen.Target:
genRecognizerFilegenRecognizerHeaderFilegetMaxCharValuegetTargetStringLiteralFromStringgetTokenTypeAsTargetLabelisValidActionScopeperformGrammarAnalysispostProcessActionuseBaseTemplatesForSynPredFragments

Constructor Detail

DelphiTargetback to summary
public DelphiTarget()

Method Detail

chooseWhereCyclicDFAsGoback to summary
protected ST chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, ST recognizerST, ST cyclicDFAST)
encodeIntAsCharEscapeback to summary
public String encodeIntAsCharEscape(int v)

Overrides org.antlr.codegen.Target.encodeIntAsCharEscape.

Annotations
@Override
getTarget64BitStringFromValueback to summary
public String getTarget64BitStringFromValue(long word)

Overrides org.antlr.codegen.Target.getTarget64BitStringFromValue.

Doc from org.antlr.codegen.Target.getTarget64BitStringFromValue.

Convert long to 0xNNNNNNNNNNNNNNNN by default for spitting out with bitsets. I.e., convert bytes to hex string.

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.

Doc from 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 \" Note that we have decided to allow poeple to use '\"' without penalty, so we must build the target string in a loop as Utils.replae cannot handle both \" and " without a lot of messing around.

Annotations
@Override
getTargetStringLiteralFromStringback to summary
public String getTargetStringLiteralFromString(String s, boolean quoted)

Overrides org.antlr.codegen.Target.getTargetStringLiteralFromString.

Doc from org.antlr.codegen.Target.getTargetStringLiteralFromString.

Given a random string of Java unicode chars, return a new string with optionally appropriate quote characters for target language and possibly with some escaped characters. For example, if the incoming string has actual newline characters, the output of this method would convert them to the two char sequence \n for Java, C, C++, ... The new string has double-quotes around it as well. Example String in memory: a"[newlinechar]b'c[carriagereturnchar]d[tab]e\f would be converted to the valid Java s: "a\"\nb'c\rd\te\\f" or a\"\nb'c\rd\te\\f depending on the quoted arg.

Annotations
@Override