pascalinterpreter.controlstatements
Class For
java.lang.Object
pascalinterpreter.Command
pascalinterpreter.ControlStatement
pascalinterpreter.controlstatements.For
- public class For
- extends ControlStatement
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
initOperation
private BinaryOperation initOperation
incrementOperation
private BinaryOperation incrementOperation
assignRegistryOperation
private UnaryOperation assignRegistryOperation
For
public For(Variable counter,
Variable initValue,
Variable maxValue,
Block block)
throws AnalyseException,
InternalException
- Konstruktor pętli For.
- Parameters:
counter
- - zmienna sterująca pętli.initValue
- - wartość początkowa.maxValue
- - wartość końcowa.
- Throws:
AnalyseException
- - Wyjątek generowany w przypadku podania jako parametr pętli typu różnego od Int.
InternalException
checkParametrs
private void checkParametrs(Variable counter,
Variable initValue,
Variable maxValue)
throws AnalyseException
- Metoda sprawdza poprawność typów dla parametrów pętli for.
- Throws:
AnalyseException
- See Also:
pascalinterpreter.controlstatements.For#For()
createInitOperation
private BinaryOperation createInitOperation(Variable counter,
Variable initValue)
throws InternalException
- Throws:
InternalException
createControlCondition
private BinaryOperation createControlCondition(Variable counter,
Variable maxValue)
throws InternalException
- Throws:
InternalException
createIncrementOperation
private BinaryOperation createIncrementOperation(Variable counter)
throws InternalException
- Throws:
InternalException
createAssignRegistryOperation
private UnaryOperation createAssignRegistryOperation(Variable counter)
throws InternalException
- Throws:
InternalException
getInitOperation
protected BinaryOperation getInitOperation()
- Returns:
setInitOperation
protected void setInitOperation(BinaryOperation operation)
throws AnalyseException
- Parameters:
operation
-
- Throws:
AnalyseException
getIncrementOperation
protected BinaryOperation getIncrementOperation()
- Returns:
setIncrementOperation
protected void setIncrementOperation(BinaryOperation operation)
throws AnalyseException
- Parameters:
operation
-
- Throws:
AnalyseException
getAssignRegistryOperation
protected UnaryOperation getAssignRegistryOperation()
- Returns:
setAssignRegistryOperation
protected void setAssignRegistryOperation(UnaryOperation operation)
throws AnalyseException
- Parameters:
operation
-
- Throws:
AnalyseException
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