pascalinterpreter
Class BinaryOperation
java.lang.Object
pascalinterpreter.Command
pascalinterpreter.Operation
pascalinterpreter.BinaryOperation
- public class BinaryOperation
- extends Operation
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
operator
private BinaryOperator operator
secondOperand
private Variable secondOperand
BinaryOperation
public BinaryOperation(Variable operandL,
BinaryOperator operator,
Variable operandR)
throws InternalException,
AnalyseException
- See Also:
Object.Object()
getSecondOperand
protected Variable getSecondOperand()
- Returns:
getOperator
protected BinaryOperator getOperator()
- Returns:
execute
public void execute()
throws RuntimeException,
InternalException
- Description copied from class:
Command
- Metoda rozpoczyna wykonywanie komendy.
- Specified by:
execute
in class Command
- Throws:
RuntimeException
- - wyjątek generowany
InternalException
checkOperator
private void checkOperator(Variable operandL,
BinaryOperator operator,
Variable operandR)
throws AnalyseException
- Metoda sprawdza, czy operator będzie mógł pracować z tego typu zmiennymi.
- Parameters:
operandL
- - operand lewy.operator
- - operator.operandR
- - operand prawy.
- Throws:
AnalyseException
- Wyjątek generowany, jeżeli operator nie może pracować ze zmiennymi tych typów.