|
|||||||||
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.Atom
public class Atom
Atoms are the most common term used in FrameScript. The are strings of characters which can be used as the names of frames/terms or as values them selves.
Field Summary | |
---|---|
static Atom |
_default
Reserved atoms used in the parser. |
static Atom |
_else
Reserved atoms used in the parser. |
static Atom |
_false
Reserved atoms used in the parser. |
static Atom |
_if
Reserved atoms used in the parser. |
static Atom |
_instanceof
Reserved atoms used in the parser. |
static Atom |
_new
Reserved atoms used in the parser. |
static Atom |
_null
Reserved atoms used in the parser. |
static Atom |
_terminator
Reserved atoms used in the parser. |
static Atom |
_then
Reserved atoms used in the parser. |
static Atom |
_true
Reserved atoms used in the parser. |
static Atom |
ako
Reserved atoms used in the parser. |
static Atom |
and
Reserved atoms used in the parser. |
static Atom |
aposS
Reserved atoms used in the parser. |
static Atom |
arrow
Reserved atoms used in the parser. |
static Atom |
assign
Reserved atoms used in the parser. |
static Atom |
bang
Reserved atoms used in the parser. |
static Atom |
bar
Reserved atoms used in the parser. |
static Atom |
because
Reserved atoms used in the parser. |
static Atom |
cache
Reserved atoms used in the parser. |
static Atom |
colon
Reserved atoms used in the parser. |
static Atom |
comma
Reserved atoms used in the parser. |
static Atom |
current_object
Reserved atoms used in the parser. |
static Atom |
current_slot
Reserved atoms used in the parser. |
static Atom |
division
Reserved atoms used in the parser. |
static Atom |
domain
Reserved atoms used in the parser. |
static Atom |
dot
Reserved atoms used in the parser. |
static Atom |
double_arrow
Reserved atoms used in the parser. |
static Atom |
double_colon
Reserved atoms used in the parser. |
static Atom |
double_semi
Reserved atoms used in the parser. |
static Atom |
eq
Reserved atoms used in the parser. |
static Atom |
except
Reserved atoms used in the parser. |
static Atom |
failsafe
Reserved atoms used in the parser. |
static Atom |
forall
Reserved atoms used in the parser. |
static Atom |
ge
Reserved atoms used in the parser. |
static Atom |
gt
Reserved atoms used in the parser. |
static Atom |
hash
Reserved atoms used in the parser. |
static Atom |
hat
Reserved atoms used in the parser. |
static Atom |
help
Reserved atoms used in the parser. |
static Atom |
if_added
Reserved atoms used in the parser. |
static Atom |
if_destroyed
Reserved atoms used in the parser. |
static Atom |
if_needed
Reserved atoms used in the parser. |
static Atom |
if_new
Reserved atoms used in the parser. |
static Atom |
if_removed
Reserved atoms used in the parser. |
static Atom |
if_replaced
Reserved atoms used in the parser. |
static Atom |
in
Reserved atoms used in the parser. |
static Atom |
inherits
Reserved atoms used in the parser. |
static Atom |
isa
Reserved atoms used in the parser. |
static Atom |
lbrace
Reserved atoms used in the parser. |
static Atom |
lbracket
Reserved atoms used in the parser. |
static Atom |
le
Reserved atoms used in the parser. |
static Atom |
lpren
Reserved atoms used in the parser. |
static Atom |
lquote
Reserved atoms used in the parser. |
static Atom |
lt
Reserved atoms used in the parser. |
static Atom |
match
Reserved atoms used in the parser. |
static Atom |
minus
Reserved atoms used in the parser. |
static Atom |
mod
Reserved atoms used in the parser. |
static Atom |
multiplication
Reserved atoms used in the parser. |
static Atom |
multivalued
Reserved atoms used in the parser. |
static Atom |
ne
Reserved atoms used in the parser. |
static Atom |
new_value
Reserved atoms used in the parser. |
static Atom |
non_terminal
Reserved atoms used in the parser. |
static Atom |
not
Reserved atoms used in the parser. |
static Atom |
object
Reserved atoms used in the parser. |
static Atom |
of
Reserved atoms used in the parser. |
static Atom |
old_value
Reserved atoms used in the parser. |
static Atom |
on_entry
Reserved atoms used in the parser. |
static Atom |
on_exit
Reserved atoms used in the parser. |
static Atom |
or
Reserved atoms used in the parser. |
static Atom |
plus
Reserved atoms used in the parser. |
static Atom |
question
Reserved atoms used in the parser. |
static Atom |
range
Reserved atoms used in the parser. |
static Atom |
rbrace
Reserved atoms used in the parser. |
static Atom |
rbracket
Reserved atoms used in the parser. |
static Atom |
respond
Reserved atoms used in the parser. |
static Atom |
rpren
Reserved atoms used in the parser. |
static Atom |
rquote
Reserved atoms used in the parser. |
static Atom |
semi_colon
Reserved atoms used in the parser. |
static Atom |
separator
Reserved atoms used in the parser. |
static Atom |
star
Reserved atoms used in the parser. |
static Atom |
tilde
Reserved atoms used in the parser. |
static Atom |
to
Reserved atoms used in the parser. |
static Atom |
topic
Reserved atoms used in the parser. |
static Atom |
trigger
Reserved atoms used in the parser. |
static Atom |
underscore
Reserved atoms used in the parser. |
static Atom |
var
Reserved atoms used in the parser. |
static Atom |
with
Reserved atoms used in the parser. |
Method Summary | |
---|---|
Term |
apply(Instance currentObject,
Term[] args,
StackFrame frame)
Used to lookup the subroutine/function defined with the name. |
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)
Gets an atom's value. |
boolean |
fullMatch(unsw.cse.framescript.InputPattern input,
Instance current,
StackFrame frame)
Matches the Term to the current position in an input pattern. |
static Atom |
intern(java.lang.String str)
Gets the atom identified by a string. |
static Atom |
intern(java.lang.String str,
int pre,
int in,
int post)
Gets the atom identified by a string and sets its operator precedences. |
static Atom |
intern(java.lang.String str,
int pre,
int in,
int post,
boolean r)
Gets the atom identified by a string and sets its operator precedences. |
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 |
---|
asString, indents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Atom _null
public static Atom _true
public static Atom _false
public static Atom assign
public static Atom lt
public static Atom le
public static Atom eq
public static Atom ne
public static Atom gt
public static Atom ge
public static Atom bang
public static Atom question
public static Atom var
public static Atom plus
public static Atom minus
public static Atom multiplication
public static Atom division
public static Atom mod
public static Atom and
public static Atom or
public static Atom not
public static Atom lpren
public static Atom rpren
public static Atom lbrace
public static Atom rbrace
public static Atom lbracket
public static Atom rbracket
public static Atom lquote
public static Atom rquote
public static Atom isa
public static Atom ako
public static Atom with
public static Atom of
public static Atom object
public static Atom _new
public static Atom dot
public static Atom comma
public static Atom semi_colon
public static Atom colon
public static Atom double_colon
public static Atom double_semi
public static Atom _default
public static Atom range
public static Atom help
public static Atom cache
public static Atom multivalued
public static Atom if_new
public static Atom if_added
public static Atom if_needed
public static Atom if_removed
public static Atom if_replaced
public static Atom if_destroyed
public static Atom current_object
public static Atom current_slot
public static Atom new_value
public static Atom old_value
public static Atom to
public static Atom _if
public static Atom _then
public static Atom _else
public static Atom except
public static Atom because
public static Atom forall
public static Atom in
public static Atom star
public static Atom bar
public static Atom hat
public static Atom hash
public static Atom underscore
public static Atom arrow
public static Atom double_arrow
public static Atom non_terminal
public static Atom match
public static Atom respond
public static Atom topic
public static Atom domain
public static Atom trigger
public static Atom failsafe
public static Atom on_entry
public static Atom on_exit
public static Atom _instanceof
public static Atom inherits
public static Atom separator
public static Atom _terminator
public static Atom tilde
public static Atom aposS
Method Detail |
---|
public static Atom intern(java.lang.String str)
str
- the name of the atom
public static Atom intern(java.lang.String str, int pre, int in, int post)
str
- name of the atompre
- the precedence of the atom as a prefix operatorin
- the precedence of the atom as an infix operatorpost
- the precedence of the atom as a postfix operator
public static Atom intern(java.lang.String str, int pre, int in, int post, boolean r)
str
- name of the atompre
- the precedence of the atom as a prefix operatorin
- the precedence of the atom as an infix operatorpost
- the precedence of the atom as a postfix operatorr
- whether or not the infix operator is right branching
public Term apply(Instance currentObject, Term[] args, StackFrame frame) throws FSException
currentObject
- the enclosing instance frameargs
- the arguments for the function callframe
- the values of any defined variables
FSException
- if no function is defined for the atom or the number
of arguments is incorrectpublic Term assign(Instance currentObject, Term arg, StackFrame stackframe) throws FSException
Term
assign
in class Term
currentObject
- 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 performedpublic Term mapVars(FSList vars)
Term
mapVars
in class Term
vars
- a list of variables to be mapped
public Term eval(Instance currentObject, StackFrame stackframe) throws FSException
eval
in class Term
currentObject
- 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 Term
t
- Term to be compared to
public boolean match(unsw.cse.framescript.InputPattern input, Instance current, StackFrame frame) throws FSException
Term
match
in class Term
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 boolean fullMatch(unsw.cse.framescript.InputPattern input, Instance current, StackFrame frame)
Term
fullMatch
in class Term
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
public java.lang.String toString()
Term
toString
in class Term
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |