org.millscript.millscript.action
Class BinaryOpAction

java.lang.Object
  extended by org.millscript.millscript.action.Action
      extended by org.millscript.millscript.action.BinaryOpAction
All Implemented Interfaces:
org.millscript.commons.alert.AlertOrigin
Direct Known Subclasses:
AddAction, AppendAction, DivAction, FnCompAction, ModAction, MulAction, SubAction

public abstract class BinaryOpAction
extends Action

This class is the base of all binary actions, i.e. those that operate on two values.


Constructor Summary
protected BinaryOpAction(Action a, Action b)
          Constructs a new binary action, with the specified left and right hand side actions.
 
Method Summary
 void action(Machine mc)
          Performs this action, on the specified machine.
abstract  java.lang.Object perform(java.lang.Object x, java.lang.Object y)
          Performs this binary action on the specified left and right hand side values.
 
Methods inherited from class org.millscript.millscript.action.Action
act, act1, getLineNumber, getOrigin, predAct, setContext, setLineNumber, setOrigin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryOpAction

protected BinaryOpAction(Action a,
                         Action b)
Constructs a new binary action, with the specified left and right hand side actions.

Parameters:
a - the left hand side action
b - the right hand side action
Method Detail

perform

public abstract java.lang.Object perform(java.lang.Object x,
                                         java.lang.Object y)
Performs this binary action on the specified left and right hand side values.

Parameters:
x - the left hand side value
y - the right hand side value
Returns:
the result of this binary action on the left and right hand side values

action

public final void action(Machine mc)
Description copied from class: Action
Performs this action, on the specified machine. This method must be implemented in sub-classes to perform the required actions.

Specified by:
action in class Action
Parameters:
mc - the machine to perform this action on
See Also:
Action.action(org.millscript.millscript.vm.Machine)


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.