Package net.sourceforge.veditor.parser

Examples of net.sourceforge.veditor.parser.OutlineElement


    {
      String results = "";
      String signalName = text;
      Vector<OutlineElement> definitions = doc.getDefinitionList(signalName, offset);
     
      OutlineElement component = getComponentElement(signalName, doc,offset);
      boolean atLeftOfComponentInstantion = false;
     
      if(component instanceof ComponentInstElement) {
        String doccontent = doc.get();
        int indexArrow = doccontent.indexOf("=>", offset);
        int lineNrArrow,lineNrString;
        try {
          lineNrArrow = doc.getLineOfOffset(indexArrow);
          lineNrString = doc.getLineOfOffset(offset);
         
          if (lineNrString == lineNrArrow) {
            atLeftOfComponentInstantion = true;
          } else {
            atLeftOfComponentInstantion = false;
          }
        } catch (BadLocationException e) {
        }
      }
     
      if(!atLeftOfComponentInstantion) { 
        for(OutlineElement element:definitions) {
          String commentString;
          OutlineDatabase cc=doc.getOutlineDatabase();
          OutlineContainer pp=cc.getOutlineContainer(element.getFile());
          results+=pp.getCommentsNear(element);
          if(doc instanceof VhdlDocument){
            commentString="--";
          }
          else{
            commentString="//";
          }
          results=results.trim();
          if(results.length() > 0){
            results=results.replaceAll("^",commentString+" ");
            results=results.replaceAll("\n","\n"+commentString+" ");
            results+="\n";
          }
          // ULTRANO
          //results+=element.getLongName()+"\n";
          results+=element.getFullSourceCode();
        }
      } else {
        VhdlOutlineElement component1 = (VhdlOutlineElement) component;
        String componentName = component1.getTypePart1();
        OutlineElement componentDef = searchComponent(doc,
            componentName);
        String signalType = searchSignalType(componentDef, signalName);
        results += signalType;
      }
       
View Full Code Here


      }return null;
    }

    private OutlineElement getComponentElement (String text, HdlDocument doc,int offset) {
     
      OutlineElement currentElement = null;
           HdlDocument wi=doc;
           try
             currentElement=wi.getElementAt(offset,true);
          
           }
View Full Code Here

   * @param item
   * @return
   */
  protected TreeItem findTreeItem(TreeItem item,OutlineElement element){
    if (item.getData() instanceof OutlineElement) {
      OutlineElement e = (OutlineElement) item.getData();
      if(e.equals(element)){
        return item;
      }     
    }else
    {
      return null;
View Full Code Here

      IStructuredSelection elements = (IStructuredSelection)selection;
      if (elements.size() == 1)
      {
        Object element = elements.getFirstElement();
        if (element instanceof OutlineElement) {
          OutlineElement outlineElement = (OutlineElement) element;
          m_Editor.showElement(outlineElement);
        }
      }
    }
  }
View Full Code Here

          if (element instanceof VerilogInstanceElement) {
            VerilogInstanceElement instance = (VerilogInstanceElement) element;
            OutlineDatabase database = getOutlineDatabase();
            if (database != null) {
              OutlineElement module = database.findDefinition(instance);
              if (module != null)
                m_Editor.showElement(module);
            }

          } else if (element instanceof OutlineElement) {
            OutlineElement outlineElement = (OutlineElement) element;
            m_Editor.showElement(outlineElement);
          }
        }
      }
    }
View Full Code Here

        }
   
   
   
    //default case
    return new OutlineElement(name,type,startLine,startCol,endLine,endCol,file,true);
  }
View Full Code Here

{
  public Object[] getChildren(Object parentElement)
  {
    if (parentElement instanceof OutlineElement)
    {
      OutlineElement e = (OutlineElement)parentElement;
      Vector<Object> results=new Vector<Object>();
      OutlineElement[] children=e.getChildren();
      for(int i=0;i<children.length;i++){
        if (children[i].isVisible()){
          results.add(children[i]);
        }
      }
View Full Code Here

      return;
    for (String conn : conns) {
      String[] csplit = conn.split("#");
      String moduleName = csplit[0];
      String portName = csplit[1];
      OutlineElement module = database.findTopLevelElement(moduleName);
      if (module != null) {
        OutlineElement port = findPortInModule(module, portName);
        if (port != null) {
          String type = port.getType();
          if (type.startsWith("port#input")) {
            sym.setUsed();
          } else if (type.startsWith("port#output")) {
            if (sym.isReg()) {
              int line = Integer.parseInt(csplit[2]);
View Full Code Here

      }
    }
  }
 
  private OutlineElement findPortInModule(OutlineElement module, String name) {
    OutlineElement port;
    if (Character.isDigit(name.charAt(0))) {
      int index = Integer.parseInt(name);
      port = module.getChild(index);
    } else {
      port = module.findChild(name);
    }
    if (port == null)
      return null;
    if (port.getType().startsWith("port#")) {
      return port;
    } else {
      return null;
    }
  }
View Full Code Here

    OutlineDatabase database = OutlineDatabase.getProjectsDatabase(m_Project);

    InstanceStore store = instanceStore;
    for(InstanceStore.Instance inst : store.collection()) {
      String moduleName = inst.getName();
      OutlineElement module = database.findTopLevelElement(moduleName);
      if (module == null) {
        if (preferences.unresolvedModule) {
          int line = inst.getLine();
          warning(line, CANNOT_RESOLVED_MODULE, moduleName);
        }
View Full Code Here

TOP

Related Classes of net.sourceforge.veditor.parser.OutlineElement

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.