slogo.instruction
Class Print
java.lang.Object
slogo.language.GrammarElement
slogo.instruction.Instruction
slogo.instruction.Print
public class Print
- extends Instruction
The Print instruction prints an expression. When evaluated, the Print
instruction evaluates the expression and prints the value to System.out using
println.
- Author:
- Owen Astrachan
Method Summary |
java.lang.Object |
evaluate(Context c)
Evaluate the expression and println it. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
myExpression
protected Expression myExpression
Print
public Print(Expression e)
evaluate
public java.lang.Object evaluate(Context c)
- Evaluate the expression and println it.
- Overrides:
evaluate
in class Instruction
- Parameters:
c
- is the Context in which the evaluation occurs
- Returns:
- null (probably should be the expression)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object