|
|||||||||
| 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.Compound
public class Compound
The class represents all function/subroutine references and calls.
| Constructor Summary | |
|---|---|
Compound(Atom functor)
Creates a Compound with 0 arguements. |
|
Compound(Atom functor,
Term arg1)
Creates a Compound with 1 argument. |
|
Compound(Atom functor,
Term arg1,
Term arg2)
Creates a Compound with 2 arguements. |
|
Compound(Atom functor,
java.util.Vector args)
Creates a Compound with a list of arguements. |
|
| Method Summary | |
|---|---|
Term |
assign(Instance currentObject,
Term arg,
StackFrame frame)
Assigns a value to a Term. |
java.lang.String |
asString(int indentLevel,
boolean inPattern)
Turns the Term into a string. |
boolean |
equals(Term t)
Compares two Terms for equality. |
Term |
eval(Instance currentObject,
StackFrame frame)
Evalutes the function call. |
boolean |
fullMatch(unsw.cse.framescript.InputPattern input,
Instance current,
StackFrame frame)
Matches the Term to the current position in an input pattern. |
Term |
mapVars(FSList vars)
Maps atoms to variables from the list of variables. |
boolean |
match(unsw.cse.framescript.InputPattern input,
Instance current,
StackFrame frame)
Matches the Term to the current position in an input pattern. |
java.lang.String |
toString()
Turns the Term into a string. |
| Methods inherited from class unsw.cse.framescript.Term |
|---|
indents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Compound(Atom functor)
functor - name of the function
public Compound(Atom functor,
Term arg1)
functor - name of the functionarg1 - the argument
public Compound(Atom functor,
Term arg1,
Term arg2)
functor - name of the functionarg1 - the first arguementarg2 - the second arguement
public Compound(Atom functor,
java.util.Vector args)
functor - the name of the functionargs - the arguements to the function| Method Detail |
|---|
public Term eval(Instance currentObject,
StackFrame frame)
throws FSException
eval in class TermcurrentObject - the enclosing instance frame for the code being evaluatedframe - 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 boolean match(unsw.cse.framescript.InputPattern input,
Instance current,
StackFrame frame)
throws FSException
Term
match in class Terminput - the input the Term is being matched againstcurrent - the enclosing instance frame for the code being evaluatedframe - StackFrame that holds the values for any variables
FSException - if any errors occur during the match process
public boolean fullMatch(unsw.cse.framescript.InputPattern input,
Instance current,
StackFrame frame)
throws FSException
Term
fullMatch in class Terminput - the input the Term is being matched againstcurrent - the enclosing instance frame for the code being evaluatedframe - StackFrame that holds the values for any variables
FSException - if any errors occur during the match process
public Term assign(Instance currentObject,
Term arg,
StackFrame frame)
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 Termframe - 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 java.lang.String toString()
Term
toString in class Term
public java.lang.String asString(int indentLevel,
boolean inPattern)
Term
asString in class TermindentLevel - indentation level to uses for any subsequent lines in the stringinPattern - whether or not to format the string as though it is inside a pattern
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||