|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectunsw.cse.framescript.Term
unsw.cse.framescript.FSList
public class FSList
This class is a simple linked list that provides sets/lists in FrameScript.
| Field Summary | |
|---|---|
Term |
first
The head of the list. |
FSList |
next
The list's tail. |
static FSList |
nil
The shared empty list. |
| Constructor Summary | |
|---|---|
FSList(Term t)
Creates a list with one term. |
|
FSList(Term t,
FSList l)
Creates a list where t is its head and l is its tail. |
|
| Method Summary | |
|---|---|
FSList |
append(FSList l)
Appends one list to another. |
Term |
assign(Instance currentObject,
Term arg,
StackFrame stackframe)
Assigns a value to a Term. |
boolean |
equals(Term t)
Compares two Terms for equality. |
Term |
eval(Instance currentObject,
StackFrame stackframe)
Evaluates a Term. |
Term |
get(long l)
Gets the element at a given index in the list. |
static void |
init()
Initialises list manipulation subroutines. |
Term |
mapVars(FSList vars)
Maps atoms to variables from the list of variables. |
boolean |
member(Term t)
Test to see if a term is a member of a list. |
int |
size()
Gets the size of the list. |
java.lang.String |
toString()
Turns the Term into a string. |
FSList |
without(Term t)
Removes a term from a list. |
| Methods inherited from class unsw.cse.framescript.Term |
|---|
asString, fullMatch, indents, match |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static FSList nil
public Term first
public FSList next
| Constructor Detail |
|---|
public FSList(Term t)
t -
public FSList(Term t,
FSList l)
t - the head of the listl - the tail of the list| Method Detail |
|---|
public Term eval(Instance currentObject,
StackFrame stackframe)
throws FSException
Term
eval in class TermcurrentObject - the enclosing instance frame for the code being evaluatedstackframe - StackFrame that holds the values for any variables
FSException - if any errors occur in performing the evaluationpublic boolean equals(Term t)
Term
equals in class Termt - Term to be compared to
public Term assign(Instance currentObject,
Term arg,
StackFrame stackframe)
throws FSException
Term
assign in class TermcurrentObject - the enclosing instance frame for the code being evaluated that
is performing the assignmentarg - the unevaluated value to be assigned to the Termstackframe - StackFrame that holds the values for any variables
FSException - if assignment cannot be performed
public Term mapVars(FSList vars)
throws SyntaxError
Term
mapVars in class Termvars - a list of variables to be mapped
SyntaxError - if in performing the mapping it finds an invalid variable namepublic boolean member(Term t)
t - term being tested for membership
public int size()
public Term get(long l)
throws FSException
l - the index of the element to get
FSException - if the indexz is invalidpublic FSList append(FSList l)
l - list to be append to the end of the list
public FSList without(Term t)
t - term to be removed from the list
public java.lang.String toString()
Term
toString in class Term
public static void init()
throws FSException
FSException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||