Examples of ASTVisitor


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

    final Box<Boolean> is_a_test = Box.box(false);
    final Box<Boolean> is_passing_test = Box.box(false);
    final Box<Integer> failures = Box.box(0);
    final Set<String> analyses = new LinkedHashSet<String>();

    ASTVisitor annotation_visitor = new ASTVisitor() {
      // Visitor will find @PassingTest, @FailingTest, @UseAnalyses

      private Integer intValueFromBinding(IAnnotationBinding binding) {
        for (IMemberValuePairBinding pair : binding.getAllMemberValuePairs()) {
          if ("value".equals(pair.getName())) {
View Full Code Here

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

    final Box<Boolean> is_passing_test = Box.box(false);
    final Box<Integer> failures = Box.box(0);
    final Set<String> analyses = new LinkedHashSet<String>();
    final Set<TestType> tests = new LinkedHashSet<TestType>();

    ASTVisitor annotation_visitor = new ASTVisitor() {
      // Visitor will find @PassingTest, @FailingTest, @UseAnalyses, and @AnalysisTests
      // @AnalysisTests should not be used with the others!
     
      private TestType parseFailOrPassAnnotation(IAnnotationBinding binding, boolean isPass) {
        int numErrors = 0;
View Full Code Here

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

   * @see edu.cmu.cs.crystal.AbstractCrystalMethodAnalysis#analyzeMethod(org.eclipse.jdt.core.dom.MethodDeclaration)
   */
  @Override
  public void analyzeMethod(MethodDeclaration d) {
    final EclipseTAC tac = new EclipseTAC(d.resolveBinding());
    d.getBody().accept(new ASTVisitor() {

      /* (non-Javadoc)
       * @see org.eclipse.jdt.core.dom.ASTVisitor#postVisit(org.eclipse.jdt.core.dom.ASTNode)
       */
      @Override
 
View Full Code Here

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

        final CompilationUnit ast = createAST(javaProject, className);

        if (ast == null)
            return null;

        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(TypeDeclaration typeDecl) {
                ITypeBinding typeBinding = typeDecl.resolveBinding();
                if (typeBinding != null) {
                    if (typeBinding.getBinaryName().equals(className)) {
View Full Code Here

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

        final CompilationUnit ast = createAST(javaProject, className);

        if (ast == null)
            return null;

        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(MethodDeclaration methodDecl) {
                if (matches(ast, methodDecl, methodName, methodSignature)) {
                    // Create the marker attribs here
                    markerAttributes.put(IMarker.CHAR_START, methodDecl.getStartPosition());
View Full Code Here

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

    final ASTParser parser = ASTParser.newParser(AST.JLS4);
    parser.setResolveBindings(true);
    parser.setSource(JavaCore.createCompilationUnitFrom(javaFile));
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      @Override
      public boolean visit(final ClassInstanceCreation node) {
        final ITypeBinding ntb = node.resolveTypeBinding();
        final ITypeBinding nttb = node.getType().resolveBinding();
View Full Code Here

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

    final ASTParser parser = ASTParser.newParser(AST.JLS4);
    parser.setResolveBindings(true);
    parser.setSource(JavaCore.createCompilationUnitFrom(javaFile));
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      @Override
      public boolean visit(final ClassInstanceCreation node) {
        ITypeBinding ntb = node.resolveTypeBinding();
        while (ntb != null) {
View Full Code Here

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

    attributeList = "";
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(ClassContent.toCharArray());
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {
      public boolean visit(FieldDeclaration node) {
        String attr_name = "";
        List list = node.fragments();
        for(int i=0; i<list.size(); i++){
          attr_name = list.get(i).toString();
View Full Code Here

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

  private void goThroughClass(String ClassContent) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(ClassContent.toCharArray());
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {
      public boolean visit(VariableDeclarationFragment node) {
        SimpleName name = node.getName();
        addIfNotExist(name.toString(),propList);
        return false;
      }
View Full Code Here

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

   * Returns a collection of return statements withing @param methodDeclaration.
   * */
  public static Collection<ReturnStatement> findReturns(IProgressMonitor progressMonitor, MethodDeclaration methodDeclaration, JavaProject project) {
    progressMonitor.setTaskName("Looking for returns in " + methodDeclaration.getName());
    final Collection<ReturnStatement> returns = new ArrayList<ReturnStatement>();
    ASTVisitor finder = new ASTVisitor() {     
      public boolean visit(ReturnStatement node) {
        return returns.add(node);
      }
    };
   
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.