|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectunsw.cse.framescript.Term
public abstract class Term
This abstract class provides a list of methods and default implemetations that all types available in FrameScript require.
| Constructor Summary | |
|---|---|
Term()
|
|
| 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. |
abstract boolean |
equals(Term t)
Compares two Terms for equality. |
abstract Term |
eval(Instance currentObject,
StackFrame frame)
Evaluates a Term. |
boolean |
fullMatch(unsw.cse.framescript.InputPattern input,
Instance current,
StackFrame frame)
Matches the Term to the current position in an input pattern. |
static java.lang.String |
indents(int level)
Privides a standard method for generating indentation. |
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. |
abstract java.lang.String |
toString()
Turns the Term into a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Term()
| Method Detail |
|---|
public abstract Term eval(Instance currentObject,
StackFrame frame)
throws FSException
currentObject - 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 evaluation
public Term assign(Instance currentObject,
Term arg,
StackFrame frame)
throws FSException
currentObject - 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
vars - a list of variables to be mapped
SyntaxError - if in performing the mapping it finds an invalid variable namepublic abstract boolean equals(Term t)
t - Term to be compared to
public boolean match(unsw.cse.framescript.InputPattern input,
Instance current,
StackFrame frame)
throws FSException
input - 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
input - 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 processpublic abstract java.lang.String toString()
toString in class java.lang.Object
public java.lang.String asString(int indentLevel,
boolean inPattern)
indentLevel - 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
public static java.lang.String indents(int level)
level - number of indents to generate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||