slogo.expression
Class Subroutine

java.lang.Object
  extended by slogo.language.GrammarElement
      extended by slogo.expression.Expression
          extended by slogo.expression.Subroutine

public class Subroutine
extends Expression


Field Summary
protected  java.lang.String myName
           
protected  StrictInstructionList mySIL
           
 
Fields inherited from class slogo.language.GrammarElement
gelementsToValue
 
Constructor Summary
Subroutine(IdentifierToken id, StrictInstructionList sil)
           
Subroutine(java.lang.String name)
           
 
Method Summary
 java.lang.Double evaluate(Context c)
          Evaluate this language construct in some context.
 double value(Context c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myName

protected java.lang.String myName

mySIL

protected StrictInstructionList mySIL
Constructor Detail

Subroutine

public Subroutine(java.lang.String name)

Subroutine

public Subroutine(IdentifierToken id,
                  StrictInstructionList sil)
Method Detail

evaluate

public java.lang.Double 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 Expression
Parameters:
c - context in which the evaluation takes place
Returns:
the result of evaluating the construct

value

public double value(Context c)
Specified by:
value in class Expression