se.chalmers.cs.gf.parse.chart
Class TerminalRule

java.lang.Object
  extended by se.chalmers.cs.gf.parse.chart.Rule
      extended by se.chalmers.cs.gf.parse.chart.TerminalRule
Direct Known Subclasses:
IntLiteralRule, StringLiteralRule

public class TerminalRule
extends Rule


Constructor Summary
TerminalRule(Category cat, Terminal terminal)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean equals(TerminalRule r)
           
 java.lang.String getFun()
          Get the function name use to construct an abstract syntax tree from this rule.
 int getSize()
          Get the number of terminals or non-terminal on the RHS.
 Terminal getTerminal()
           
 int hashCode()
           
 boolean isTerminal()
           
 Tree makeTree(Token token, int startIndex, int endIndex)
          Build an abstract syntax tree from this rule.
 java.lang.String toString()
           
 
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
 

Constructor Detail

TerminalRule

public TerminalRule(Category cat,
                    Terminal terminal)
Method Detail

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