slogo.instruction.conditional
Class ConditionalInstruction
java.lang.Object
slogo.language.GrammarElement
slogo.instruction.Instruction
slogo.instruction.conditional.ConditionalInstruction
- Direct Known Subclasses:
- Equal, Greater, Less, NotEqual
public abstract class ConditionalInstruction
- extends Instruction
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
e1
protected GrammarElement e1
e2
protected GrammarElement e2
ConditionalInstruction
public ConditionalInstruction(GrammarElement e1,
GrammarElement e2)
firstValue
public int firstValue(Context c)
- Returns:
- the result of evaluating the first subexpression
secondValue
public int secondValue(Context c)
- Returns:
- the result of evaluating the second subexpression
evaluate
public abstract java.lang.Integer evaluate(Context c)
- Description copied from class:
GrammarElement
- Evaluate this language construct in some context. The evaluation may have
side-effects, e.g., moving a turtle.
- Overrides:
evaluate
in class Instruction
- Parameters:
c
- context in which the evaluation takes place
- Returns:
- false