Class Action

java.lang.Object
  |
  +--Action
Direct Known Subclasses:
Reduce, Shift

public abstract class Action
extends java.lang.Object

This abstract class specifies a method for processing the three kinds of parsing action in the program from Figure 4.30 of the Dragon book. Subclass this class to implement shift, reduce, and accept actions. Each subclass will use some of the parameters and not others, and only shift actions will return a meaningful value.


Constructor Summary
Action()
           
 
Method Summary
abstract  int process(LRTable T, LRStack stack, java.lang.String a, int ip)
          Abstract processing method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action()
Method Detail

process

public abstract int process(LRTable T,
                            LRStack stack,
                            java.lang.String a,
                            int ip)
Abstract processing method.

Parameters:
T - LR parsing table
stack - the stack
a - the current input symbol
ip - the current input-symbol pointer
Returns:
the next value of ip