Examples of UnaryExpr


Examples of com.github.antlrjavaparser.api.expr.UnaryExpr

            return new ArrayAttributeValue<AnnotationAttributeValue<?>>(
                    annotationName, arrayElements);
        }

        if (expression instanceof UnaryExpr) {
            final UnaryExpr castExp = (UnaryExpr) expression;
            if (castExp.getOperator() == Operator.negative) {
                String value = castExp.toString();
                value = value.toUpperCase().endsWith("L") ? value.substring(0,
                        value.length() - 1) : value;
                final long l = new Long(value);
                return new LongAttributeValue(annotationName, l);
            }
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

            return new ArrayAttributeValue<AnnotationAttributeValue<?>>(
                    annotationName, arrayElements);
        }

        if (expression instanceof UnaryExpr) {
            final UnaryExpr castExp = (UnaryExpr) expression;
            if (castExp.getOperator() == Operator.negative) {
                String value = castExp.toString();
                value = value.toUpperCase().endsWith("L") ? value.substring(0,
                        value.length() - 1) : value;
                final long l = new Long(value);
                return new LongAttributeValue(annotationName, l);
            }
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

        return Boolean.TRUE;
    }

    public Boolean visit(UnaryExpr n1, Node arg) {
        UnaryExpr n2 = (UnaryExpr) arg;

        if (n1.getOperator() != n2.getOperator()) {
            return Boolean.FALSE;
        }

        if (!nodeEquals(n1.getExpr(), n2.getExpr())) {
            return Boolean.FALSE;
        }

        return Boolean.TRUE;
    }
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

                    if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr) ret).isMinValue()) {
                        ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn);
                    } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr) ret).isMinValue()) {
                        ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn);
                    } else {
                        ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op);
                    }
                } else {
                    ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op);
                }
                break;
            case BOOLEAN:
            case BYTE:
            case CHAR:
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

        int column;
        jj_consume_token(INCR);
        line = token.beginLine;
        column = token.beginColumn;
        ret = UnaryExpression();
        ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preIncrement);
        {
            if (true) {
                return ret;
            }
        }
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

        int column;
        jj_consume_token(DECR);
        line = token.beginLine;
        column = token.beginColumn;
        ret = UnaryExpression();
        ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preDecrement);
        {
            if (true) {
                return ret;
            }
        }
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

                        jj_la1[78] = jj_gen;
                        jj_consume_token(-1);
                        throw new ParseException();
                }
                ret = UnaryExpression();
                ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op);
                break;
            default:
                jj_la1[79] = jj_gen;
                if (jj_2_22(2147483647)) {
                    ret = CastExpression();
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

                default:
                    jj_la1[81] = jj_gen;
                    jj_consume_token(-1);
                    throw new ParseException();
            }
            ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op);
        } else {
            ;
        }
        {
            if (true) {
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

                    case RSIGNEDSHIFTASSIGN:
                    case RUNSIGNEDSHIFTASSIGN:
                        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case INCR:
                                jj_consume_token(INCR);
                                expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement);
                                break;
                            case DECR:
                                jj_consume_token(DECR);
                                expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement);
                                break;
                            case ASSIGN:
                            case PLUSASSIGN:
                            case MINUSASSIGN:
                            case STARASSIGN:
View Full Code Here

Examples of japa.parser.ast.expr.UnaryExpr

  @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()
    );
    r.setComment(comment);
    return r;
  }
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.