Package japa.parser.ast.comments

Examples of japa.parser.ast.comments.Comment


                }
            }
        }

        // at this point I create an ordered list of all remaining comments and children
        Comment previousComment = null;
        attributedComments = new LinkedList<Comment>();
        List<Node> childrenAndComments = new LinkedList<Node>();
        childrenAndComments.addAll(children);
        childrenAndComments.addAll(commentsToAttribute);
        sortByBeginPosition(childrenAndComments, _doNotConsiderAnnotationsAsNodeStartForCodeAttribution);

        for (Node thing : childrenAndComments){
            if (thing instanceof Comment){
                previousComment = (Comment)thing;
                if (!previousComment.isOrphan())
                {
                    previousComment = null;
                }
            } else {
                if (previousComment != null && !thing.hasComment()){
View Full Code Here


    return r;
  }

  @Override
  public Node visit(NullLiteralExpr _n, Object _arg) {
    Comment comment = cloneNodes(_n.getComment(), _arg);

    NullLiteralExpr r = new NullLiteralExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn());
    r.setComment(comment);
    return r;
  }
View Full Code Here

  @Override
  public Node visit(MethodCallExpr _n, Object _arg) {
    Expression scope = cloneNodes(_n.getScope(), _arg);
    List<Type> typeArgs = visit(_n.getTypeArgs(), _arg);
    List<Expression> args = visit(_n.getArgs(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    MethodCallExpr r = new MethodCallExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        scope, typeArgs, _n.getName(), args
    );
View Full Code Here

    return r;
  }

  @Override
  public Node visit(NameExpr _n, Object _arg) {
    Comment comment = cloneNodes(_n.getComment(), _arg);

    NameExpr r = new NameExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        _n.getName()
    );
View Full Code Here

    Expression scope = cloneNodes(_n.getScope(), _arg);
    ClassOrInterfaceType type_ = cloneNodes(_n.getType(), _arg);
    List<Type> typeArgs = visit(_n.getTypeArgs(), _arg);
    List<Expression> args = visit(_n.getArgs(), _arg);
    List<BodyDeclaration> anonymousBody = visit(_n.getAnonymousClassBody(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    ObjectCreationExpr r = new ObjectCreationExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        scope, type_, typeArgs, args, anonymousBody
    );
View Full Code Here

  }

  @Override
  public Node visit(QualifiedNameExpr _n, Object _arg) {
    NameExpr scope = cloneNodes(_n.getQualifier(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    QualifiedNameExpr r = new QualifiedNameExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        scope, _n.getName()
    );
View Full Code Here

  }

  @Override
  public Node visit(ThisExpr _n, Object _arg) {
    Expression classExpr = cloneNodes(_n.getClassExpr(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    ThisExpr r = new ThisExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        classExpr
    );
View Full Code Here

  }

  @Override
  public Node visit(SuperExpr _n, Object _arg) {
    Expression classExpr = cloneNodes(_n.getClassExpr(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    SuperExpr r = new SuperExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        classExpr
    );
View Full Code Here

  }

  @Override
  public Node visit(UnaryExpr _n, Object _arg) {
    Expression expr = cloneNodes(_n.getExpr(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    UnaryExpr r = new UnaryExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        expr, _n.getOperator()
    );
View Full Code Here

  @Override
  public Node visit(VariableDeclarationExpr _n, Object _arg) {
    List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
    Type type_ = cloneNodes(_n.getType(), _arg);
    List<VariableDeclarator> vars = visit(_n.getVars(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    VariableDeclarationExpr r = new VariableDeclarationExpr(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        _n.getModifiers(), annotations, type_, vars
    );
View Full Code Here

TOP

Related Classes of japa.parser.ast.comments.Comment

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.