Package japa.parser.ast.expr

Examples of japa.parser.ast.expr.Expression


  }

  @Override
  public Node visit(DoStmt _n, Object _arg) {
    Statement body = cloneNodes(_n.getBody(), _arg);
    Expression condition = cloneNodes(_n.getCondition(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    DoStmt r = new DoStmt(
        _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
        body, condition
View Full Code Here


  }

  @Override
  public Node visit(ForeachStmt _n, Object _arg) {
    VariableDeclarationExpr var = cloneNodes(_n.getVariable(), _arg);
    Expression iterable = cloneNodes(_n.getIterable(), _arg);
    Statement body = cloneNodes(_n.getBody(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

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

  }

  @Override
  public Node visit(ForStmt _n, Object _arg) {
    List<Expression> init = visit(_n.getInit(), _arg);
    Expression compare = cloneNodes(_n.getCompare(), _arg);
    List<Expression> update = visit(_n.getUpdate(), _arg);
    Statement body = cloneNodes(_n.getBody(), _arg);
    Comment comment = cloneNodes(_n.getComment(), _arg);

    ForStmt r = new ForStmt(
View Full Code Here

    return r;
  }

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

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

    return r;
  }

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

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

    public void thenVariableValueOfFieldInClassIsCommented(int variablePosition, int fieldPosition, int classPosition, String expectedContent) {
        TypeDeclaration classUnderTest = compilationUnit.getTypes().get(classPosition - 1);
        FieldDeclaration fieldUnderTest = (FieldDeclaration) getMemberByTypeAndPosition(classUnderTest, fieldPosition - 1,
                FieldDeclaration.class);
        VariableDeclarator variableUnderTest = fieldUnderTest.getVariables().get(variablePosition - 1);
        Expression valueUnderTest = variableUnderTest.getInit();
        Comment commentUnderTest = valueUnderTest.getComment();
        assertThat(commentUnderTest.getContent(), is(expectedContent));
    }
View Full Code Here

  private void printArguments(final List<Expression> args, final Object arg) {
    printer.print("(");
    if (args != null) {
      for (final Iterator<Expression> i = args.iterator(); i.hasNext();) {
        final Expression e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
    }
View Full Code Here

    printJavaComment(n.getComment(), arg);
    printer.print("{");
    if (n.getValues() != null) {
      printer.print(" ");
      for (final Iterator<Expression> i = n.getValues().iterator(); i.hasNext();) {
        final Expression expr = i.next();
        expr.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
      printer.print(" ");
View Full Code Here

  @Override public void visit(final ForStmt n, final Object arg) {
    printJavaComment(n.getComment(), arg);
    printer.print("for (");
    if (n.getInit() != null) {
      for (final Iterator<Expression> i = n.getInit().iterator(); i.hasNext();) {
        final Expression e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
    }
    printer.print("; ");
    if (n.getCompare() != null) {
      n.getCompare().accept(this, arg);
    }
    printer.print("; ");
    if (n.getUpdate() != null) {
      for (final Iterator<Expression> i = n.getUpdate().iterator(); i.hasNext();) {
        final Expression e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {
          printer.print(", ");
        }
      }
    }
View Full Code Here

TOP

Related Classes of japa.parser.ast.expr.Expression

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.