Package com.sun.jdo.spi.persistence.support.sqlstore.query.util.type

Examples of com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.Type


      astFactory.addASTChild(currentAST, returnAST);
      currentAST = __currentAST65;
      _t = __t65;
      _t = _t.getNextSibling();
     
      Type type = t_AST.getJQLType();
      Type exprType = e_AST.getJQLType();
      if (!(type.isCompatibleWith(exprType) || exprType.isCompatibleWith(type)))
      {
      errorMsg.error(c_AST.getLine(), c_AST.getColumn(),
      I18NHelper.getMessage(messages, "jqlc.semantic.primary.invalidcast", //NOI18N
      exprType.getName(), type.getName()));
      type = typetab.errorType;
      }
      c_AST.setJQLType(type);
     
      primary_AST = (JQLAST)currentAST.root;
View Full Code Here


    currentAST = __currentAST67;
    _t = __t67;
    _t = _t.getNextSibling();
    dotExpr_AST = (JQLAST)currentAST.root;
   
    Type type = null;
    if (repr != null) // possible package name
    {
    String qualifiedName = repr + '.' + ident_AST.getText();
    type = typetab.checkType(qualifiedName);
    if (type == null)
View Full Code Here

    /**
     * Creates the CLASS_DEF AST that represents the setClass value.
     */
    public JQLAST checkCandidateClass(Class candidateClass)
    {
        Type type = typetab.checkType(candidateClass);
        if (type == null)
        {
            errorMsg.fatal(I18NHelper.getMessage(messages,
                "jqlc.semantic.checkcandidateclass.unknowntype", //NOI18N
                String.valueOf(candidateClass)));
View Full Code Here

     * @param expr the expression of an ordering definition
     */
    protected void analyseOrderingExpression(JQLAST expr)
    {
        checkValidOrderingExpr(expr);
        Type exprType = expr.getJQLType();
        if (!exprType.isOrderable())
        {
            errorMsg.error(expr.getLine(), expr.getColumn(),
                I18NHelper.getMessage(messages, "jqlc.semantic.analyseorderingexpression.notorderable", //NOI18N
                    exprType.getName()));
            expr.setJQLType(typetab.errorType);
        }
    }
View Full Code Here

     * @param args arguments (in the case of a call)
     * @return AST node representing the specialized dot expr
     */
    protected JQLAST analyseDotExpr(JQLAST dot, JQLAST expr, JQLAST ident, JQLAST args)
    {
        Type exprType = expr.getJQLType();
        String name = ident.getText();
        dot.setText(expr.getText() + '.' + name);
        if (exprType instanceof ClassType)
        {
            // left expression is of a class type
            ClassType classType = (ClassType)exprType;
            if (args == null)
            {
                // no paranethesis specified => field access
                FieldInfo fieldInfo = classType.getFieldInfo(name);
                if (fieldInfo == null)
                {
                    errorMsg.error(ident.getLine(), ident.getColumn(),
                                   I18NHelper.getMessage(messages, "jqlc.semantic.generic.unknownfield"//NOI18N
                                                         ident.getText(), exprType.getName()));
                    dot.setJQLType(typetab.errorType);
                    ident.setJQLType(typetab.errorType);
                    return dot;
                }
                else if (expr.getType() == TYPENAME)
                {
                    // access of the form: className.staticField
                    return analyseStaticFieldAccess(dot, expr, ident, classType, fieldInfo);
                }
                else
                {
                    // access of the form: object.field
                    return analyseFieldAccess(dot, expr, ident, classType, fieldInfo);
                }
            }
            else
            {
                // parenthesis specified => method call
                if (typetab.isCollectionType(exprType))
                {
                    return analyseCollectionCall(dot, expr, ident, args);
                }
                else if (exprType.equals(typetab.stringType))
                {
                    return analyseStringCall(dot, expr, ident, args);
                }
                else if (typetab.isJavaLangMathType(exprType))
                {
                    return analyseMathCall(dot, expr, ident, args);
                }
                errorMsg.error(dot.getLine(), dot.getColumn()
                               I18NHelper.getMessage(messages, "jqlc.semantic.generic.invalidmethodcall")); //NOI18N
                dot.setJQLType(typetab.errorType);
                return dot;
            }
        }
        else
        {
            errorMsg.error(expr.getLine(), expr.getColumn(),
                           I18NHelper.getMessage(messages, "jqlc.semantic.analysedotexpr.classexprexpected", //NOI18N
                                                 ident.getText(), exprType.getName()));
            dot.setJQLType(typetab.errorType);
            return dot;
        }
    }
View Full Code Here

     */
    protected JQLAST analyseFieldAccess(JQLAST access, JQLAST objectExpr, JQLAST ident,
                                        ClassType classType, FieldInfo fieldInfo)
    {
        String name = ident.getText();
        Type fieldType = fieldInfo.getType();
        if (classType.isPersistenceCapable())
        {
            if (!fieldInfo.isPersistent())
            {
                errorMsg.error(ident.getLine(), ident.getColumn()
View Full Code Here

     */
    protected JQLAST analyseStaticFieldAccess(JQLAST access, JQLAST typename, JQLAST ident,
                                              ClassType classType, FieldInfo fieldInfo)
    {
        String name = ident.getText();
        Type fieldType = fieldInfo.getType();
        if (!fieldInfo.isStatic())
        {
            errorMsg.error(ident.getLine(), ident.getColumn()
                I18NHelper.getMessage(messages, "jqlc.semantic.analysestaticfieldaccess.staticreference", //NOI18N
                    ident.getText(), classType.getName()));
View Full Code Here

     * @param def the entry in the symbol table of the type names tables
     * @return AST node representing a defined identifier
     */
    protected JQLAST analyseDefinedIdentifier(JQLAST ident, Definition def)
    {
        Type type = def.getType();
        if (def instanceof Variable)
        {
            ident.setType(VARIABLE);
        }
        else if (def instanceof Parameter)
View Full Code Here

                I18NHelper.getMessage(messages,
                    "jqlc.semantic.generic.arguments.numbermismatch")); //NOI18N
        }
        else
        {
            Type argType = firstArg.getJQLType();
            if (!argType.equals(typetab.stringType))
            {
                errorMsg.error(firstArg.getLine(), firstArg.getColumn(),
                    I18NHelper.getMessage(messages,
                        "jqlc.semantic.generic.arguments.typemismatch", //NOI18N
                        argType.getName(), typetab.stringType.getName()));
            }
        }
    }
View Full Code Here

                errorMsg.error(collection.getLine(), collection.getColumn(),
                    I18NHelper.getMessage(messages,
                        "jqlc.semantic.analysecollectioncall.relationshipexpected", //NOI18N
                        collectionFieldInfo.getName()));
            }
            Type variableType = firstArg.getJQLType();
            Type elementType = collectionFieldInfo.getAssociatedClass();
            if (!elementType.isCompatibleWith(variableType))
            {
                errorMsg.error(collection.getLine(), collection.getColumn(),
                    I18NHelper.getMessage(messages,
                        "jqlc.semantic.analysecollectioncall.typemismatch", //NOI18N
                        elementType.getName(), variableType.getName()));
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.jdo.spi.persistence.support.sqlstore.query.util.type.Type

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.