| Modifier and Type | Class and Description |
|---|---|
| public class |
| Modifier and Type | Field and Description |
|---|---|
| public static final Set | rubyKeywords
A set of ruby keywords which are used to escape labels and method names which will cause parse errors in the ruby source |
| public static Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| protected void | genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST)
Overrides org. |
| public int | getMaxCharValue(CodeGenerator generator)
Overrides org. |
| public String | getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)
Overrides org. |
| public String | getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)
Overrides org. |
| public boolean | isValidActionScope(int grammarType, String scope)
Overrides org. |
| rubyKeywords | back to summary |
|---|---|
| public static final 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 | |
| sharedActionBlocks | back to summary |
|---|---|
| public static Map<String, Map<String, Object>> sharedActionBlocks | |
| RubyTarget | back to summary |
|---|---|
| public RubyTarget() | |
| encodeIntAsCharEscape | back to summary |
|---|---|
| public String encodeIntAsCharEscape(final int v) Overrides org.
| |
| genRecognizerFile | back to summary |
|---|---|
| protected void genRecognizerFile(Tool tool, CodeGenerator generator, Grammar grammar, ST outputFileST) throws IOException Overrides org.
| |
| getMaxCharValue | back to summary |
|---|---|
| public int getMaxCharValue(CodeGenerator generator) Overrides org. Doc from org. Some targets only support ASCII or 8-bit chars/strings. For example, C++ will probably want to return 0xFF here.
| |
| getTargetCharLiteralFromANTLRCharLiteral | back to summary |
|---|---|
| public String getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal) Overrides org. Doc from org. 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.
| |
| getTokenTypeAsTargetLabel | back to summary |
|---|---|
| public String getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype) Overrides org. Doc from org. Target must be able to override the labels used for token types
| |
| isValidActionScope | back to summary |
|---|---|
| public boolean isValidActionScope(int grammarType, String scope) Overrides org. Doc from org. 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| protected String[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| private String | |
| private String | |
| private String | |
| private String | |
| private String | |
| private String | |
| private String | |
| private String | |
| private String | |
| public String | toString(Object o, String formatName, Locale locale)
Implements org. |
| rubyCharValueEscape | back to summary |
|---|---|
| protected String[] rubyCharValueEscape | |
| RubyRenderer | back to summary |
|---|---|
| public RubyRenderer() | |
| camelcase | back to summary |
|---|---|
| private String camelcase(String value) | |
| constantcase | back to summary |
|---|---|
| private String constantcase(String value) | |
| constantPath | back to summary |
|---|---|
| private String constantPath(String value) | |
| label | back to summary |
|---|---|
| private String label(String value) | |
| lexerRule | back to summary |
|---|---|
| private String lexerRule(String value) | |
| platform | back to summary |
|---|---|
| private String platform(String value) | |
| rubyString | back to summary |
|---|---|
| private String rubyString(String value) | |
| snakecase | back to summary |
|---|---|
| private String snakecase(String value) given an input string, which is presumed to contain a word, which may potentially be camelcased, and convert it to snake_case underscore style. algorithm -- iterate through the string with a sliding window 3 chars wide example -- aGUIWhatNot c c+1 c+2 action a G << 'a' << '_' // a lower-upper word edge G U I << 'g' U I W << 'w' I W h << 'i' << '_' // the last character in an acronym run of uppers W h << 'w' ... and so on | |
| subcamelcase | back to summary |
|---|---|
| private String subcamelcase(String value) | |
| symbol | back to summary |
|---|---|
| private String symbol(String value) | |
| toString | back to summary |
|---|---|
| public String toString(Object o, String formatName, Locale locale) Implements org.
| |