Package org.antlr.codegen
Class RubyTarget
- java.lang.Object
-
- org.antlr.codegen.Target
-
- org.antlr.codegen.RubyTarget
-
public class RubyTarget extends Target
-
-
Field Summary
-
Fields inherited from class org.antlr.codegen.Target
targetCharValueEscape
-
-
Constructor Summary
Constructors Constructor Description RubyTarget()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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-
Methods inherited from class org.antlr.codegen.Target
encodeIntAsCharEscape, genRecognizerFile, genRecognizerHeaderFile, getTarget64BitStringFromValue, getTargetStringLiteralFromANTLRStringLiteral, getTargetStringLiteralFromString, getTargetStringLiteralFromString, isValidActionScope, performGrammarAnalysis, postProcessAction
-
-
-
-
Method Detail
-
getTargetCharLiteralFromANTLRCharLiteral
public String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)
Description copied from class: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.- Overrides:
getTargetCharLiteralFromANTLRCharLiteral
in classTarget
-
getMaxCharValue
public int getMaxCharValue(CodeGenerator generator)
Description copied from class:Target
Some targets only support ASCII or 8-bit chars/strings. For example, C++ will probably want to return 0xFF here.- Overrides:
getMaxCharValue
in classTarget
-
getTokenTypeAsTargetLabel
public String getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)
Description copied from class:Target
Target must be able to override the labels used for token types- Overrides:
getTokenTypeAsTargetLabel
in classTarget
-
-