fr.umlv.tatoo.runtime.parser
Class ShiftAction<T,P,V>

java.lang.Object
  extended by fr.umlv.tatoo.runtime.parser.Action<T,P,V>
      extended by fr.umlv.tatoo.runtime.parser.ShiftAction<T,P,V>
Type Parameters:
T - type of terminals.
P - type of productions.
V - type of versions.

public class ShiftAction<T,P,V>
extends Action<T,P,V>

Shift action class.

Author:
Julien Cervelle

Constructor Summary
ShiftAction(int shift)
          Constructs a shift action.
 
Method Summary
<N> ActionReturn
doPerform(Parser<T,N,P,V> parser, T terminal)
          Performs necessary computations required by the action.
 boolean isShift(V version)
          Indicates if the action is a shift.
 String toString()
           
 
Methods inherited from class fr.umlv.tatoo.runtime.parser.Action
isError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShiftAction

public ShiftAction(int shift)
Constructs a shift action.

Parameters:
shift - state reached by this shift action.
Method Detail

doPerform

public <N> ActionReturn doPerform(Parser<T,N,P,V> parser,
                                  T terminal)
Description copied from class: Action
Performs necessary computations required by the action.

Specified by:
doPerform in class Action<T,P,V>
Type Parameters:
N - type of non-terminals.
Parameters:
parser - the parser object.
terminal - terminal on which the shift is performed.
Returns:
NEXT if action consumed terminal, and KEEP else.

isShift

public boolean isShift(V version)
Description copied from class: Action
Indicates if the action is a shift.

Overrides:
isShift in class Action<T,P,V>
Parameters:
version - version of the action to consider, see VersionedAction.
Returns:
true if the action is an shift.

toString

public String toString()
Overrides:
toString in class Object