elan.expression
Class Expression

java.lang.Object
  |
  +--elan.GrammarElement
        |
        +--elan.expression.Expression
Direct Known Subclasses:
Background, Bg, BinaryExpression, Heading, Number, Pc, Pencolor, Pendownp, Pensize, Ps, Shape, UnaryExpression, Variable, Xcor, Ycor

public abstract class Expression
extends GrammarElement

the base class of all arithmetic expressions, the evaluate method uses the hook/template method value to return a Double value, the template method returns a double.


Fields inherited from class elan.GrammarElement
functionMap, ourMap
 
Constructor Summary
Expression()
           
 
Method Summary
 java.lang.Object evaluate(Context c)
          Evaluate this language construct in some context.
abstract  double value(Context c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression

public Expression()
Method Detail

evaluate

public java.lang.Object 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 GrammarElement
Following copied from class: elan.GrammarElement
Parameters:
is - the context in which the evaluation takes place
Returns:
the result of evaluating the construct

value

public abstract double value(Context c)