|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.cscott.sdr.calls.ExprFunc<Evaluator> net.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, matchers, or other calls) to result in an
Evaluator
(and sometimes, if Evaluator.hasSimpleExpansion()
is true, to a Comp
AST tree).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.cscott.sdr.calls.ExprFunc |
---|
ExprFunc.EvaluationException |
Constructor Summary | |
---|---|
Call()
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
Evaluator |
evaluate(Class<? super Evaluator> type,
DanceState ds,
List<Expr> args)
Implementation of ExprFunc interface: this Call can
be evaluated to yield an Evaluator . |
abstract List<Expr> |
getDefaultArguments()
Return argument defaults, if there are any for this call. |
abstract Evaluator |
getEvaluator(DanceState ds,
List<Expr> args)
Returns the Evaluator to use on the result of an application. |
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 net.cscott.sdr.calls.ExprFunc |
---|
isConstant |
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()
getName
in class ExprFunc<Evaluator>
public abstract Program getProgram()
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 List<Expr> getDefaultArguments()
null
, have no default.
public abstract Rule getRule()
null
, if there is none (ie, this is an internal call).
public abstract Evaluator getEvaluator(DanceState ds, List<Expr> args) throws ExprFunc.EvaluationException
Evaluator
to use on the result of an application.
The Evaluator.hasSimpleExpansion()
method of the
Evaluator
will return true if this call can be simply expanded;
use the Evaluator.simpleExpansion()
method to obtain the
expansion. Otherwise the call
should be considered 'opaque' and requires use of the custom
Evaluator
.)
args
- identical to the args argument of
ExprFunc.evaluate(Class, DanceState, List)
.
ExprFunc.EvaluationException
public final Evaluator evaluate(Class<? super Evaluator> type, DanceState ds, List<Expr> args) throws ExprFunc.EvaluationException
ExprFunc
interface: this Call
can
be evaluated to yield an Evaluator
.
evaluate
in class ExprFunc<Evaluator>
ExprFunc.EvaluationException
- on type mismatch or other unexpected
conditions.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.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |