|
sdr 0.21 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.cscott.sdr.calls.Call
public abstract class Call
The Call
class includes 'simple calls' (like HINGE) which
take no arguments, 'complex calls' (like SQUARE THRU) which take a
numerical argument, and 'concepts' (like AS COUPLES) which take another
call or calls as arguments. These are not distinguished here: the
important thing is that any call can be *applied* to zero or more
arguments (numbers, selectors, or other calls) to result in a
Comp
AST tree.
Constructor Summary | |
---|---|
Call()
|
Method Summary | |
---|---|
abstract Comp |
apply(Apply ast)
Evaluates this call with the arguments given in the Apply
node, returning a Comp . |
boolean |
equals(Object o)
|
abstract int |
getMinNumberOfArguments()
Return the number of arguments which should, at minimum, be given to this Call . |
abstract String |
getName()
The name of this call, in our internal jargon. |
abstract Program |
getProgram()
The program to which this particular call or concept belongs. |
abstract Rule |
getRule()
Returns the grammar rule applicable to this call, or null , if there is none (ie, this is an internal call). |
int |
hashCode()
|
static Call |
makeSimpleCall(String name,
Program program,
Comp def,
Rule rule)
Create a Call object for a 'simple call' which takes no arguments. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Call()
Method Detail |
---|
public abstract String getName()
public abstract Program getProgram()
public abstract Comp apply(Apply ast)
Apply
node, returning a Comp
. Note that the
callName
field of ast
should
match this.getName()
, and the
length of the list in the args
field should
be at least
this.getMinNumberOfArguments()
.
public abstract int getMinNumberOfArguments()
Call
. Usually this is the exact number of arguments required,
but some combining calls (like 'and') can take an arbitrary number of
arguments.
public abstract Rule getRule()
null
, if there is none (ie, this is an internal call).
public final String toString()
toString
in class Object
public final int hashCode()
hashCode
in class Object
public final boolean equals(Object o)
equals
in class Object
public static Call makeSimpleCall(String name, Program program, Comp def, Rule rule)
|
sdr 0.21 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |