Examples of ASTVisitor


Examples of org.eclipse.dltk.ast.ASTVisitor

    // traverse:
    ISourceLineTracker linetracker = context.getLineTracker();
    String fileName = smod.getElementName();
    try {
      ASTVisitor visitor = new EngineAndCallCheckerVisitor(problemReporter, linetracker, fileName);
      md.traverse(visitor);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of org.eclipse.dltk.ast.ASTVisitor

      for (String dep : dependencies) {
        urls[counter] = new File(dep).toURI().toURL();
        counter++;
      }
      ClassLoader classloader = new URLClassLoader(urls);
      ASTVisitor visitor = new LanguageCheckerVisitor(problemReporter, linetracker, smod,
              classloader);
      md.traverse(visitor);
    } catch (Exception e) {
      RutaIdeUIPlugin.error(e);
    }
View Full Code Here

Examples of org.eclipse.dltk.ast.ASTVisitor

    } else if (node instanceof Block) {
      return ((Block) node).getStatements();
    } else {
      final List innerBlockStatements = new ArrayList();
      // Lets traverse to see inner blocks.
      ASTVisitor visitor = new ASTVisitor() {
        @Override
        public boolean visit(Expression s) throws Exception {
          if (s instanceof Block) {
            List tStatements = ((Block) s).getStatements();
            innerBlockStatements.addAll(tStatements);
View Full Code Here

Examples of org.eclipse.dltk.ast.ASTVisitor

    }
  }

  public static List findExtractBlocks(ASTNode node) {
    final List statements2 = new ArrayList();
    ASTVisitor visitor = new ASTVisitor() {
      @Override
      public boolean visit(Expression s) throws Exception {
        if (s instanceof Block) {
          statements2.addAll(((Block) s).getStatements());
        }
View Full Code Here

Examples of org.eclipse.dltk.ast.ASTVisitor

    if (md == null) {
      return new PairBlock[0];
    }
    final List result = new ArrayList();
    try {
      md.traverse(new ASTVisitor() {
        @Override
        public boolean visitGeneral(ASTNode node) throws Exception {
          if (node instanceof StringLiteral) {
            StringLiteral be = (StringLiteral) node;
            result.add(new PairBlock(offset + be.sourceStart(), offset + be.sourceEnd() - 1, '\"'));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {

            private Map<String, String> _imports = new HashMap<String, String>();
           
            @Override
            public void endVisit(TypeDeclaration node) {
                final ReflectionModeVisitor modeVisitor = new ReflectionModeVisitor(_imports, classname);               
                node.accept(modeVisitor);
               
                if (modeVisitor.getDelegate() != null) {
                    performPropertyParsingViaJDTAST(modeVisitor.getDelegate(), properties);
                    return;
                }
               
                if (modeVisitor.getPropertyMode() != ReflectionModeVisitor.MODE_UNKNOWN) {
                    node.accept(new ASTVisitor() {
                        @Override
                        public boolean visit(FieldDeclaration node) {
                            if (org.eclipse.jdt.core.dom.Modifier.isPublic(node.getModifiers())) {
                               
                                CodeCompletionAnnotationVisitor codeCompletion = new CodeCompletionAnnotationVisitor(_imports, classname);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

        }
        catch (IOException e) {
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {
            private Map<String, String> _imports = new HashMap<String, String>();

            @Override
            public void endVisit(ImportDeclaration node) {
                String packageName = node.getName().toString();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        parser.setSource(writer.toString().toCharArray());
        ASTNode ast = parser.createAST(new NullProgressMonitor());
        ast.accept(new ASTVisitor() {
           
            private Map<String, String> _imports = new HashMap<String, String>();

            @Override
            public void endVisit(ImportDeclaration node) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

                    _methodMode = MODE_EXCLUDE;
                    _propertyMode = MODE_INCLUDE;
                    _beanMode = BEAN_MODE_LOWERCASED;
                    _delegate = null;
                   
                    node.accept(new ASTVisitor() {                   

                        @Override
                        public void endVisit(MemberValuePair node) {
                            if (node.getName().toString().equals("methodMode")) {
                                if (node.getValue().toString().contains("MODE_EXCLUDE")) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.ASTVisitor

    */

    List<MarkerData> generateAddedMethodMarker(IJavaProject javaProject, String className, final String methodName, final Delta requiresDelta) throws JavaModelException {
        final List<MarkerData> markers = new LinkedList<MarkerData>();
        final CompilationUnit ast = createAST(javaProject, className);
        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(MethodDeclaration methodDecl) {
                String signature = ASTUtil.buildMethodSignature(methodDecl);
                if (signature.equals(methodName)) {
                    // Create the marker attribs here
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.