Package net.sourceforge.veditor.parser.vhdl.VhdlOutlineElementFactory

Examples of net.sourceforge.veditor.parser.vhdl.VhdlOutlineElementFactory.EntityDeclElement


   */
  public Object[] getChildren(Object parentElement) {
    //top level entity
    if (parentElement instanceof EntityDeclElement)
    {
      EntityDeclElement e = (EntityDeclElement)parentElement;
      //list of architectures
      return (Object[])m_EntityArchList.get(e.getName().toUpperCase()).toArray();
    }
    //architecture
    else if (parentElement instanceof ArchitectureElement) {
      ArchitectureElement arch = (ArchitectureElement) parentElement;
      Vector<VhdlOutlineElement> childInstantiations=new Vector<VhdlOutlineElement>();
      OutlineElement[] children= arch.getChildren();
      //return all the instantiations
      for(int i=0; i< children.length;i++){
        if (children[i] instanceof EntityInstElement) {
          //do not add recursive children
          EntityInstElement e = (EntityInstElement)children[i];
          if(e.GetEntityName().toUpperCase().equals(arch.GetEntityName().toUpperCase())==false){
            childInstantiations.add(e);
          }
        }
        if (children[i] instanceof ComponentInstElement) {
          //do not add recursive children
View Full Code Here


  public boolean hasChildren(Object element)
  {
    //top level entity
    if (element instanceof EntityDeclElement)
    {
      EntityDeclElement e = (EntityDeclElement)element;
      Vector<ArchitectureElement> archList=m_EntityArchList.get(e.getName().toUpperCase());
      //list of architectures
      return (archList.size() != 0);
    }
    //architecture
    else if (element instanceof ArchitectureElement) {
View Full Code Here

        //add the found architecture to the list of known architectures
        archList.add(arch);
      }
      //entity declarations
      if (topLevelElements[i] instanceof EntityDeclElement) {
        EntityDeclElement entityDecl = (EntityDeclElement) topLevelElements[i];
        m_ElementDeclList.put(entityDecl.getName().toUpperCase(), entityDecl);
        if(!m_EntityArchList.containsKey(entityDecl.getName().toUpperCase())){         
          //new entity
          archList=new Vector<ArchitectureElement>();
          m_EntityArchList.put(entityDecl.getName().toUpperCase(), archList);
        }
      }
    }
    /////////////////////////////////////////////
    //Find top level entities
    entityNameList = m_EntityArchList.keySet();
    //start by assuming everything is a top level entity
    topLevelEntities.addAll(entityNameList);
    Iterator<String> it=entityNameList.iterator();
    while(it.hasNext()){
      entityName=it.next();
      archList=m_EntityArchList.get(entityName);
      //go through all the architectures
      for(int i=0; i<archList.size();i++){
        OutlineElement[] childElements=archList.get(i).getChildren();
        //go through all the instances
        for(int j=0;j< childElements.length; j++){
          if (childElements[j] instanceof EntityInstElement) {
            EntityInstElement entityInst = (EntityInstElement) childElements[j];
            String nameParts[] = entityInst.GetEntityName().toUpperCase().split("\\.");
            String n=
              nameParts.length==0 ? entityInst.GetEntityName() : nameParts[nameParts.length-1];
            //remove the name from the top level
            topLevelEntities.remove(n.toUpperCase());
          }
          if (childElements[j] instanceof ComponentInstElement) {
            ComponentInstElement compInst = (ComponentInstElement) childElements[j];
            String nameParts[] = compInst.GetEntityName().toUpperCase().split("\\.");
            String n=
              nameParts.length==0 ? compInst.GetEntityName() : nameParts[nameParts.length-1];
            //remove the name from the top level
            topLevelEntities.remove(n.toUpperCase());
          }
        }
      }
    }
    //////////////////////////////////////////
    //Start building the hierarchy   
    for (int i=0;i<topLevelElements.length;i++){
      if (topLevelElements[i] instanceof EntityDeclElement) {
        EntityDeclElement entityDecl = (EntityDeclElement) topLevelElements[i];
        //if this is a top level element, add it to the root
        if(topLevelEntities.contains(entityDecl.getName().toUpperCase())){
          m_TopLevelEntities.add(entityDecl);
        }
      }
    }
    return true;
View Full Code Here

      OutlineContainer outline = database.getOutlineContainer(getFile());
      Object[] children= outline.getTopLevelElements();
     
      for (int i=0;i<children.length;i++){
        if (children[i] instanceof EntityDeclElement) {
          EntityDeclElement entityDecl = (EntityDeclElement) children[i];     
          //if we find an entity declaration, add the ports and generics
          if (entityDecl.getName().equalsIgnoreCase(entityName)) {       
            //get the entity's children
            OutlineElement[] enitityChildren=entityDecl.getChildren();
            for(int entChildIdx=0;entChildIdx<enitityChildren.length;entChildIdx++){
              ifenitityChildren[entChildIdx].getName().equalsIgnoreCase(name)){
                results.add(enitityChildren[entChildIdx]);
              }
            }       
View Full Code Here

TOP

Related Classes of net.sourceforge.veditor.parser.vhdl.VhdlOutlineElementFactory.EntityDeclElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.