Package gnu.kawa.reflect
Class CompileBuildObject
java.lang.Object
gnu.kawa.reflect.CompileBuildObject
- Direct Known Subclasses:
LangObjType.SimpleVectorBuilder
Support for custom class-specific compile-time object builders.
This class as-is supports compiling the Scheme form:
(TYPE carg1 ... cargK key1: karg1 ... keyL: kargL carg1 ... cargM)to:
tmp = new TYPE(carg1, ..., cargK); tmp.setKey1(karg1); ... tmp.setKeyM(kargM); tmp.add(carg1); ... tmp.add(cargM); return tmp;Methods in this class can be overridden in various ways to provide custom mappings. This is a work in progress.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
buildAddChild
(Declaration target, Expression child) buildSetter
(Declaration target, Member member, Expression value) findNamedMember
(String name) getArg
(int i) int
boolean
boolean
protected void
init
(ApplyExp exp, InlineCalls visitor, Type required, ObjectType ctype, ClassType caller) void
insertArgument
(int index, Expression arg) Insert an expression into the argument list.int
static CompileBuildObject
make
(ApplyExp exp, InlineCalls visitor, Type required, ObjectType ctype, ClassType caller) int
boolean
resultTypeExtends
(ObjectType other) boolean
resultTypeExtends
(Class other) void
setArg
(int i, Expression arg) void
boolean
useBuilder
(int numCode, InlineCalls visitor) Check if we should use the builder rather than the default.
-
Constructor Details
-
CompileBuildObject
public CompileBuildObject()
-
-
Method Details
-
getCompilation
-
getLanguage
-
getResultType
-
resultTypeExtends
-
resultTypeExtends
-
getArg
-
getArgCount
public int getArgCount() -
setArg
-
numKeywordArgs
public int numKeywordArgs() -
keywordStart
public int keywordStart() -
insertArgument
Insert an expression into the argument list. -
init
protected void init(ApplyExp exp, InlineCalls visitor, Type required, ObjectType ctype, ClassType caller) -
make
public static CompileBuildObject make(ApplyExp exp, InlineCalls visitor, Type required, ObjectType ctype, ClassType caller) -
setDefaultConstructor
-
getDefaultConstructor
-
hasDefaultConstructor
public boolean hasDefaultConstructor() -
hasAddChildMethod
public boolean hasAddChildMethod() -
findNamedMember
-
buildSetter
-
getAddChildMethodName
-
buildAddChild
-
useBuilder
Check if we should use the builder rather than the default.- Returns:
- if true, caller should rewrite using the
build()
method; otherwise caller (CompileInvoke
) should do the work itself.
-
build
-