se.chalmers.cs.gf.parse.chart
Class TerminalRule
java.lang.Object
se.chalmers.cs.gf.parse.chart.Rule
se.chalmers.cs.gf.parse.chart.TerminalRule
- Direct Known Subclasses:
- IntLiteralRule, StringLiteralRule
public class TerminalRule
- extends Rule
Methods inherited from class se.chalmers.cs.gf.parse.chart.Rule |
getCategory |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
TerminalRule
public TerminalRule(Category cat,
Terminal terminal)
getFun
public java.lang.String getFun()
- Description copied from class:
Rule
- Get the function name use to construct an abstract syntax
tree from this rule.
- Specified by:
getFun
in class Rule
getTerminal
public Terminal getTerminal()
getSize
public int getSize()
- Description copied from class:
Rule
- Get the number of terminals or non-terminal on the RHS.
- Specified by:
getSize
in class Rule
isTerminal
public boolean isTerminal()
makeTree
public Tree makeTree(Token token,
int startIndex,
int endIndex)
- Build an abstract syntax tree from this rule. Since this is a
terminal rule, we don't need to know about the children.
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
equals
public boolean equals(TerminalRule r)
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object