slogo.instruction
Class Print

java.lang.Object
  extended by slogo.language.GrammarElement
      extended by slogo.instruction.Instruction
          extended by 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

Field Summary
protected  Expression myExpression
           
 
Fields inherited from class slogo.language.GrammarElement
gelementsToValue
 
Constructor Summary
Print(Expression e)
           
 
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
 

Field Detail

myExpression

protected Expression myExpression
Constructor Detail

Print

public Print(Expression e)
Method Detail

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