Update of /cvsroot/monetdb/pathfinder/compiler/parser
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv2478/parser

Modified Files:
      Tag: XQuery_0-16
        parser.y scanner.l 
Log Message:
Until now, document managenment functions could not be called from
user-defined functions (`docmgmt' is not a subtype of `item*').

Similar in spririt to the `declare updating function' syntax in the
W3C Update Facility, we now have the syntax extension

  declare document management function foo(...)
  {
    ...
  };

That sets the return type `docmgmt*' for the respective function.

(I have the magic ability to foresee Peter's reactions on lengthy
syntax such as `declare document management function'.  Based on my
predictive abilities, I also included the short-hand `declare
docmgmt function' for Peter's convenience. ;-))


Index: parser.y
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/parser/parser.y,v
retrieving revision 1.54.2.2
retrieving revision 1.54.2.3
diff -u -d -r1.54.2.2 -r1.54.2.3
--- parser.y    9 Feb 2007 16:01:48 -0000       1.54.2.2
+++ parser.y    14 Feb 2007 10:27:13 -0000      1.54.2.3
@@ -311,6 +311,7 @@
 %token declare_default_element         "declare default element"
 %token declare_default_function        "declare default function"
 %token declare_default_order           "declare default order"
+%token declare_docmgmt_function        "declare document management function"
 %token declare_function                "declare function"
 %token declare_updating_function       "declare updating function"
 %token declare_copy_namespaces         "declare copy-namespaces"
@@ -1268,6 +1269,28 @@
                                       = 1 | (module_base ^ (unsigned long) $$);
 #endif
                             }
+/* Pathfinder extens. */  | "declare document management function" QName_LParen
+                            OptParamList_ ")" EnclosedExpr
+                            { c = wire2 (p_fun_decl, @$,
+                                         wire2 (p_fun_sig, loc_rng (@2, @4),
+                                                $3, 
+                                                (c1 = wire1 (
+                                                       p_seq_ty, @$,
+                                                       wire1 (p_docmgmt_ty, @$,
+                                                              nil (@4))),
+                                                 c1->sem.oci = p_zero_or_more,
+                                                 c1)),
+                                         $5);
+                              c->sem.qname = $2;
+                              $$ = c;
+
+#ifdef ENABLE_MILPRINT_SUMMER
+                              num_fun++;
+                              if (module_base)
+                                  module_base
+                                      = 1 | (module_base ^ (unsigned long) $$);
+#endif
+                            }
                           ;
 
 OptParamList_             : /* empty */  { $$ = nil (@$); }

Index: scanner.l
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/parser/scanner.l,v
retrieving revision 1.43
retrieving revision 1.43.2.1
diff -u -d -r1.43 -r1.43.2.1
--- scanner.l   3 Jan 2007 12:32:58 -0000       1.43
+++ scanner.l   14 Feb 2007 10:27:13 -0000      1.43.2.1
@@ -501,6 +501,8 @@
 "declare"{_}"construction"{_}"strip" { yield (declare_construction_strip); }
 "declare"{_}"function"             { yield (declare_function); }
 "declare"{_}"updating"{_}"function" { yield (declare_updating_function); }
+"declare"{_}"document"{_}"management"{_}"function" { yield 
(declare_docmgmt_function); }
+"declare"{_}"docmgmt"{_}"function" { yield (declare_docmgmt_function); }
 "declare"{_}"option"               { yield (declare_option); }
 "declare"{_}"revalidation"{_}"strict" { yield (declare_revalidation_strict); }
 "declare"{_}"revalidation"{_}"lax"    { yield (declare_revalidation_lax); }


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to