|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.mapping.Procedure gnu.mapping.ProcedureN gnu.mapping.MethodProc gnu.expr.PrimProcedure
public class PrimProcedure
A primitive Procedure implemented by a plain Java method.
Field Summary |
---|
Fields inherited from class gnu.mapping.MethodProc |
---|
NO_MATCH, NO_MATCH_AMBIGUOUS, NO_MATCH_BAD_TYPE, NO_MATCH_TOO_FEW_ARGS, NO_MATCH_TOO_MANY_ARGS |
Fields inherited from class gnu.mapping.ProcedureN |
---|
noArgs |
Constructor Summary | |
---|---|
PrimProcedure(ClassType classtype,
Type[] argTypes)
Use to compile new followed by constructor. |
|
PrimProcedure(int op_code,
ClassType classtype,
java.lang.String name,
Type retType,
Type[] argTypes)
|
|
PrimProcedure(int opcode,
Type retType,
Type[] argTypes)
|
|
PrimProcedure(Method method)
|
|
PrimProcedure(Method method,
boolean is_special,
Language language)
|
|
PrimProcedure(Method method,
LambdaExp source)
|
|
PrimProcedure(java.lang.reflect.Method method,
Language language)
|
|
PrimProcedure(Method method,
Language language)
|
Method Summary | |
---|---|
void |
apply(CallContext ctx)
Call this Procedure using the explicit-CallContext-convention. |
void |
compile(ApplyExp exp,
Compilation comp,
Target target)
|
static void |
compile(Compilation comp,
Method method,
Target target,
boolean isTailCall,
int op_code,
Type stackType)
|
void |
compile(Type thisType,
ApplyExp exp,
Compilation comp,
Target target)
|
static PrimProcedure |
getMethodFor(java.lang.Class procClass,
java.lang.String name,
Declaration decl,
Expression[] args,
Language language)
Get PrimProcedure for matching method in given class. |
static PrimProcedure |
getMethodFor(ClassType procClass,
java.lang.String name,
Declaration decl,
Expression[] args,
Language language)
|
static PrimProcedure |
getMethodFor(ClassType procClass,
java.lang.String name,
Declaration decl,
Type[] atypes,
Language language)
|
static PrimProcedure |
getMethodFor(Procedure pproc,
Declaration decl,
Expression[] args,
Language language)
Search for a matching static method in a procedure's class. |
static PrimProcedure |
getMethodFor(Procedure pproc,
Declaration decl,
Type[] atypes,
Language language)
|
static PrimProcedure |
getMethodFor(Procedure pproc,
Expression[] args)
|
java.lang.String |
getName()
|
Type |
getParameterType(int index)
|
Type[] |
getParameterTypes()
|
static java.lang.Class |
getProcedureClass(java.lang.Object pproc)
|
Type |
getReturnType()
|
Type |
getReturnType(Expression[] args)
|
boolean |
getStaticFlag()
|
java.lang.String |
getVerboseName()
|
boolean |
isSpecial()
|
static PrimProcedure |
makeBuiltinBinary(int opcode,
Type type)
|
static PrimProcedure |
makeBuiltinUnary(int opcode,
Type type)
|
int |
match0(CallContext ctx)
Pass zero arguments. |
int |
match1(java.lang.Object arg1,
CallContext ctx)
Pass one argument. |
int |
match2(java.lang.Object arg1,
java.lang.Object arg2,
CallContext ctx)
Pass two arguments. |
int |
match3(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
CallContext ctx)
Pass three arguments. |
int |
match4(java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3,
java.lang.Object arg4,
CallContext ctx)
Pass four arguments. |
int |
matchN(java.lang.Object[] args,
CallContext ctx)
|
int |
numArgs()
Return minArgs()|(maxArgs<<12). |
int |
opcode()
|
void |
print(java.io.PrintWriter ps)
|
void |
setReturnType(Type retType)
|
boolean |
takesContext()
|
static boolean |
takesContext(Method method)
|
boolean |
takesVarArgs()
Return true iff the last parameter is a "rest" argument. |
java.lang.String |
toString()
|
Methods inherited from class gnu.mapping.MethodProc |
---|
applyN, isApplicable, matchFailAsException, mostSpecific, mostSpecific, numParameters, resolveParameterTypes |
Methods inherited from class gnu.mapping.ProcedureN |
---|
apply0, apply1, apply2, apply3, apply4 |
Methods inherited from class gnu.mapping.Procedure |
---|
apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getProperty, getSetter, getSymbol, maxArgs, minArgs, name, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PrimProcedure(java.lang.reflect.Method method, Language language)
public PrimProcedure(Method method)
public PrimProcedure(Method method, Language language)
public PrimProcedure(Method method, boolean is_special, Language language)
public PrimProcedure(Method method, LambdaExp source)
public PrimProcedure(int opcode, Type retType, Type[] argTypes)
public PrimProcedure(int op_code, ClassType classtype, java.lang.String name, Type retType, Type[] argTypes)
public PrimProcedure(ClassType classtype, Type[] argTypes)
Method Detail |
---|
public final int opcode()
public Type getReturnType()
public void setReturnType(Type retType)
public boolean isSpecial()
public Type getReturnType(Expression[] args)
getReturnType
in interface Inlineable
public boolean takesVarArgs()
public boolean takesContext()
public static boolean takesContext(Method method)
public int numArgs()
Procedure
numArgs
in class Procedure
public int match0(CallContext ctx)
Procedure
match0
in class Procedure
public int match1(java.lang.Object arg1, CallContext ctx)
Procedure
match1
in class Procedure
public int match2(java.lang.Object arg1, java.lang.Object arg2, CallContext ctx)
Procedure
match2
in class Procedure
public int match3(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, CallContext ctx)
Procedure
match3
in class Procedure
public int match4(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, CallContext ctx)
Procedure
match4
in class Procedure
public int matchN(java.lang.Object[] args, CallContext ctx)
matchN
in class Procedure
public void apply(CallContext ctx) throws java.lang.Throwable
Procedure
apply
in class Procedure
java.lang.Throwable
public static PrimProcedure makeBuiltinUnary(int opcode, Type type)
public static PrimProcedure makeBuiltinBinary(int opcode, Type type)
public final boolean getStaticFlag()
public final Type[] getParameterTypes()
public void compile(ApplyExp exp, Compilation comp, Target target)
compile
in interface Inlineable
public void compile(Type thisType, ApplyExp exp, Compilation comp, Target target)
public static void compile(Compilation comp, Method method, Target target, boolean isTailCall, int op_code, Type stackType)
public Type getParameterType(int index)
getParameterType
in class MethodProc
public static PrimProcedure getMethodFor(Procedure pproc, Expression[] args)
public static PrimProcedure getMethodFor(Procedure pproc, Declaration decl, Expression[] args, Language language)
public static PrimProcedure getMethodFor(Procedure pproc, Declaration decl, Type[] atypes, Language language)
public static java.lang.Class getProcedureClass(java.lang.Object pproc)
public static PrimProcedure getMethodFor(java.lang.Class procClass, java.lang.String name, Declaration decl, Expression[] args, Language language)
public static PrimProcedure getMethodFor(ClassType procClass, java.lang.String name, Declaration decl, Expression[] args, Language language)
public static PrimProcedure getMethodFor(ClassType procClass, java.lang.String name, Declaration decl, Type[] atypes, Language language)
public java.lang.String getName()
getName
in interface Named
getName
in class Procedure
public java.lang.String getVerboseName()
public java.lang.String toString()
toString
in class Procedure
public void print(java.io.PrintWriter ps)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |