public class RubyTarget extends Target
Modifier and Type | Class and Description |
---|---|
class |
RubyTarget.RubyRenderer |
Modifier and Type | Field and Description |
---|---|
static Set<String> |
rubyKeywords
A set of ruby keywords which are used to escape labels and method names
which will cause parse errors in the ruby source
|
static Map<String,Map<String,Object>> |
sharedActionBlocks |
targetCharValueEscape
Constructor and Description |
---|
RubyTarget() |
Modifier and Type | Method and Description |
---|---|
String |
encodeIntAsCharEscape(int v) |
protected void |
genRecognizerFile(Tool tool,
CodeGenerator generator,
Grammar grammar,
org.stringtemplate.v4.ST outputFileST) |
int |
getMaxCharValue(CodeGenerator generator)
Some targets only support ASCII or 8-bit chars/strings.
|
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 |
getTokenTypeAsTargetLabel(CodeGenerator generator,
int ttype)
Target must be able to override the labels used for token types
|
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.
|
genRecognizerHeaderFile, getTarget64BitStringFromValue, getTargetStringLiteralFromANTLRStringLiteral, getTargetStringLiteralFromString, getTargetStringLiteralFromString, performGrammarAnalysis, postProcessAction, useBaseTemplatesForSynPredFragments
public static final Set<String> rubyKeywords
protected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, org.stringtemplate.v4.ST outputFileST) throws IOException
genRecognizerFile
in class Target
IOException
public String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)
Target
getTargetCharLiteralFromANTLRCharLiteral
in class Target
public int getMaxCharValue(CodeGenerator generator)
Target
getMaxCharValue
in class Target
public String getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)
Target
getTokenTypeAsTargetLabel
in class Target
public boolean isValidActionScope(int grammarType, String scope)
Target
isValidActionScope
in class Target
public String encodeIntAsCharEscape(int v)
encodeIntAsCharEscape
in class Target
Copyright © 1992–2015 ANTLR. All rights reserved.