From: Wolfgang M. M. <wol...@us...> - 2004-06-18 12:06:59
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10235/src/org/exist/xquery/parser Modified Files: XQuery.g Log Message: Added support for "instance of" operator. Index: XQuery.g =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/parser/XQuery.g,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** XQuery.g 19 May 2004 08:18:50 -0000 1.11 --- XQuery.g 18 Jun 2004 12:06:51 -0000 1.12 *************** *** 334,340 **** andExpr : ! castExpr ( "and"^ castExpr )* ; castExpr : --- 334,345 ---- andExpr : ! instanceofExpr ( "and"^ instanceofExpr )* ; + instanceofExpr + : + castExpr ( "instance"^ "of"! sequenceType )? + ; + castExpr : *************** *** 913,916 **** --- 918,925 ---- | "return" { name = "return"; } + | + "instance" { name = "instance"; } + | + "of" { name = "of"; } ; *************** *** 1541,1544 **** --- 1550,1567 ---- | #( + "instance" + { + PathExpr expr = new PathExpr(context); + SequenceType type= new SequenceType(); + } + step=expr [expr] + sequenceType [type] + { + step = new InstanceOfExpression(context, expr, type); + path.add(step); + } + ) + | + #( "or" { |