| Modifier and Type | Field and Description |
|---|---|
| protected Map | blockOptions
If this is a BLOCK node, track options here |
| public ST | code
if this is a TOKEN_REF or RULE_REF node, this is the code ST generated for this node. |
| pack-priv static int | |
| private static final GrammarAST | |
| private static final GrammarAST | |
| public String | |
| public NFAState | followingNFAState
Rule ref nodes, token refs, set, and NOT set refs need to track their location in the generated NFA so that local FOLLOW sets can be computed during code gen for automatic error recovery. |
| public int | |
| public DFA | lookaheadDFA
If this is a decision node, what is the lookahead DFA? |
| public NFAState | NFAStartState
What NFA start state was built from this node? |
| public NFAState | NFATreeDownState
This is used for TREE_BEGIN nodes to point into the NFA. |
| public int | outerAltNum
if this is an ACTION node, this is the outermost enclosing alt num in rule. |
| public Set | |
| public Set | rewriteRefsShallow
If this is a BLOCK node for a rewrite rule, track referenced elements here. |
| protected IntSet | setValue
If this is a SET node, what are the elements? |
| public Map | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public static List | |
| public static List | |
| public static GrammarAST | |
| public Tree | dupNode()
Overrides org. Implements org. |
| public static GrammarAST | |
| public static GrammarAST | dupTreeNoActions(GrammarAST t, GrammarAST parent)
Duplicate a tree, assuming this is a root node of a tree-- duplicate that node and what's below; ignore siblings of root node. |
| public boolean | equals(Object
the reference object with which to compare. ast)Overrides java. |
| public List | |
| public GrammarAST | |
| public GrammarAST | |
| public Object | |
| public Map | |
| public int | |
| public GrammarAST[] | |
| private static List | |
| public GrammarAST | |
| public GrammarAST | |
| public int | getLine()
Overrides org. Implements org. |
| public DFA | |
| public GrammarAST | |
| public NFAState | |
| public IntSet | |
| public String | getText()
Overrides org. Implements org. |
| public int | getType()
Overrides org. Implements org. |
| public int | hashCode()
Overrides java. |
| public boolean | |
| public void | |
| public void | |
| public void | |
| public String | setBlockOption(Grammar grammar, String key, Object value)
Save the option key/value pair and process it; return the key or null if invalid option. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public String | |
| public void | |
| public void | |
| public String | |
| public void | |
| public void | setTokenBoundaries(Token startToken, Token stopToken)
Track start/stop token for subtree root created for a rule. |
| public void | |
| public void | |
| public String |
| blockOptions | back to summary |
|---|---|
| protected Map<String, Object> blockOptions If this is a BLOCK node, track options here | |
| code | back to summary |
|---|---|
| public ST code if this is a TOKEN_REF or RULE_REF node, this is the code ST generated for this node. We need to update it later to add a label if someone does $tokenref or $ruleref in an action. | |
| count | back to summary |
|---|---|
| pack-priv static int count | |
| DescendantDownNode | back to summary |
|---|---|
| private static final GrammarAST DescendantDownNode | |
| DescendantUpNode | back to summary |
|---|---|
| private static final GrammarAST DescendantUpNode | |
| enclosingRuleName | back to summary |
|---|---|
| public String enclosingRuleName | |
| followingNFAState | back to summary |
|---|---|
| public NFAState followingNFAState Rule ref nodes, token refs, set, and NOT set refs need to track their location in the generated NFA so that local FOLLOW sets can be computed during code gen for automatic error recovery. | |
| ID | back to summary |
|---|---|
| public int ID | |
| lookaheadDFA | back to summary |
|---|---|
| public DFA lookaheadDFA If this is a decision node, what is the lookahead DFA? | |
| NFAStartState | back to summary |
|---|---|
| public NFAState NFAStartState What NFA start state was built from this node? | |
| NFATreeDownState | back to summary |
|---|---|
| public NFAState NFATreeDownState This is used for TREE_BEGIN nodes to point into the NFA. TREE_BEGINs point at left edge of DOWN for LOOK computation purposes (Nullable tree child list needs special code gen when matching). | |
| outerAltNum | back to summary |
|---|---|
| public int outerAltNum if this is an ACTION node, this is the outermost enclosing alt num in rule. For actions, define.g sets these (used to be codegen.g). We need these set so we can examine actions early, before code gen, for refs to rule predefined properties and rule labels. For most part define.g sets outerAltNum, but codegen.g does the ones for %foo(a={$ID.text}) type refs as the {$ID...} is not seen as an action until code gen pulls apart. | |
| rewriteRefsDeep | back to summary |
|---|---|
| public Set<GrammarAST> rewriteRefsDeep | |
| rewriteRefsShallow | back to summary |
|---|---|
| public Set<GrammarAST> rewriteRefsShallow If this is a BLOCK node for a rewrite rule, track referenced elements here. Don't track elements in nested subrules. | |
| setValue | back to summary |
|---|---|
| protected IntSet setValue If this is a SET node, what are the elements? | |
| terminalOptions | back to summary |
|---|---|
| public Map<String, Object> terminalOptions | |
| textOverride | back to summary |
|---|---|
| private String textOverride | |
| GrammarAST | back to summary |
|---|---|
| public GrammarAST() | |
| GrammarAST | back to summary |
|---|---|
public GrammarAST(int t, String txt)
| |
| GrammarAST | back to summary |
|---|---|
public GrammarAST(Token token)
| |
| _findAllType | back to summary |
|---|---|
| public void _findAllType(int ttype, List<GrammarAST> nodes) | |
| descendants | back to summary |
|---|---|
| public static List | |
| descendants | back to summary |
|---|---|
| public static List | |
| dup | back to summary |
|---|---|
| public static GrammarAST dup(Tree t) | |
| dupNode | back to summary |
|---|---|
| public Tree dupNode() Overrides org. Implements org.
| |
| dupTree | back to summary |
|---|---|
| public static GrammarAST dupTree(GrammarAST t) | |
| dupTreeNoActions | back to summary |
|---|---|
| public static GrammarAST dupTreeNoActions(GrammarAST t, GrammarAST parent) Duplicate a tree, assuming this is a root node of a tree-- duplicate that node and what's below; ignore siblings of root node. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object ast) Overrides java. Make nodes unique based upon Token so we can add them to a Set; if not a GrammarAST, check type.
| |
| findAllType | back to summary |
|---|---|
| public List | |
| findFirstType | back to summary |
|---|---|
| public GrammarAST findFirstType(int ttype) | |
| getBlockALT | back to summary |
|---|---|
| public GrammarAST getBlockALT(int i) | |
| getBlockOption | back to summary |
|---|---|
| public Object getBlockOption(String key) | |
| getBlockOptions | back to summary |
|---|---|
| public Map | |
| getCharPositionInLine | back to summary |
|---|---|
| public int getCharPositionInLine() Overrides org. Implements org.
| |
| getChildrenAsArray | back to summary |
|---|---|
| public GrammarAST[] getChildrenAsArray() | |
| getChildrenForDupTree | back to summary |
|---|---|
| private static List | |
| getLastChild | back to summary |
|---|---|
| public GrammarAST getLastChild() | |
| getLastSibling | back to summary |
|---|---|
| public GrammarAST getLastSibling() | |
| getLine | back to summary |
|---|---|
| public int getLine() Overrides org. Implements org. Doc from org. In case we don't have a token payload, what is the line for errors?
| |
| getLookaheadDFA | back to summary |
|---|---|
| public DFA getLookaheadDFA() | |
| getNextSibling | back to summary |
|---|---|
| public GrammarAST getNextSibling() | |
| getNFAStartState | back to summary |
|---|---|
| public NFAState getNFAStartState() | |
| getSetValue | back to summary |
|---|---|
| public IntSet getSetValue() | |
| getText | back to summary |
|---|---|
| public String getText() Overrides org. Implements org.
| |
| getType | back to summary |
|---|---|
| public int getType() Overrides org. Implements org. Doc from org. Return a token type; needed for tree parsing
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Make nodes unique based upon Token so we can add them to a Set; if not a GrammarAST, check type.
| |
| hasSameTreeStructure | back to summary |
|---|---|
| public boolean hasSameTreeStructure(Tree other) See if tree has exact token types and structure; no text | |
| initialize | back to summary |
|---|---|
| public void initialize(int i, String s) | |
| initialize | back to summary |
|---|---|
| public void initialize(Tree ast) | |
| initialize | back to summary |
|---|---|
| public void initialize(Token token) | |
| setBlockOption | back to summary |
|---|---|
| public String setBlockOption(Grammar grammar, String key, Object value) Save the option key/value pair and process it; return the key or null if invalid option. | |
| setBlockOptions | back to summary |
|---|---|
| public void setBlockOptions(Map<String, Object> blockOptions) | |
| setCharPositionInLine | back to summary |
|---|---|
| public void setCharPositionInLine(int value) | |
| setLine | back to summary |
|---|---|
| public void setLine(int line) | |
| setLookaheadDFA | back to summary |
|---|---|
| public void setLookaheadDFA(DFA lookaheadDFA) | |
| setNFAStartState | back to summary |
|---|---|
| public void setNFAStartState(NFAState nfaStartState) | |
| setOption | back to summary |
|---|---|
| public String setOption(Map<String, Object> options, Set<String> legalOptions, Grammar grammar, String key, Object value) | |
| setOptions | back to summary |
|---|---|
| public void setOptions(Grammar grammar, Map<String, Object> options) | |
| setSetValue | back to summary |
|---|---|
| public void setSetValue(IntSet setValue) | |
| setTerminalOption | back to summary |
|---|---|
| public String setTerminalOption(Grammar grammar, String key, Object value) | |
| setText | back to summary |
|---|---|
| public void setText(String text) | |
| setTokenBoundaries | back to summary |
|---|---|
| public void setTokenBoundaries(Token startToken, Token stopToken) Track start/stop token for subtree root created for a rule. Only works with Tree nodes. For rules that match nothing, seems like this will yield start=i and stop=i-1 in a nil node. Might be useful info so I'll not force to be i..i. | |
| setTreeEnclosingRuleNameDeeply | back to summary |
|---|---|
| public void setTreeEnclosingRuleNameDeeply(String rname) | |
| setType | back to summary |
|---|---|
| public void setType(int type) | |
| toStringList | back to summary |
|---|---|
| public String toStringList() | |