| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, ST headerFileST, String extName)
|
| public String | getTargetCharLiteralFromANTLRCharLiteral(CodeGenerator generator, String literal)
Overrides org. |
| public String | getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator, String literal)
Overrides org. |
| public String | getTokenTextAndTypeAsTargetLabel(CodeGenerator generator, String text, int tokenType)
Target must be able to override the labels used for token types. |
| public String | getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype)
Overrides org. |
| ObjCTarget | back to summary |
|---|---|
| public ObjCTarget() | |
| genRecognizerHeaderFile | back to summary |
|---|---|
| protected void genRecognizerHeaderFile(Tool tool, CodeGenerator generator, Grammar grammar, ST headerFileST, String extName) throws IOException Overrides org.
| |
| 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.
| |
| getTargetStringLiteralFromANTLRStringLiteral | back to summary |
|---|---|
| public String getTargetStringLiteralFromANTLRStringLiteral(CodeGenerator generator, String literal) Overrides org. Convert from an ANTLR string literal found in a grammar file to an equivalent string literal in the target language. For Java, this is the translation 'a\n"' → "a\n\"". Expect single quotes around the incoming literal. Just flip the quotes and replace double quotes with \"
| |
| getTokenTextAndTypeAsTargetLabel | back to summary |
|---|---|
| public String getTokenTextAndTypeAsTargetLabel(CodeGenerator generator, String text, int tokenType) Target must be able to override the labels used for token types. Sometimes also depends on the token text. | |
| getTokenTypeAsTargetLabel | back to summary |
|---|---|
| public String getTokenTypeAsTargetLabel(CodeGenerator generator, int ttype) Overrides org. If we have a label, prefix it with the recognizer's name
| |