类 RubyTarget
- java.lang.Object
-
- org.antlr.codegen.Target
-
- org.antlr.codegen.RubyTarget
-
public class RubyTarget extends Target
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 class
RubyTarget.RubyRenderer
-
字段概要
字段 修饰符和类型 字段 说明 static java.util.Set<java.lang.String>
rubyKeywords
A set of ruby keywords which are used to escape labels and method names which will cause parse errors in the ruby sourcestatic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>
sharedActionBlocks
-
从类继承的字段 org.antlr.codegen.Target
targetCharValueEscape
-
-
构造器概要
构造器 构造器 说明 RubyTarget()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.lang.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.java.lang.String
getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, java.lang.String literal)
Convert from an ANTLR char literal found in a grammar file to an equivalent char literal in the target language.java.lang.String
getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)
Target must be able to override the labels used for token typesboolean
isValidActionScope(int grammarType, java.lang.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.
-
-
-
字段详细资料
-
rubyKeywords
public static final java.util.Set<java.lang.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
-
sharedActionBlocks
public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> sharedActionBlocks
-
-
方法详细资料
-
genRecognizerFile
protected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, org.stringtemplate.v4.ST outputFileST) throws java.io.IOException
- 覆盖:
genRecognizerFile
在类中Target
- 抛出:
java.io.IOException
-
getTargetCharLiteralFromANTLRCharLiteral
public java.lang.String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, java.lang.String literal)
从类复制的说明:Target
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.
-
getMaxCharValue
public int getMaxCharValue(CodeGenerator generator)
从类复制的说明:Target
Some targets only support ASCII or 8-bit chars/strings. For example, C++ will probably want to return 0xFF here.- 覆盖:
getMaxCharValue
在类中Target
-
getTokenTypeAsTargetLabel
public java.lang.String getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)
从类复制的说明:Target
Target must be able to override the labels used for token types- 覆盖:
getTokenTypeAsTargetLabel
在类中Target
-
isValidActionScope
public boolean isValidActionScope(int grammarType, java.lang.String scope)
从类复制的说明:Target
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. The action names themselves are not policed at the moment so targets can add template actions w/o having to recompile ANTLR.- 覆盖:
isValidActionScope
在类中Target
-
encodeIntAsCharEscape
public java.lang.String encodeIntAsCharEscape(int v)
- 覆盖:
encodeIntAsCharEscape
在类中Target
-
-