unsw.cse.framescript
Class Frame

java.lang.Object
  extended by unsw.cse.framescript.Term
      extended by unsw.cse.framescript.Frame
Direct Known Subclasses:
Generic, Instance

public abstract class Frame
extends Term

This is an abstract class that provides the basic functionality inherent in all types of frames.

Author:
mmcgill

Method Summary
abstract  java.lang.String asText()
          Writes the frame as FrameScript.
 boolean equals(Term t)
          Compares two Terms for equality.
 Term eval(Instance currentObject, StackFrame stackframe)
          Evaluates a Term.
 void initFrame()
          Initialises the frame.
 java.lang.String toString()
          Turns the Term into a string.
 
Methods inherited from class unsw.cse.framescript.Term
assign, asString, fullMatch, indents, mapVars, match
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

initFrame

public void initFrame()
               throws FSException
Initialises the frame.

Throws:
FSException

eval

public Term eval(Instance currentObject,
                 StackFrame stackframe)
          throws FSException
Description copied from class: Term
Evaluates a Term. For many Terms the result is to return itself.

Specified by:
eval in class Term
Parameters:
currentObject - the enclosing instance frame for the code being evaluated
stackframe - StackFrame that holds the values for any variables
Returns:
the result of the evaluation
Throws:
FSException - if any errors occur in performing the evaluation

equals

public boolean equals(Term t)
Description copied from class: Term
Compares two Terms for equality.

Specified by:
equals in class Term
Parameters:
t - Term to be compared to
Returns:
true if the Terms are equal, false otherwise

toString

public java.lang.String toString()
Description copied from class: Term
Turns the Term into a string.

Specified by:
toString in class Term

asText

public abstract java.lang.String asText()
Writes the frame as FrameScript.

Returns:
a string that can hopefully be parsed to recreate the frame