Package japa.parser.ast.type

Examples of japa.parser.ast.type.PrimitiveType


                internalType = ((ReferenceType) internalType).getType();
            }
        }

        if (internalType instanceof PrimitiveType) {
            final PrimitiveType pt = (PrimitiveType) internalType;
            if (pt.getType().equals(Primitive.Boolean)) {
                return new JavaType(Boolean.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Char)) {
                return new JavaType(Character.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Byte)) {
                return new JavaType(Byte.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Short)) {
                return new JavaType(Short.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Int)) {
                return new JavaType(Integer.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Long)) {
                return new JavaType(Long.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Float)) {
                return new JavaType(Float.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            if (pt.getType().equals(Primitive.Double)) {
                return new JavaType(Double.class.getName(), array,
                        DataType.PRIMITIVE, null, null);
            }
            throw new IllegalStateException("Unsupported primitive '"
                    + pt.getType() + "'");
        }

        if (internalType instanceof WildcardType) {
            // We only provide very primitive support for wildcard types; Roo
            // only needs metadata at the end of the day,
View Full Code Here


                "Java type must be primitive to be presented to this method");
        if (javaType.equals(JavaType.VOID_PRIMITIVE)) {
            return new VoidType();
        }
        else if (javaType.equals(JavaType.BOOLEAN_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Boolean);
        }
        else if (javaType.equals(JavaType.BYTE_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Byte);
        }
        else if (javaType.equals(JavaType.CHAR_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Char);
        }
        else if (javaType.equals(JavaType.DOUBLE_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Double);
        }
        else if (javaType.equals(JavaType.FLOAT_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Float);
        }
        else if (javaType.equals(JavaType.INT_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Int);
        }
        else if (javaType.equals(JavaType.LONG_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Long);
        }
        else if (javaType.equals(JavaType.SHORT_PRIMITIVE)) {
            return new PrimitiveType(Primitive.Short);
        }
        throw new IllegalStateException("Unknown primitive " + javaType);
    }
View Full Code Here

        return Boolean.TRUE;
    }

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

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

        return Boolean.TRUE;
    }
View Full Code Here

        }
        throw new Error("Missing return statement in function");
    }

    final public PrimitiveType PrimitiveType() throws ParseException {
        PrimitiveType ret;
        switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
            case BOOLEAN:
                jj_consume_token(BOOLEAN);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean);
                break;
            case CHAR:
                jj_consume_token(CHAR);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char);
                break;
            case BYTE:
                jj_consume_token(BYTE);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte);
                break;
            case SHORT:
                jj_consume_token(SHORT);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short);
                break;
            case INT:
                jj_consume_token(INT);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int);
                break;
            case LONG:
                jj_consume_token(LONG);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long);
                break;
            case FLOAT:
                jj_consume_token(FLOAT);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float);
                break;
            case DOUBLE:
                jj_consume_token(DOUBLE);
                ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double);
                break;
            default:
                jj_la1[56] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
View Full Code Here

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

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

    return Boolean.TRUE;
  }

  @Override public Boolean visit(final PrimitiveType n1, final Node arg) {
    final PrimitiveType n2 = (PrimitiveType) arg;

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

    return Boolean.TRUE;
  }
View Full Code Here

TOP

Related Classes of japa.parser.ast.type.PrimitiveType

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.