Method Summary |
|
protected void | _print(String s) Output a String to the currentOutput stream. |
protected void | _printAction(String s) Print an action without leading tabs, attempting to
preserve the current indentation level for multi-line actions
Ignored if string is null. |
protected void | _println(String s) Output a String followed by newline, to the currentOutput stream. |
public static String | decodeLexerRuleName(String id) |
public static boolean | elementsAreRange(int[] elems) Test if a set element array represents a contiguous range.
Parameters: elems - The array of elements representing the set, usually from BitSet.toArray(). |
public static String | encodeLexerRuleName(String id) |
protected String | extractIdOfAction(Token t) Get the identifier portion of an argument-action token. |
protected String | extractIdOfAction(String s, int line, int column) Get the identifier portion of an argument-action.
The ID of an action is assumed to be a trailing identifier.
Specific code-generators may want to override this
if the language has unusual declaration syntax.
Parameters: s - The action text Parameters: line - Line used for error reporting. Parameters: column - Line used for error reporting. |
protected String | extractTypeOfAction(Token t) Get the type string out of an argument-action token. |
protected String | extractTypeOfAction(String s, int line, int column) Get the type portion of an argument-action.
The type of an action is assumed to precede a trailing identifier
Specific code-generators may want to override this
if the language has unusual declaration syntax.
Parameters: s - The action text Parameters: line - Line used for error reporting. |
abstract public void | gen() |
abstract public void | gen(ActionElement action) Generate code for the given grammar element. |
abstract public void | gen(AlternativeBlock blk) Generate code for the given grammar element. |
abstract public void | gen(BlockEndElement end) Generate code for the given grammar element.
Parameters: end - The block-end element to generate. |
abstract public void | gen(CharLiteralElement atom) Generate code for the given grammar element. |
abstract public void | gen(CharRangeElement r) Generate code for the given grammar element. |
abstract public void | gen(LexerGrammar g) |
abstract public void | gen(OneOrMoreBlock blk) Generate code for the given grammar element. |
abstract public void | gen(ParserGrammar g) |
abstract public void | gen(RuleRefElement rr) Generate code for the given grammar element. |
abstract public void | gen(StringLiteralElement atom) Generate code for the given grammar element. |
abstract public void | gen(TokenRangeElement r) Generate code for the given grammar element. |
abstract public void | gen(TokenRefElement atom) Generate code for the given grammar element. |
abstract public void | gen(TreeElement t) Generate code for the given grammar element. |
abstract public void | gen(TreeWalkerGrammar g) |
abstract public void | gen(WildcardElement wc) Generate code for the given grammar element. |
abstract public void | gen(ZeroOrMoreBlock blk) Generate code for the given grammar element. |
protected void | genTokenInterchange(TokenManager tm) |
abstract public String | getASTCreateString(Vector v) Get a string for an expression to generate creation of an AST subtree. |
abstract public String | getASTCreateString(GrammarAtom atom, String str) |
protected String | getBitsetName(int index) Given the index of a bitset in the bitset list, generate a unique name. |
public String | getFIRSTBitSet(String ruleName, int k) |
public String | getFOLLOWBitSet(String ruleName, int k) |
abstract public String | mapTreeId(String id, ActionTransInfo tInfo) Map an identifier to it's corresponding tree-node variable.
This is context-sensitive, depending on the rule and alternative
being generated
Parameters: id - The identifier name to map Parameters: forInput - true if the input tree node variable is to be returned, otherwise the output variable is returned. |
protected int | markBitsetForGen(BitSet p) Add a bitset to the list of bitsets to be generated. |
protected void | print(String s) Output tab indent followed by a String, to the currentOutput stream. |
protected void | printAction(String s) Print an action with leading tabs, attempting to
preserve the current indentation level for multi-line actions
Ignored if string is null. |
protected void | printTabs() Output the current tab indentation. |
protected void | println(String s) Output tab indent followed by a String followed by newline,
to the currentOutput stream. |
abstract protected String | processActionForSpecialSymbols(String actionStr, int line, RuleBlock currentRule, ActionTransInfo tInfo) Lexically process $ and # references within the action. |
public String | processStringForASTConstructor(String str) Process a string for an simple expression for use in xx/action.g
it is used to cast simple tokens/references to the right type for
the generated language. |
protected String | removeAssignmentFromDeclaration(String d) Remove the assignment portion of a declaration, if any. |
public static String | reverseLexerRuleName(String id) |
public void | setAnalyzer(LLkGrammarAnalyzer analyzer_) |
public void | setBehavior(DefineGrammarSymbols behavior_) |
protected void | setGrammar(Grammar g) |
public void | setTool(Tool tool) |