Permalink
Browse files

Start implementing converting AST to Core

  • Loading branch information...
1 parent 3f3ec66 commit 51079954ccfd408ed01d8f31b42393fd4a0ec112 @bacek committed Dec 7, 2008
Showing with 13 additions and 2 deletions.
  1. +13 −2 XQuery/Core.pm
View
@@ -17,8 +17,19 @@ sub create_module($module) {
create_expr($module<MainModule><QueryBody><Expr>);
};
-sub create_expr($expr) {
- XQuery::Core::Node.new();
+sub create_expr($expr, $pos = 0) {
+ return unless $expr<ExprSingle>[$pos];
+
+ my $expr_single = $expr<ExprSingle>[$pos];
+
+ # recursivly process ExprSingle.
+ create_expr_single($expr_single, create_expr($expr, ++$pos));
+};
+
+sub create_expr_single($ast, $left) {
+ XQuery::Core::FLWORExpr.new(
+ left => $left
+ );
};
# vim: ft=perl6

0 comments on commit 5107995

Please sign in to comment.