public class CTarget extends Target
targetCharValueEscape| Constructor and Description |
|---|
CTarget() |
| Modifier and Type | Method and Description |
|---|---|
protected org.stringtemplate.v4.ST |
chooseWhereCyclicDFAsGo(Tool tool,
CodeGenerator generator,
Grammar grammar,
org.stringtemplate.v4.ST recognizerST,
org.stringtemplate.v4.ST cyclicDFAST) |
protected void |
genRecognizerFile(Tool tool,
CodeGenerator generator,
Grammar grammar,
org.stringtemplate.v4.ST outputFileST) |
protected void |
genRecognizerHeaderFile(Tool tool,
CodeGenerator generator,
Grammar grammar,
org.stringtemplate.v4.ST headerFileST,
String extName) |
String |
getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator,
String literal)
Convert from an ANTLR char literal found in a grammar file to
an equivalent char literal in the target language.
|
String |
getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator,
String literal)
Convert from an ANTLR string literal found in a grammar file to
an equivalent string literal in the C target.
|
boolean |
isValidActionScope(int grammarType,
String scope)
Is scope in @scope::name {action} valid for this kind of grammar?
Targets like C++ may want to allow new scopes like headerfile or
some such.
|
protected void |
performGrammarAnalysis(CodeGenerator generator,
Grammar grammar)
Overrides the standard grammar analysis so we can prepare the analyser
a little differently from the other targets.
|
encodeIntAsCharEscape, getMaxCharValue, getTarget64BitStringFromValue, getTargetStringLiteralFromString, getTargetStringLiteralFromString, getTokenTypeAsTargetLabel, postProcessAction, useBaseTemplatesForSynPredFragmentsprotected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, org.stringtemplate.v4.ST outputFileST) throws IOException
genRecognizerFile in class TargetIOExceptionprotected void genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, org.stringtemplate.v4.ST headerFileST, String extName) throws IOException
genRecognizerHeaderFile in class TargetIOExceptionprotected org.stringtemplate.v4.ST chooseWhereCyclicDFAsGo(Tool tool, CodeGenerator generator, Grammar grammar, org.stringtemplate.v4.ST recognizerST, org.stringtemplate.v4.ST cyclicDFAST)
public boolean isValidActionScope(int grammarType,
String scope)
isValidActionScope in class Targetpublic String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)
TargetgetTargetCharLiteralFromANTLRCharLiteral in class Targetpublic String getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator, String literal)
getTargetStringLiteralFromANTLRStringLiteral in class Targetprotected void performGrammarAnalysis(CodeGenerator generator, Grammar grammar)
performGrammarAnalysis in class Targetgenerator - An instance of the generic code generator class.grammar - The grammar that we are currently analyzingCopyright © 1992–2014 ANTLR. All rights reserved.