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

java.lang.Object
  extended by fr.umlv.tatoo.runtime.parser.Action<T,P,V>
Type Parameters:
T - type of terminals.
P - type of productions.
V - type of versions.
Direct Known Subclasses:
AcceptAction, BranchAction, EnterAction, ErrorAction, ExitAction, ReduceAction, ShiftAction, VersionedAction

public abstract class Action<T,P,V>
extends Object

Parser actions (shift/reduce/accept/error) super-class.

Author:
Julien Cervelle
See Also:
ShiftAction, ReduceAction, AcceptAction, ErrorAction, EnterAction, ExitAction

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

Constructor Detail

Action

public Action()
Method Detail

doPerform

public abstract <N> ActionReturn doPerform(Parser<T,N,P,V> parser,
                                           T terminal)
Performs necessary computations required by the action.

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.

isError

public boolean isError(V version)
Indicates if the action is an error.

Parameters:
version - version of the action to consider, see VersionedAction.
Returns:
true if the action is an errror.

isShift

public boolean isShift(V version)
Indicates if the action is a shift.

Parameters:
version - version of the action to consider, see VersionedAction.
Returns:
true if the action is an shift.