public void setFunction(
     ReferenceItem<InstanceFunction> inst, ReferenceItem<FunctionDeclaration> base) {
   BaseFunction.Head head = new BaseFunction.Head(base);
   head.setDoc(base.getObject().getDoc());
   head.setInstanceRef(inst);
   // if (base.getDoc() != null) inst.setDoc(base.getDoc());
   inst.getObject().setHead(head.createReferenceItemWithLocation(base.getLocation()));
 }
Example #2
0
 protected void addItem(ModuleObjectNew module, ModuleObject item, TopASTNode node) {
   if (item instanceof NoSortList) {
     this.addNoSortList((NoSortList) item, module, node);
   } else if (item instanceof ReferenceItem) {
     ReferenceItem itemRef = (ReferenceItem) item;
     if (itemRef.getObject() instanceof NoSortList) {
       this.addNoSortList((NoSortList) itemRef.getObject(), module, node);
     } else {
       if (itemRef != null) {
         this.appendHdlDoc(itemRef, node);
         module.addReferenceItem(itemRef);
       }
     }
   }
 }
 public void resolveContext(ParseContext context) {
   TopASTNode headerNode = this.getFirstASTChild();
   ReferenceItem<FunctionDeclaration> funcR =
       (ReferenceItem<FunctionDeclaration>) headerNode.generateModule(context);
   ModuleObjectBaseItem baseFunc = new ModuleObjectBaseItem(funcR.getname());
   ReferenceItem<FunctionHolder> holdRef =
       context.getRefHandler().findLocalObject(baseFunc, ReferenceUtilities.REF_FUNCTION_HOLDER);
   if (holdRef != null) {
     BaseFunction base = new BaseFunction(funcR);
     ReferenceItem<InstanceFunction> instRef =
         holdRef.getObject().findReference(base.createReferenceItem());
     if (instRef != null) {
       ReferenceItem basR = instRef.getObject().getBody();
       if (basR == null) basR = instRef.getObject().getHead();
       if (basR != null) {
         // Add the local reference to the search reference for internal types and other things
         ReferenceItem localR = context.getRefHandler().getLocalReference();
         ReferenceItem searchR = context.getRefHandler().getSearchReference();
         // ModuleObjectCompositeHolder hol = ModuleObjectCompositeHolder.dualHolder("", localR,
         // searchR);
         // context.getRefHandler().setSearchReference(hol.createReferenceItem());
         context.setActiveReference(basR);
         context.getRefHandler().setLocalReference(basR);
       }
     }
   }
 }
Example #4
0
  private void privateLoadObject() {
    if (this.loaded) {
      if (super.getObject() != null) {
        attemptedLoads = 0;
        return;
      }
      if (attemptedLoads > 0) return;
      attemptedLoads++;
    }
    this.loaded = true;

    ReferenceLocation loc = this.getLocation();
    DesignFile dfile = LocationOperations.getDesignFile(loc);
    if (dfile != null) {
      dfile.getBuilder().build(BuildInterface.BUILD_FILE_CLOSED);

      ModuleObjectBaseItem base = new ModuleObjectBaseItem(this.getname());

      ModuleObjectIndexTop top = new ModuleObjectIndexTop(base.createReferenceItem(), base);
      ReferenceItem ref = dfile.getDesignFileBuilder().getSuperModule().findBaseReference(top);
      if (ref != null) this.setObject(ref.getObject());
    }
  }
Example #5
0
 private ReferenceItem<ModuleObjectWithList> getDepList(ReferenceItem item) {
   if (item != null) {
     return item.getDependants();
   }
   return new ModuleObjectWithList("Empty").createReferenceItem();
 }
Example #6
0
 protected void appendHdlDoc(ReferenceItem objRef, TopASTNode node) {
   TopASTToken tok = node.getFirstLeafNode().getToken();
   if (tok.getDoc() != null && objRef.getObject() != null) {
     objRef.getObject().changeDoc(tok.getDoc());
   }
 }