%token END_TAG_START // "</". Its appearance depends on the context
%token ATT_VALUE_LITERAL
%token ELEM_CONTENT_LITERAL
+%token EXT_CONTENT
%token APOS "'"
//%token APOS2 "''"
%token QUOT //""""
{
$$ = new FunctionDeclaration (
(XmlQualifiedName) $4,
- (FunctionParamList) $6,
+ (XQueryFunctionArgumentList) $6,
(SequenceType) $9,
(EnclosedExpr) $10);
}
}
;
-OptionalParamList
+OptionalParamList // returns XQueryFunctionArgumentList
: // empty
+ {
+ $$ = new XQueryFunctionArgumentList ();
+ }
| ParamList
;
-ParamList // returns FunctionParamList
+ParamList // returns XQueryFunctionArgumentList
: Param
{
- FunctionParamList pl = new FunctionParamList ();
- pl.Add ((FunctionParam) $1);
+ XQueryFunctionArgumentList pl = new XQueryFunctionArgumentList ();
+ pl.Add ((XQueryFunctionArgument) $1);
$$ = pl;
}
| Param COMMA ParamList
{
- FunctionParamList pl = (FunctionParamList) $3;
- pl.Insert (0, (FunctionParam) $1);
+ XQueryFunctionArgumentList pl = (XQueryFunctionArgumentList) $3;
+ pl.Insert (0, (XQueryFunctionArgument) $1);
$$ = pl;
}
;
-Param // returns FunctionParam
+Param // returns XQueryFunctionArgument
: DOLLAR {
tokenizer.State = ParseState.VarName;
} VarName {
tokenizer.State = ParseState.Operator;
} OptionalTypeDeclaration
{
- $$ = new FunctionParam ((XmlQualifiedName) $3, (SequenceType) $5);
+ $$ = new XQueryFunctionArgument ((XmlQualifiedName) $3, (SequenceType) $5);
}
;
} ExprSingle
{
ForLetClauseCollection col = (ForLetClauseCollection) $1;
- $$ = new FLWORExpr (col, (ExprSequence) $2, (OrderSpecList) $3, (ExprSingle) $5);
+ $$ = new FLWORExpr (col, (ExprSequence) $2, (OrderSpecList) $3, (ExprSingle) $6);
}
;
tokenizer.State = ParseState.Default;
} AdditiveExpr
{
- $$ = new ArithmeticOperationExpr ((ExprSingle) $1, (ExprSingle) $4, ArithmeticOperator.Plus);
+ $$ = new ArithmeticOperationExpr ((ExprSingle) $1, (ExprSingle) $4, ArithmeticOperator.Add);
}
| MultiplicativeExpr MINUS {
tokenizer.State = ParseState.Default;
} AdditiveExpr
{
- $$ = new ArithmeticOperationExpr ((ExprSingle) $1, (ExprSingle) $4, ArithmeticOperator.Minus);
+ $$ = new ArithmeticOperationExpr ((ExprSingle) $1, (ExprSingle) $4, ArithmeticOperator.Sub);
}
;
}
| Slash RelativePathExpr
{
- $$ = new PathChildExpr (new PathRootExpr (), (ExprSingle) $2);
+ $$ = new PathSlashExpr (new PathRootExpr (), (ExprSingle) $2);
}
| Slash2 RelativePathExpr
{
- $$ = new PathDescendantExpr (new PathRootExpr (), (ExprSingle) $2);
+ $$ = new PathSlash2Expr (new PathRootExpr (), (ExprSingle) $2);
}
| RelativePathExpr
;
: StepExpr
| StepExpr Slash RelativePathExpr
{
- $$ = new PathChildExpr ((ExprSingle) $1, (ExprSingle) $3);
+ $$ = new PathSlashExpr ((ExprSingle) $1, (ExprSingle) $3);
}
| StepExpr Slash2 RelativePathExpr
{
- $$ = new PathDescendantExpr ((ExprSingle) $1, (ExprSingle) $3);
+ $$ = new PathSlash2Expr ((ExprSingle) $1, (ExprSingle) $3);
}
;
AbbrevReverseStep // returns AxisStepExpr
: DOT2
{
- $$ = AxisStepExpr.ParentStep;
+ $$ = new AxisStepExpr (XPathAxis.Parent, null);
}
;
OptionalExpr
: // empty
{
- $$ = null;
+ $$ = new ExprSequence ();
}
| Expr
;
tokenizer.PushState (ParseState.Operator);
tokenizer.State = ParseState.StartTag;
// FIXME: tokenizer.Space = WhitespaceHandling.Significant;
- } QName AttributeList {
- } FollowDirElemConstructor {
+ } QName AttributeList FollowDirElemConstructor {
tokenizer.PopState ();
}
{
ElementContent // returns ExprSingle
: ELEM_CONTENT_LITERAL // including "{{", "}}" and char/predefined entities
+ {
+ $$ = new XmlTextConstructor ((string) $1);
+ }
| DirElemConstructor
| EnclosedExpr
| XmlCData