Skip to content

Commit

Permalink
Start implementing converting AST to Core
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Dec 7, 2008
1 parent 3f3ec66 commit 5107995
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions XQuery/Core.pm
Expand Up @@ -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.