Class CompileBuildObject

  • Direct Known Subclasses:
    LangObjType.SimpleVectorBuilder

    public class CompileBuildObject
    extends Object
    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 Detail

      • CompileBuildObject

        public CompileBuildObject()
    • Method Detail

      • getLanguage

        public Language getLanguage()
      • getResultType

        public ObjectType getResultType()
      • resultTypeExtends

        public boolean resultTypeExtends​(ObjectType other)
      • resultTypeExtends

        public boolean resultTypeExtends​(Class other)
      • getArgCount

        public int getArgCount()
      • setArg

        public void setArg​(int i,
                           Expression arg)
      • numKeywordArgs

        public int numKeywordArgs()
      • keywordStart

        public int keywordStart()
      • insertArgument

        public void insertArgument​(int index,
                                   Expression arg)
        Insert an expression into the argument list.
      • setDefaultConstructor

        public void setDefaultConstructor​(PrimProcedure proc)
      • getDefaultConstructor

        public PrimProcedure getDefaultConstructor()
      • hasDefaultConstructor

        public boolean hasDefaultConstructor()
      • hasAddChildMethod

        public boolean hasAddChildMethod()
      • findNamedMember

        public Member findNamedMember​(String name)
      • getAddChildMethodName

        public String getAddChildMethodName()
      • useBuilder

        public boolean useBuilder​(int numCode,
                                  InlineCalls visitor)
        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.