Package tool.model

Examples of tool.model.ToolClass


            match(input, Token.DOWN, null); if (state.failed) return retval;
            IDENTIFIER29=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_classDeclaration1128); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
              
                    retval.toolClass = new ToolClass((IDENTIFIER29!=null?IDENTIFIER29.getText():null));
                    retval.toolClass.setToolName(retval.toolClass.xlateName((IDENTIFIER29!=null?IDENTIFIER29.getText():null)));
                    currentType = retval.toolClass;
                 
            }
            // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteAST.g:364:5: ( isMappedClass )?
View Full Code Here


            match(input, Token.DOWN, null); if (state.failed) return retval;
            IDENTIFIER1=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_classDeclaration130); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
              
                    ((classDeclaration_scope)classDeclaration_stack.peek()).currentClass = new ToolClass((IDENTIFIER1!=null?IDENTIFIER1.getText():null));
                    retval.toolClass = ((classDeclaration_scope)classDeclaration_stack.peek()).currentClass;
                    ((classDeclaration_scope)classDeclaration_stack.peek()).currentClass.setToolName(((classDeclaration_scope)classDeclaration_stack.peek()).currentClass.xlateName((IDENTIFIER1!=null?IDENTIFIER1.getText():null)));
                 
            }
            // /Users/peter/Documents/workspace/ToolModel/src/tool/model/grammar/ForteCDFTree.g:70:5: ( isMappedClass )?
View Full Code Here


    // $ANTLR start "classDeclaration"
    // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:328:1: classDeclaration[String projectName] returns [ToolClass toolClass] : ^( CLASS_DECLARATION IDENTIFIER ( isMappedClass )? superT= qualifiedType ( cEnum )* ( component_definition )* ( ^( IMPLEMENTS qualifiedType ) )* ( classProperties )+ ( STRINGLITERAL )? ) ;
    public final ToolClass classDeclaration(String projectName) throws RecognitionException {
        ToolClass toolClass = null;


        CommonTree IDENTIFIER28=null;
        ForteAST.qualifiedType_return superT =null;

        ForteAST.isMappedClass_return isMappedClass29 =null;


        try {
            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:329:5: ( ^( CLASS_DECLARATION IDENTIFIER ( isMappedClass )? superT= qualifiedType ( cEnum )* ( component_definition )* ( ^( IMPLEMENTS qualifiedType ) )* ( classProperties )+ ( STRINGLITERAL )? ) )
            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:329:7: ^( CLASS_DECLARATION IDENTIFIER ( isMappedClass )? superT= qualifiedType ( cEnum )* ( component_definition )* ( ^( IMPLEMENTS qualifiedType ) )* ( classProperties )+ ( STRINGLITERAL )? )
            {
            match(input,CLASS_DECLARATION,FOLLOW_CLASS_DECLARATION_in_classDeclaration1086); if (state.failed) return toolClass;

            match(input, Token.DOWN, null); if (state.failed) return toolClass;
            IDENTIFIER28=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_classDeclaration1088); if (state.failed) return toolClass;

            if ( state.backtracking==0 ) { toolClass = new ToolClass((IDENTIFIER28!=null?IDENTIFIER28.getText():null));}

            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:331:5: ( isMappedClass )?
            int alt26=2;
            int LA26_0 = input.LA(1);

            if ( (LA26_0==MAPPED) ) {
                alt26=1;
            }
            switch (alt26) {
                case 1 :
                    // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:331:6: isMappedClass
                    {
                    pushFollow(FOLLOW_isMappedClass_in_classDeclaration1102);
                    isMappedClass29=isMappedClass();

                    state._fsp--;
                    if (state.failed) return toolClass;

                    if ( state.backtracking==0 ) { toolClass.setMapped(Boolean.parseBoolean((isMappedClass29!=null?(input.getTokenStream().toString(input.getTreeAdaptor().getTokenStartIndex(isMappedClass29.start),input.getTreeAdaptor().getTokenStopIndex(isMappedClass29.start))):null)));}

                    }
                    break;

            }


            pushFollow(FOLLOW_qualifiedType_in_classDeclaration1119);
            superT=qualifiedType();

            state._fsp--;
            if (state.failed) return toolClass;

            if ( state.backtracking==0 ) { toolClass.setSuperClass((superT!=null?(input.getTokenStream().toString(input.getTreeAdaptor().getTokenStartIndex(superT.start),input.getTreeAdaptor().getTokenStopIndex(superT.start))):null));}

            // /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:335:5: ( cEnum )*
            loop27:
            do {
                int alt27=2;
View Full Code Here

        String cdfName = cex.getName().replace("cex", "cdf");
        //find the containing folder
        IFolder folder = (IFolder)cex.getParent();
        //find the dcdf file
        IFile cdf = (IFile)folder.findMember(cdfName);
        ToolClass toolClass = ToolClass.fetch(cdf);
        if (action.getId().equalsIgnoreCase(SUPER_CDF_ID)){
          toolClass = toolClass.getToolSuperClass();
        }
        showInEditor(toolClass);
    }
  }
View Full Code Here

    walker.component_definition();
    return walker.getNumberOfSyntaxErrors();

  }
  private int parseUsingCDFTree(CommonTree tree, TokenStream tokens, String name) throws RecognitionException{
    ToolClass cls = new ToolClass(name);
    CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
    nodes.setTokenStream(tokens);
    ForteCDFTree walker = new ForteCDFTree(cls, nodes);
    walker.classDeclaration();
    return walker.getNumberOfSyntaxErrors();
View Full Code Here

      if (obj instanceof IResource) {
        IContainer container;
        if ((obj instanceof IFolder)
            && (ToolProjectSupport.isPlanFolder((IFolder)obj))){
          this.plan = ToolProjectSupport.getPlanFromFolder((IFolder)obj);
          this.cls = new ToolClass(this.plan, false);
          container = (IFolder) obj;
          projectText.setText(container.getFullPath().toString());
        }
      }
    }
View Full Code Here

        }
        String classFileName = memento.getString(TAG_CLASS_FILE);
        IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(
                new Path(classFileName));
        if (file != null) {
          ToolClass cls = ToolClass.fetch(file);
          ToolMethod method = cls.findMethod(methodName);
            return new MethodEditorInput(method);
        }
        return null;
  }
View Full Code Here

        }
        return null;
  }
  public static void saveState(IMemento memento, MethodEditorInput input) {
        ToolMethod method = input.getMethod();
        ToolClass cls = ((ToolClass)method.getParent());
        memento.putString(TAG_METHOD_NAME, method.getLabelText());
        memento.putString(TAG_CLASS_FILE, cls.getFile().getFullPath().toString());
    }
View Full Code Here

    tree = (CommonTree) result.getTree();
    printTree(tree, 0);
    CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree);
    nodes.setTokenStream(tokens);
    ForteCDFTree walker = new ForteCDFTree(nodes);
    ToolClass toolClass = walker.classDeclaration().toolClass;
    if (toolClass != null)
      System.out.println("Class: " + toolClass.getToolName());

  }
View Full Code Here

    public void init(IEditorSite site, IEditorInput editorInput) {
        super.init(site, editorInput);
       
        IFileEditorInput ifei = (IFileEditorInput)editorInput;
        IFile modelFile = ifei.getFile();
        ToolClass cdf = ToolClass.fetch(modelFile);
        this.setCdf(cdf);
        setPartName(cdf.getToolName());
    }
View Full Code Here

TOP

Related Classes of tool.model.ToolClass

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.