Skip to content
Browse files

Add temporaty evaluate into Core

  • Loading branch information...
1 parent e2e16e4 commit 2cfaa914b3d7c9d9bdce0af572745e345156ed0f @bacek committed Dec 16, 2008
Showing with 22 additions and 0 deletions.
  1. +22 −0 XQuery/Core/Nodes.pm
View
22 XQuery/Core/Nodes.pm
@@ -1,4 +1,5 @@
use v6;
+use XQuery::DynamicContext;
=begin pod
@@ -12,6 +13,10 @@ class XQuery::Core::Node {
method right { $.right };
method left { $.left };
+ method trace(@args) {
+ say 'core: '~@args;
+ };
+
method dump ( $level = 0) {
say ' ' x $level, self;
if (self.right) {
@@ -21,6 +26,13 @@ class XQuery::Core::Node {
self.left.dump($level);
}
};
+
+ # Temporary put evaluation of Core directly. In future we will emit some
+ # ExecutionTree, perl or bytecode.
+ method evaluate($dc) {
+ self.trace('module evaluate');
+ ...
+ };
};
@@ -48,6 +60,11 @@ class XQuery::Core::Node {
#[22] Expr ::= ExprSingle ("," ExprSingle)*
class XQuery::Core::Expr is XQuery::Core::Node {
has @.expr_single;
+
+ method evaluate($dc) {
+ self.trace('expr evaluate');
+
+ };
};
#[23] ExprSingle ::= FLWORExpr
@@ -195,6 +212,11 @@ class XQuery::Core::Literal is XQuery::Core::Node {
method Str {
'Literal[' ~ $.value ~ ']';
}
+
+ method evaluate($dc) {
+ self.trace('Literal evaluate');
+ $.value;
+ };
};
#[57] NumericLiteral ::= IntegerLiteral | DecimalLiteral | DoubleLiteral

0 comments on commit 2cfaa91

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