Package lombok.ast

Examples of lombok.ast.UnaryExpression.astOperator()


    }
   
    @Override public void visitUnary(JCUnary node) {
      UnaryExpression expr = new UnaryExpression();
      expr.rawOperand(toTree(node.getExpression()));
      expr.astOperator(JcTreeBuilder.UNARY_OPERATORS.inverse().get(getTag(node)));
      set(node, expr);
    }
   
    @Override public void visitBinary(JCBinary node) {
      BinaryExpression expr = new BinaryExpression();
View Full Code Here


    } else {
      if (symbol != null) symbol = symbol.trim();
      if (!symbol.isEmpty()) {
        UnaryOperator op = UnaryOperator.fromSymbol(symbol, false);
        UnaryExpression expr = new UnaryExpression().rawOperand(operand);
        if (op != null) expr.astOperator(op);
        return posify(expr);
      }
    }
   
    return operand;
View Full Code Here

        symbol = symbol.trim();
        if (symbol.isEmpty()) continue;
       
        UnaryOperator op = UnaryOperator.fromSymbol(symbol, false);
        UnaryExpression expr = new UnaryExpression().rawOperand(current);
        if (op != null) expr.astOperator(op);
        current = expr;
      }
     
      if (prev != null && !prev.getPosition().isUnplaced() && prev != current && current != null) {
        positionSpan(current, operator, operand);
View Full Code Here

    assertFalse("raw value starts with -", n.rawValue().startsWith("-"));
    assertNotNull(n.getErrorReasonForValue());
   
    UnaryExpression unary = new UnaryExpression().astOperand(n);
    assertNotNull(n.getErrorReasonForValue());
    unary.astOperator(UnaryOperator.UNARY_MINUS);
    assertNull(n.getErrorReasonForValue());
    n.astParensPositions().add(Position.UNPLACED);
    assertNotNull(n.getErrorReasonForValue());
  }
 
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.