slogo.jelan
Class GrammarElement

java.lang.Object
  extended by slogo.jelan.GrammarElement
Direct Known Subclasses:
Expression, Instruction

public abstract class GrammarElement
extends java.lang.Object

All elements of the elan language (e.g., that make up an abstract syntax tree) should extend GrammarElement. Evaluating a language construct with a context returns the value of the evaluation and may have side-effects.


Constructor Summary
GrammarElement()
           
 
Method Summary
abstract  java.lang.Object evaluate(Context c)
          Evaluate this language construct in some context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrammarElement

public GrammarElement()
Method Detail

evaluate

public abstract java.lang.Object evaluate(Context c)
Evaluate this language construct in some context. The evaluation may have side-effects, e.g., moving a turtle.

Parameters:
c - context in which the evaluation takes place
Returns:
the result of evaluating the construct