Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Start implementing converting AST to Core

  • Loading branch information...
commit 51079954ccfd408ed01d8f31b42393fd4a0ec112 1 parent 3f3ec66
Vasily Chekalkin authored December 07, 2008

Showing 1 changed file with 13 additions and 2 deletions. Show diff stats Hide diff stats

  1. 15  XQuery/Core.pm
15  XQuery/Core.pm
@@ -17,8 +17,19 @@ sub create_module($module) {
17 17
     create_expr($module<MainModule><QueryBody><Expr>);
18 18
 };
19 19
 
20  
-sub create_expr($expr) {
21  
-    XQuery::Core::Node.new();
  20
+sub create_expr($expr, $pos = 0) {
  21
+    return unless $expr<ExprSingle>[$pos];
  22
+
  23
+    my $expr_single = $expr<ExprSingle>[$pos];
  24
+    
  25
+    # recursivly process ExprSingle.
  26
+    create_expr_single($expr_single, create_expr($expr, ++$pos));
  27
+};
  28
+
  29
+sub create_expr_single($ast, $left) {
  30
+    XQuery::Core::FLWORExpr.new(
  31
+        left => $left
  32
+    );
22 33
 };
23 34
 
24 35
 # vim: ft=perl6

0 notes on commit 5107995

Please sign in to comment.
Something went wrong with that request. Please try again.