Class 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
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


public Action()
Method Detail


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

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