Package xbird.xquery.type

Examples of xbird.xquery.type.Type


            qnameItor.closeQuietly();
            reportError("err:XPTY0004", "Conversion of the atomized name expression to an expanded QName was not successful.");
        }
        qnameItor.closeQuietly();
        final QualifiedName namev;
        final Type t = it.getType();
        if(TypeUtil.subtypeOf(t, QNameType.QNAME)) {
            final QNameValue qname = ((AtomicValue) it).castAs(QNameType.QNAME, dynEnv);
            namev = qname.getValue();
        } else if(TypeUtil.subtypeOf(t, StringType.STRING) || t == UntypedAtomicType.UNTYPED_ATOMIC) {
            final StaticContext sc = dynEnv.getStaticContext();
View Full Code Here


    public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
        if(!_analyzed) {
            this._analyzed = true;
            this._operandExpr = _operandExpr.staticAnalysis(statEnv);
            final Type oprType = _operandExpr.getType();
            Type retType = null;
            Type lastMatchedType = null;
            CaseClause lastCC = null;
            for(CaseClause cc : _caseClauses) {
                cc.staticAnalysis(statEnv);
                if(cc != _defaultClause) {
                    final Type caseType = cc.getVariable().getType();
                    if(oprType == caseType) {
                        lastCC = cc;
                        break;
                    } else if(TypeUtil.subtypeOf(oprType, caseType)) {
                        if(lastMatchedType == null || TypeUtil.subtypeOf(caseType, lastMatchedType)) {
View Full Code Here

    public Sequence<? extends Item> eval(Sequence<? extends Item> contextSeq, DynamicContext dynEnv)
            throws XQueryException {
        final Sequence<? extends Item> opr = _operandExpr.eval(contextSeq, dynEnv);
        for(CaseClause cc : _caseClauses) {
            final CaseVariable cv = cc.getVariable();
            final Type ccType = cv.getType();
            if(TypeUtil.instanceOf(opr, ccType)) {
                cv.allocateResult(opr, dynEnv);
                final XQExpression ccExpr = cc.getReturnExpr();
                return ccExpr.eval(contextSeq, dynEnv);
            }
View Full Code Here

    public void evalAsEvents(XQEventReceiver handler, Sequence<? extends Item> contextSeq, DynamicContext dynEnv)
            throws XQueryException {
        final Sequence<? extends Item> opr = _operandExpr.eval(contextSeq, dynEnv);
        for(CaseClause cc : _caseClauses) {
            final CaseVariable cv = cc.getVariable();
            final Type ccType = cv.getType();
            if(TypeUtil.instanceOf(opr, ccType)) {
                cv.allocateResult(opr, dynEnv);
                final XQExpression ccExpr = cc.getReturnExpr();
                ccExpr.evalAsEvents(handler, contextSeq, dynEnv);
                return;
View Full Code Here

    public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
        if(!_analyzed) {
            this._analyzed = true;
            this.expr = expr.staticAnalysis(statEnv);
            final Type t = expr.getType();
            if(t == Untyped.UNTYPED) {
                return this;
            }
            if(TypeUtil.subtypeOf(t, testType)) {
                return new LiteralExpr(BooleanValue.TRUE);
View Full Code Here

    @Override
    public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
        if(!_analyzed) {
            this._analyzed = true;
            this._inputExpr = _inputExpr.staticAnalysis(statEnv);
            final Type exprType = _inputExpr.getType();
            if(TypeUtil.subtypeOf(exprType, _targetType)) {
                return _inputExpr;
            }
            this._type = _targetType;
        }
View Full Code Here

     TODO: err:XPTY0004, err:XQST0054, err:XP0006
     ************************************************************************/
    final public void parseVarDecl() throws ParseException, XQueryException {
        final QualifiedName varName;
        Type varType = null;
        XQExpression valueExpr = null;
        boolean isExternal = false;
        currentToken = jj_consume_token(DefineVariable);
        // TODO spaces afrer "$"
        currentToken = jj_consume_token(VarName);
View Full Code Here

     ************************************************************************/
    final public void parseFunctionDecl() throws ParseException, XQueryException {
        final UserFunction func;
        final QualifiedName funcName;
        List<ParametricVariable> paramList = Collections.<ParametricVariable> emptyList();
        Type returnType = Untyped.UNTYPED;
        final XQExpression funcBody;
        currentModule.pushVarScope();
        currentToken = jj_consume_token(DefineFunction);
        currentToken = jj_consume_token(QNameLpar);
        funcName = QNameUtil.parse(currentToken.image.substring(0, currentToken.image.length() - 1).trim(), namespaceContext, staticContext.getDefaultFunctionNamespace());
View Full Code Here

     ************************************************************************/
    final public List<ParametricVariable> parseParamList() throws ParseException, XQueryException {
        final List<ParametricVariable> paramList = new LinkedList<ParametricVariable>();
        QualifiedName paramName;
        ParametricVariable param;
        Type paramType = null;
        currentToken = jj_consume_token(VariableIndicator);
        currentToken = jj_consume_token(VarName);
        paramName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
        param = new ParametricVariable(paramName);
        currentModule.putVariable(paramName, param);
View Full Code Here

     ************************************************************************/
    final public List<Binding> parseForClause() throws ParseException, XQueryException {
        final List<Binding> fors;
        ForClause clause;
        ForVariable var;
        Type varType = null;
        XQExpression expr;
        currentToken = jj_consume_token(ForVariable);
        currentToken = jj_consume_token(VarName);
        QualifiedName varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
        var = new ForVariable(varName);
View Full Code Here

TOP

Related Classes of xbird.xquery.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.