Package net.sourceforge.veditor.parser

Examples of net.sourceforge.veditor.parser.OutlineDatabase$ScanProjectJob


      }
     
      // if module is not found, show popup
      showPopUp(definitionList, editor, selectionPos);
    } else { // not found in this file, search in packages of other files
      OutlineDatabase database = doc.getOutlineDatabase()
      if (database != null) {
        OutlineElement[] elements = database.findTopLevelElements("");
        for (int i = 0; i < elements.length; i++) {
          if(elements[i] instanceof PackageDeclElement ){
            OutlineElement[] subPackageElements=elements[i].getChildren();
            for(int j=0; j< subPackageElements.length; j++){
              if ( subPackageElements[j].getName()
View Full Code Here


  /**
   * Gets the outline database object for this project  
   * @return
   */
  public OutlineDatabase getOutlineDatabase(){ 
      OutlineDatabase database = null;
      IProject project = getProject();
      if(project != null){
        try {
          database = (OutlineDatabase) project
              .getSessionProperty(VerilogPlugin.getOutlineDatabaseId());
View Full Code Here

   * @param bRefreshIfNeeded if true the outline will be if the data is stale
   * @return The outline container for this document
   * @throws HdlParserException
   */
  public OutlineContainer getOutlineContainer(boolean bRefreshIfNeeded) throws HdlParserException{
    OutlineDatabase database=getOutlineDatabase();
    if (database == null){
      return null;
    }
    OutlineContainer results=database.getOutlineContainer(getFile());
    if(results==null || bRefreshIfNeeded){
      refreshOutline();
    }
   
    return database.getOutlineContainer(getFile());
  }
View Full Code Here

        parser.parse();
      }
      catch (HdlParserException e){
        throw e;
      }
      OutlineDatabase database = OutlineDatabase.getProjectsDatabase(getProject());
      database.scanTree(getFile());
      return true;
    }   
    return false;
  }
View Full Code Here

   * @param project Project to owning the data base 
   *  
   */
  private OutlineDatabase CreateOutlineDatabase(IProject project){
    // do we already have an outline database?
    OutlineDatabase database=null;
    try {
      database = (OutlineDatabase)project.getSessionProperty(VerilogPlugin.getOutlineDatabaseId());     
    } catch (CoreException e) {     
      e.printStackTrace();
    }
    //if not created yet, make one
    if(database == null){
      database=new OutlineDatabase(project);
      try {
        project.setSessionProperty(VerilogPlugin.getOutlineDatabaseId(), database);
        database.scanProject();
      } catch (CoreException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
View Full Code Here

    } catch (HdlParserException e) {
      e.printStackTrace();     
    }

    if (entityName != null){
      OutlineDatabase database = getOutlineDatabase();
      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]);
              }
            }       
          }
        }
      }
    }
   
    {
      OutlineDatabase database = getOutlineDatabase();
      PackageDeclElement packs[] = database.findTopLevelPackages();
      for (int p=0;p<packs.length;p++){
        PackageDeclElement packDecl = packs[p];
        OutlineElement[] enitityChildren=packDecl.getChildren();
        for(int entChildIdx=0;entChildIdx<enitityChildren.length;entChildIdx++){
          ifenitityChildren[entChildIdx].getName().equalsIgnoreCase(name)){
View Full Code Here

  /**
   * Gets a list of top level modules in this project
   * @return
   */
  private VerilogOutlineElement[] scanProject(HdlDocument doc){
    OutlineDatabase database;
    OutlineElement []topLevelElements;
    HashMap<String,VerilogModuleElement> topLevelModules=new HashMap<String,VerilogModuleElement>();
   
    try {
      database = (OutlineDatabase)
        doc.getProject().getSessionProperty(VerilogPlugin.getOutlineDatabaseId());
    } catch (CoreException e) {
      e.printStackTrace();   
      return null;
    }
    ////////////////////////////////////////////
    //scan for modules and make a list
    topLevelElements = database.findTopLevelElements("");
    m_ModuleList.clear();
    for (OutlineElement element : topLevelElements){
      if (element instanceof VerilogModuleElement) {
        VerilogModuleElement moduleElement = (VerilogModuleElement) element;
        m_ModuleList.put(moduleElement.getShortName(),moduleElement);
View Full Code Here

      addSignalPropsals(doc, documentOffset, match, currentElement,matchList);
      addSubprogramProposals(doc, documentOffset, match,currentElement, matchList);
    } else
      if(matchword.length==2 && matchword[0].equals("work")) { // packages auto completion
        String match2 = matchword[1].trim();
        OutlineDatabase database = doc.getOutlineDatabase();
        OutlineElement[] elements = database.findTopLevelElements(match2);
       
        matchList = new ArrayList<IComparableCompletionProposal>();
       
        for (int i = 0; i < elements.length; i++) {
          if(elements[i] instanceof PackageDeclElement){
View Full Code Here

  {
    m_Reader = reader;
    m_File = file; 
    m_LastCommentLine=-1;
    m_synopsisTranslateOff=-1;
    OutlineDatabase database = OutlineDatabase.getProjectsDatabase(project);   
    if(database != null){
      m_OutlineContainer = database.getOutlineContainer(file);
    }
    parser = new VHDLParserThread(m_Reader,m_File);
   
    taskTokenPattern=new Pattern[taskCommentTokens.length];
    for(int i=0; i< taskCommentTokens.length;i++){
View Full Code Here

   * @return List of proposals matching the given string
   */
  public List<IComparableCompletionProposal> getGlobalPropsals(HdlDocument doc,
      int offset, String replace) {
   
    OutlineDatabase database = doc.getOutlineDatabase();
    List<IComparableCompletionProposal> matchList = new ArrayList<IComparableCompletionProposal>();
    int length = replace.length();
   
    if (database != null) {
      OutlineElement[] elements = database.findTopLevelElements(replace);
      for (int i = 0; i < elements.length; i++) {
        if(VhdlInstanceCompletionProposal.canHandle(elements[i])) {
          matchList.add(new VhdlInstanceCompletionProposal(doc,
              elements[i], offset, length));       
        }
      }
      //look into packages
      elements = database.findTopLevelElements("");
      for (int i = 0; i < elements.length; i++) {
        if(elements[i] instanceof PackageDeclElement){
          OutlineElement[] subPackageElements=elements[i].getChildren();
          for(int j=0; j< subPackageElements.length; j++){
            if(VhdlInstanceCompletionProposal.canHandle(subPackageElements[j]) &&
View Full Code Here

TOP

Related Classes of net.sourceforge.veditor.parser.OutlineDatabase$ScanProjectJob

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.