Changeset 561 for trunk/src/xmlpatterns/parser/querytransformparser.ypp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/xmlpatterns/parser/querytransformparser.ypp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 54 54 ** 55 55 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 56 ** Contact: Qt Software Information (qt-info@nokia.com) 56 ** All rights reserved. 57 ** Contact: Nokia Corporation (qt-info@nokia.com) 57 58 ** 58 59 ** This file is part of the QtXmlPatterns module of the Qt Toolkit. … … 73 74 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 74 75 ** 75 ** In addition, as a special exception, Nokia gives you certain 76 ** additional rights. These rights are described in the Nokia Qt LGPL 77 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 78 ** package. 76 ** In addition, as a special exception, Nokia gives you certain additional 77 ** rights. These rights are described in the Nokia Qt LGPL Exception 78 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 79 79 ** 80 80 ** GNU General Public License Usage … … 86 86 ** met: http://www.gnu.org/copyleft/gpl.html. 87 87 ** 88 ** If you are unsure which license is appropriate for your use, please89 ** contact the sales department at qt-sales@nokia.com.88 ** If you have questions regarding the use of this file, please contact 89 ** Nokia at qt-info@nokia.com. 90 90 ** $QT_END_LICENSE$ 91 91 ** … … 228 228 229 229 /** 230 * @internal 231 * @relates QXmlQuery 232 */ 233 typedef QFlags<QXmlQuery::QueryLanguage> QueryLanguages; 234 235 /** 230 236 * @short Flags invalid expressions and declarations in the currently 231 237 * parsed language. 232 238 * 233 * Since this grammar is used for several languages: XQuery 1.0, XSL-T 2.0 and 234 * XPath 2.0 inside XSL-T, it is the union of all the constructs in these 239 * Since this grammar is used for several languages: XQuery 1.0, XSL-T 2.0, and 240 * XPath 2.0 inside XSL-T, and field and selector patterns in W3C XML Schema's 241 * identity constraints, it is the union of all the constructs in these 235 242 * languages. However, when dealing with each language individually, we 236 243 * regularly need to disallow some expressions, such as direct element … … 243 250 * used for internal purposes. 244 251 * 245 * Hence, this function is called from each expression and declaration w hich is246 * unavailable in XPath.252 * Hence, this function is called from each expression and declaration with @p 253 * allowedLanguages stating what languages it is allowed in. 247 254 * 248 255 * If @p isInternal is @c true, no error is raised. Otherwise, if the current 249 * language is not XQuery, an error is raised.256 * language is not in @p allowedLanguages, an error is raised. 250 257 */ 251 static void disallowedConstruct(const ParserContext *const parseInfo, 252 const YYLTYPE &sourceLocator, 253 const bool isInternal = false) 258 static void allowedIn(const QueryLanguages allowedLanguages, 259 const ParserContext *const parseInfo, 260 const YYLTYPE &sourceLocator, 261 const bool isInternal = false) 254 262 { 255 if(!isInternal && parseInfo->languageAccent != QXmlQuery::XQuery10) 256 { 257 parseInfo->staticContext->error(QtXmlPatterns::tr("A construct was encountered which only is allowed in XQuery."), 263 /* We treat XPath 2.0 as a subset of XSL-T 2.0, so if XPath 2.0 is allowed 264 * and XSL-T is the language, it's ok. */ 265 if(!isInternal && 266 (!allowedLanguages.testFlag(parseInfo->languageAccent) && !(allowedLanguages.testFlag(QXmlQuery::XPath20) && parseInfo->languageAccent == QXmlQuery::XSLT20))) 267 { 268 269 QString langName; 270 271 switch(parseInfo->languageAccent) 272 { 273 case QXmlQuery::XPath20: 274 langName = QLatin1String("XPath 2.0"); 275 break; 276 case QXmlQuery::XSLT20: 277 langName = QLatin1String("XSL-T 2.0"); 278 break; 279 case QXmlQuery::XQuery10: 280 langName = QLatin1String("XQuery 1.0"); 281 break; 282 case QXmlQuery::XmlSchema11IdentityConstraintSelector: 283 langName = QtXmlPatterns::tr("W3C XML Schema identity constraint selector"); 284 break; 285 case QXmlQuery::XmlSchema11IdentityConstraintField: 286 langName = QtXmlPatterns::tr("W3C XML Schema identity constraint field"); 287 break; 288 } 289 290 parseInfo->staticContext->error(QtXmlPatterns::tr("A construct was encountered " 291 "which is disallowed in the current language(%1).").arg(langName), 258 292 ReportContext::XPST0003, 259 293 fromYYLTYPE(sourceLocator, parseInfo)); … … 837 871 const YYLTYPE &location) 838 872 { 839 parseInfo->staticContext->error(QtXmlPatterns::tr("No variable byname %1 exists")873 parseInfo->staticContext->error(QtXmlPatterns::tr("No variable with name %1 exists") 840 874 .arg(formatKeyword(parseInfo->staticContext->namePool(), variableName)), 841 875 ReportContext::XPST0008, fromYYLTYPE(location, parseInfo)); … … 1561 1595 | Prolog DefaultNamespaceDecl 1562 1596 { 1563 disallowedConstruct(parseInfo, @$);1597 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1564 1598 if(parseInfo->hasSecondPrologPart) 1565 1599 parseInfo->staticContext->error(QtXmlPatterns::tr("A default namespace declaration must occur before function, " … … 1580 1614 | Prolog Import 1581 1615 { 1582 disallowedConstruct(parseInfo, @$);1616 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1583 1617 if(parseInfo->hasSecondPrologPart) 1584 1618 parseInfo->staticContext->error(QtXmlPatterns::tr("Module imports must occur before function, " … … 1598 1632 | Prolog OptionDecl 1599 1633 { 1600 disallowedConstruct(parseInfo, @$);1634 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1601 1635 parseInfo->hasSecondPrologPart = true; 1602 1636 } … … 1706 1740 if(val->hasError()) 1707 1741 { 1708 parseInfo->staticContext->error(QtXmlPatterns::tr("The value of attribute %1 must of type %2, which %3 isn't.")1742 parseInfo->staticContext->error(QtXmlPatterns::tr("The value of attribute %1 must be of type %2, which %3 isn't.") 1709 1743 .arg(formatKeyword(QLatin1String("priority")), 1710 1744 formatType(parseInfo->staticContext->namePool(), BuiltinTypes::xsDecimal), … … 1731 1765 | DefaultCollationDecl 1732 1766 { 1733 disallowedConstruct(parseInfo, @$);1767 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1734 1768 } 1735 1769 | BaseURIDecl 1736 1770 | ConstructionDecl 1737 1771 { 1738 disallowedConstruct(parseInfo, @$);1772 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1739 1773 } 1740 1774 | OrderingModeDecl 1741 1775 { 1742 disallowedConstruct(parseInfo, @$);1776 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1743 1777 } 1744 1778 | EmptyOrderDecl 1745 1779 { 1746 disallowedConstruct(parseInfo, @$);1780 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1747 1781 } 1748 1782 | CopyNamespacesDecl … … 1756 1790 { 1757 1791 if(!$6) 1758 disallowedConstruct(parseInfo, @$);1792 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1759 1793 1760 1794 if($3 == QLatin1String("xmlns")) … … 1868 1902 OrderingModeDecl: DECLARE ORDERING OrderingMode Separator /* [14] */ 1869 1903 { 1870 disallowedConstruct(parseInfo, @$);1904 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 1871 1905 if(parseInfo->hasDeclaration(ParserContext::OrderingModeDecl)) 1872 1906 { … … 1965 1999 BaseURIDecl: DECLARE BASEURI IsInternal URILiteral Separator /* [20] */ 1966 2000 { 1967 disallowedConstruct(parseInfo, @$, $3);2001 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XSLT20), parseInfo, @$, $3); 1968 2002 if(parseInfo->hasDeclaration(ParserContext::BaseURIDecl)) 1969 2003 { … … 2027 2061 VariableValue OptionalDefaultValue Separator /* [24] */ 2028 2062 { 2029 disallowedConstruct(parseInfo, @$, $3);2063 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $3); 2030 2064 if(variableByName($5, parseInfo)) 2031 2065 { … … 2127 2161 { 2128 2162 if(!$3) 2129 disallowedConstruct(parseInfo, @$, $3);2163 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $3); 2130 2164 2131 2165 /* If FunctionBody is null, it is 'external', otherwise the value is the body. */ … … 2697 2731 LetTail /* [36] */ 2698 2732 { 2699 disallowedConstruct(parseInfo, @$, $2);2733 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $2); 2700 2734 2701 2735 Q_ASSERT(parseInfo->variables.top()->name == $4); … … 2836 2870 SomeQuantificationTail /* [X] */ 2837 2871 { 2872 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 2838 2873 $$ = create(new QuantifiedExpression($<enums.slot>8, 2839 2874 QuantifiedExpression::Some, $<expr>6, $9), @$, parseInfo); … … 2864 2899 EveryQuantificationTail /* [X] */ 2865 2900 { 2901 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 2866 2902 $$ = create(new QuantifiedExpression($<enums.slot>8, 2867 2903 QuantifiedExpression::Every, $<expr>6, $9), @$, parseInfo); … … 2917 2953 CaseClause /* [43] */ 2918 2954 { 2919 disallowedConstruct(parseInfo, @$);2955 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 2920 2956 parseInfo->typeswitchSource.pop(); 2921 2957 $$ = $6; … … 2977 3013 IfExpr: IF LPAREN Expr RPAREN THEN ExprSingle ELSE ExprSingle /* [45] */ 2978 3014 { 3015 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 2979 3016 $$ = create(new IfThenClause($3, $6, $8), @$, parseInfo); 2980 3017 } … … 2983 3020 | OrExpr OR AndExpr 2984 3021 { 3022 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 2985 3023 $$ = create(new OrExpression($1, $3), @$, parseInfo); 2986 3024 } … … 2989 3027 | AndExpr AND ComparisonExpr 2990 3028 { 3029 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 2991 3030 $$ = create(new AndExpression($1, $3), @$, parseInfo); 2992 3031 } … … 3000 3039 | AdditiveExpr TO AdditiveExpr 3001 3040 { 3041 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3002 3042 $$ = create(new RangeExpression($1, $3), @$, parseInfo); 3003 3043 } … … 3006 3046 | AdditiveExpr AdditiveOperator MultiplicativeExpr 3007 3047 { 3048 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3008 3049 $$ = create(new ArithmeticExpression($1, $2, $3), @$, parseInfo); 3009 3050 } … … 3015 3056 | MultiplicativeExpr MultiplyOperator UnionExpr 3016 3057 { 3058 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3017 3059 $$ = create(new ArithmeticExpression($1, $2, $3), @$, parseInfo); 3018 3060 } … … 3026 3068 | UnionExpr UnionOperator IntersectExceptExpr 3027 3069 { 3070 allowedIn(QueryLanguages(QXmlQuery::XQuery10 3071 | QXmlQuery::XPath20 3072 | QXmlQuery::XmlSchema11IdentityConstraintField 3073 | QXmlQuery::XmlSchema11IdentityConstraintSelector), 3074 parseInfo, @$); 3028 3075 $$ = create(new CombineNodes($1, CombineNodes::Union, $3), @$, parseInfo); 3029 3076 } … … 3032 3079 | IntersectExceptExpr IntersectOperator InstanceOfExpr 3033 3080 { 3081 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3034 3082 $$ = create(new CombineNodes($1, $2, $3), @$, parseInfo); 3035 3083 } … … 3050 3098 | TreatExpr INSTANCE OF SequenceType 3051 3099 { 3100 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3052 3101 $$ = create(new InstanceOf($1, 3053 SequenceType::Ptr($4)), @$, parseInfo);3102 SequenceType::Ptr($4)), @$, parseInfo); 3054 3103 } 3055 3104 … … 3057 3106 | CastableExpr TREAT AS SequenceType 3058 3107 { 3108 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3059 3109 $$ = create(new TreatAs($1, $4), @$, parseInfo); 3060 3110 } … … 3063 3113 | CastExpr CASTABLE AS SingleType 3064 3114 { 3115 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3065 3116 $$ = create(new CastableAs($1, $4), @$, parseInfo); 3066 3117 } … … 3069 3120 | UnaryExpr CAST AS SingleType 3070 3121 { 3122 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3071 3123 $$ = create(new CastAs($1, $4), @$, parseInfo); 3072 3124 } … … 3075 3127 | UnaryOperator UnaryExpr 3076 3128 { 3129 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3077 3130 $$ = create(new UnaryExpression($1, $2, parseInfo->staticContext), @$, parseInfo); 3078 3131 } … … 3093 3146 GeneralComp: RangeExpr GeneralComparisonOperator RangeExpr /* [60] */ 3094 3147 { 3148 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3095 3149 $$ = create(new GeneralComparison($1, $2, $3, parseInfo->isBackwardsCompat.top()), @$, parseInfo); 3096 3150 } … … 3126 3180 ValidateExpr: ValidationMode EnclosedExpr /* [63] */ 3127 3181 { 3128 disallowedConstruct(parseInfo, @$);3182 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 3129 3183 parseInfo->staticContext->error(QtXmlPatterns::tr("The Schema Validation Feature is not supported. " 3130 3184 "Hence, %1-expressions may not be used.") … … 3144 3198 ExtensionExpr: Pragmas EnclosedOptionalExpr /* [65] */ 3145 3199 { 3200 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 3146 3201 /* We don't support any pragmas, so we only do the 3147 3202 * necessary validation and use the fallback expression. */ … … 3172 3227 Pragma: PRAGMA_START PragmaName PragmaContents PRAGMA_END /* [66] */ 3173 3228 { 3174 disallowedConstruct(parseInfo, @$);3229 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 3175 3230 } 3176 3231 … … 3242 3297 | BASEURI StringLiteral CURLY_LBRACE Expr CURLY_RBRACE /* [X] */ 3243 3298 { 3299 allowedIn(QXmlQuery::XSLT20, parseInfo, @$); 3244 3300 Q_ASSERT(!$2.isEmpty()); 3245 3301 $$ = create(new StaticBaseURIStore($2, $4), @$, parseInfo); … … 3248 3304 | DECLARE NAMESPACE NCNAME G_EQ STRING_LITERAL CURLY_LBRACE /* [X] */ 3249 3305 { 3306 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XSLT20), parseInfo, @$); 3250 3307 parseInfo->resolvers.push(parseInfo->staticContext->namespaceBindings()); 3251 3308 const NamespaceResolver::Ptr resolver(new DelegatingNamespaceResolver(parseInfo->staticContext->namespaceBindings())); … … 3450 3507 else 3451 3508 $$ = $1; 3509 3510 switch($1) 3511 { 3512 case QXmlNodeModelIndex::AxisAttribute: 3513 { 3514 allowedIn(QueryLanguages( QXmlQuery::XPath20 3515 | QXmlQuery::XQuery10 3516 | QXmlQuery::XmlSchema11IdentityConstraintField 3517 | QXmlQuery::XSLT20), 3518 parseInfo, @$); 3519 break; 3520 } 3521 case QXmlNodeModelIndex::AxisChild: 3522 { 3523 allowedIn(QueryLanguages( QXmlQuery::XPath20 3524 | QXmlQuery::XQuery10 3525 | QXmlQuery::XmlSchema11IdentityConstraintField 3526 | QXmlQuery::XmlSchema11IdentityConstraintSelector 3527 | QXmlQuery::XSLT20), 3528 parseInfo, @$); 3529 break; 3530 } 3531 default: 3532 { 3533 allowedIn(QueryLanguages( QXmlQuery::XPath20 3534 | QXmlQuery::XQuery10 3535 | QXmlQuery::XSLT20), 3536 parseInfo, @$); 3537 } 3538 } 3452 3539 } 3453 3540 … … 3471 3558 NodeTest /* [72] */ 3472 3559 { 3560 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XSLT20 | QXmlQuery::XmlSchema11IdentityConstraintField), parseInfo, @$); 3473 3561 $$ = create(new AxisStep(QXmlNodeModelIndex::AxisAttribute, $3), @$, parseInfo); 3474 3562 … … 3500 3588 NodeTest: NameTest /* [78] */ 3501 3589 | KindTest 3590 { 3591 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3592 } 3502 3593 3503 3594 NameTest: ElementName /* [79] */ … … 3522 3613 | ANY_PREFIX 3523 3614 { 3615 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3524 3616 const QXmlName::LocalNameCode c = parseInfo->staticContext->namePool()->allocateLocalName($1); 3525 3617 $$ = LocalNameTest::create(parseInfo->nodeTestSource, c); … … 3529 3621 | FilterExpr LBRACKET Expr RBRACKET 3530 3622 { 3623 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3531 3624 $$ = create(GenericPredicate::create($1, $3, parseInfo->staticContext, fromYYLTYPE(@4, parseInfo)), @$, parseInfo); 3532 3625 } … … 3557 3650 NumericLiteral: XPATH2_NUMBER /* [86] */ 3558 3651 { 3652 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3559 3653 $$ = createNumericLiteral<Double>($1, @$, parseInfo); 3560 3654 } 3561 3655 | NUMBER 3562 3656 { 3657 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3563 3658 $$ = createNumericLiteral<Numeric>($1, @$, parseInfo); 3564 3659 } … … 3566 3661 VarRef: DOLLAR VarName /* [87] */ 3567 3662 { 3663 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3568 3664 $$ = resolveVariable($2, @$, parseInfo, false); 3569 3665 } … … 3581 3677 ParenthesizedExpr: LPAREN Expr RPAREN /* [89] */ 3582 3678 { 3679 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3583 3680 $$ = $2; 3584 3681 } 3585 3682 | LPAREN RPAREN 3586 3683 { 3684 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3587 3685 $$ = create(new EmptySequence, @$, parseInfo); 3588 3686 } … … 3600 3698 FunctionCallExpr: FunctionName LPAREN FunctionArguments RPAREN /* [93] */ 3601 3699 { 3700 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 3602 3701 if(XPathHelper::isReservedNamespace($1.namespaceURI()) || $1.namespaceURI() == StandardNamespaces::InternalXSLT) 3603 3702 { /* We got a call to a builtin function. */ … … 3642 3741 Constructor: DirectConstructor /* [94] */ 3643 3742 { 3644 disallowedConstruct(parseInfo, @$);3743 allowedIn(QXmlQuery::XQuery10, parseInfo, @$); 3645 3744 } 3646 3745 | ComputedConstructor 3746 /* The reason we cannot call alloweIn() as the action for ComputedConstructor, 3747 * is that we use the computed constructors for XSL-T, and therefore generate 3748 * INTERNAL tokens. */ 3647 3749 3648 3750 DirectConstructor: DirElemConstructor /* [95] */ … … 4076 4178 CompDocConstructor: DOCUMENT IsInternal EnclosedExpr /* [110] */ 4077 4179 { 4078 disallowedConstruct(parseInfo, @$, $2);4180 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $2); 4079 4181 4080 4182 $$ = create(new DocumentConstructor($3), @$, parseInfo); … … 4089 4191 { 4090 4192 Q_ASSERT(5); 4091 disallowedConstruct(parseInfo, @$, $2);4193 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $2); 4092 4194 4093 4195 Expression::Ptr effExpr; … … 4134 4236 EnclosedOptionalExpr /* [113] */ 4135 4237 { 4136 disallowedConstruct(parseInfo, @$, $2);4238 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $2); 4137 4239 4138 4240 const Expression::Ptr name(create(new AttributeNameValidator($3), @$, parseInfo)); … … 4151 4253 CompCommentConstructor: COMMENT IsInternal EnclosedExpr /* [115] */ 4152 4254 { 4153 disallowedConstruct(parseInfo, @$, $2);4255 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $2); 4154 4256 4155 4257 $$ = create(new CommentConstructor(createSimpleContent($3, @$, parseInfo)), @$, parseInfo); … … 4158 4260 CompPIConstructor: PROCESSING_INSTRUCTION CompPIName EnclosedOptionalExpr /* [116] */ 4159 4261 { 4160 disallowedConstruct(parseInfo, @$, $2);4262 allowedIn(QXmlQuery::XQuery10, parseInfo, @$, $2); 4161 4263 4162 4264 if($3) … … 4518 4620 4519 4621 StringLiteral: STRING_LITERAL /* [144] */ 4622 { 4623 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 4624 } 4520 4625 | XPATH2_STRING_LITERAL 4626 { 4627 allowedIn(QueryLanguages(QXmlQuery::XQuery10 | QXmlQuery::XPath20), parseInfo, @$); 4628 } 4521 4629 4522 4630 QName: QNAME /* [154] */
Note:
See TracChangeset
for help on using the changeset viewer.