Permalink
Browse files

Rename create_foo to process_foo

  • Loading branch information...
1 parent 9bcd209 commit 8f48ef8f9dd1af3d7a073c1608d80b9d2efbd955 @bacek committed Dec 13, 2008
Showing with 52 additions and 52 deletions.
  1. +1 −1 XQuery/Core.pm
  2. +51 −51 XQuery/Core/Creator.pm
View
@@ -13,7 +13,7 @@ StaticType used during optimization phase.
=end pod
sub create($ast) {
- XQuery::Core::Creator.new().create_module($ast<Module>);
+ XQuery::Core::Creator.new().process_module($ast<Module>);
};
View
@@ -19,50 +19,50 @@ class XQuery::Core::Creator {
say ~@args if $.do_trace;
};
- method create_module($module) {
+ method process_module($module) {
self.trace('create module');
- self.create_expr($module<MainModule><QueryBody><Expr>);
+ self.process_expr($module<MainModule><QueryBody><Expr>);
};
- method create_expr($expr, $pos = 0) {
+ method process_expr($expr, $pos = 0) {
return unless $expr<ExprSingle>[$pos];
self.trace('create expr');
my $expr_single = $expr<ExprSingle>[$pos];
# recursivly process ExprSingle.
- my $res = self.create_expr_single($expr_single);
- $res.left = self.create_expr($expr, ++$pos);
+ my $res = self.process_expr_single($expr_single);
+ $res.left = self.process_expr($expr, ++$pos);
$res;
};
- method create_expr_single($ast) {
+ method process_expr_single($ast) {
self.trace('create expr_single');
=begin cut
# it doesn't work in Rakudo.
given $ast {
- when .<FLWORExpr> { create_flwor_expr($_, $left) }
- when .<QuantifiedExpr> { create_quantified_expr($_, $left) }
- when .<TypeswitchExpr> { create_typeswitch_expr($_, $left) }
- when .<IfExpr> { create_if_expr($_, $left) }
- when .<OrExpr> { create_or_expr($_, $left) }
+ when .<FLWORExpr> { process_flwor_expr($_, $left) }
+ when .<QuantifiedExpr> { process_quantified_expr($_, $left) }
+ when .<TypeswitchExpr> { process_typeswitch_expr($_, $left) }
+ when .<IfExpr> { process_if_expr($_, $left) }
+ when .<OrExpr> { process_or_expr($_, $left) }
}
=end cut
my &sub;
if ($ast<FLWORExpr>) {
- return self.create_flwor_expr($ast<FLWORExpr>);
+ return self.process_flwor_expr($ast<FLWORExpr>);
}
elsif ( $ast<QuantifiedExpr>) {
- return self.create_quantified_expr($ast<QuantifiedExpr>);
+ return self.process_quantified_expr($ast<QuantifiedExpr>);
}
elsif ( $ast<TypeswitchExpr>) {
- return self.create_typeswitch_expr($ast<TypeswitchExpr>);
+ return self.process_typeswitch_expr($ast<TypeswitchExpr>);
}
elsif ( $ast<IfExpr>) {
- return self.create_if_expr($ast<IfExpr>);
+ return self.process_if_expr($ast<IfExpr>);
}
elsif ( $ast<OrExpr> ) {
- return self.create_or_expr($ast<OrExpr>);
+ return self.process_or_expr($ast<OrExpr>);
}
die('holy shit');
@@ -71,15 +71,15 @@ class XQuery::Core::Creator {
- method create_or_expr($or, $pos = 0) {
+ method process_or_expr($or, $pos = 0) {
return unless $or<AndExpr>[$pos];
self.trace('create or_expr');
my $res;
- my $and = self.create_and_expr($or<AndExpr>[$pos]);
+ my $and = self.process_and_expr($or<AndExpr>[$pos]);
if 1 < +$or<AndExpr> && $pos == 0 {
$res = XQuery::Core::OrExpr.new();
$res.expr.push($and);
- $and.left = self.create_or_expr($or, ++$pos);
+ $and.left = self.process_or_expr($or, ++$pos);
}
else {
self.trace('shortcut OrExpr');
@@ -89,15 +89,15 @@ class XQuery::Core::Creator {
$res;
};
- method create_and_expr ($node, $pos = 0) {
+ method process_and_expr ($node, $pos = 0) {
return unless $node<ComparisonExpr>[$pos];
self.trace('create AndExpr');
my $res;
- my $c = self.create_comparision_expr($node<ComparisonExpr>[$pos]);
+ my $c = self.process_comparision_expr($node<ComparisonExpr>[$pos]);
if 1 < +$node<ComparisonExpr> && $pos == 0 {
$res = XQuery::Core::AndExpr.new();
$res.expr.push($c);
- $c.left = self.create_and_expr($node, ++$pos);
+ $c.left = self.process_and_expr($node, ++$pos);
}
else {
self.trace('shortcut AndExpr');
@@ -109,58 +109,58 @@ class XQuery::Core::Creator {
# There is no 'ComparisionExpr'. It normalized to function calls.
# TODO Implement it
- method create_comparision_expr($node) {
- self.trace('create_comparision_expr');
- self.create_range_expr($node<RangeExpr>[0]);
+ method process_comparision_expr($node) {
+ self.trace('process_comparision_expr');
+ self.process_range_expr($node<RangeExpr>[0]);
};
- method create_range_expr($node) {
- self.trace('create_range_expr');
- self.create_additive_expr($node<AdditiveExpr>[0]);
+ method process_range_expr($node) {
+ self.trace('process_range_expr');
+ self.process_additive_expr($node<AdditiveExpr>[0]);
};
- method create_additive_expr($node) {
- self.trace('create_additive_expr');
- self.create_multiplicative_expr($node<MultiplicativeExpr>[0]);
+ method process_additive_expr($node) {
+ self.trace('process_additive_expr');
+ self.process_multiplicative_expr($node<MultiplicativeExpr>[0]);
};
- method create_multiplicative_expr($node) {
- self.trace('create_multiplicative_expr');
- self.create_union_expr($node<UnionExpr>[0]);
+ method process_multiplicative_expr($node) {
+ self.trace('process_multiplicative_expr');
+ self.process_union_expr($node<UnionExpr>[0]);
};
- method create_union_expr($node) {
- self.trace('create_union_expr');
- self.create_intersect_expr($node<IntersectExceptExpr>[0]);
+ method process_union_expr($node) {
+ self.trace('process_union_expr');
+ self.process_intersect_expr($node<IntersectExceptExpr>[0]);
};
- method create_intersect_expr($node) {
- self.trace('create_intersect_expr');
- self.create_instanceof_expr($node<InstanceofExpr>[0]);
+ method process_intersect_expr($node) {
+ self.trace('process_intersect_expr');
+ self.process_instanceof_expr($node<InstanceofExpr>[0]);
};
- method create_instanceof_expr($node) {
- self.trace('create_instanceof_expr ');
- self.create_treat_expr($node<TreatExpr>);
+ method process_instanceof_expr($node) {
+ self.trace('process_instanceof_expr ');
+ self.process_treat_expr($node<TreatExpr>);
};
- method create_treat_expr($node) {
- self.trace('create_treat_expr ');
- self.create_castable_expr($node<CastableExpr>);
+ method process_treat_expr($node) {
+ self.trace('process_treat_expr ');
+ self.process_castable_expr($node<CastableExpr>);
};
- method create_castable_expr($node) {
- self.trace('create_castable_expr ');
- self.create_cast_expr($node<Cast>);
+ method process_castable_expr($node) {
+ self.trace('process_castable_expr ');
+ self.process_cast_expr($node<Cast>);
};
- method create_cast_expr($node) {
+ method process_cast_expr($node) {
XQuery::Core::Literal.new(
value => ~$node
);
};
- method create_literal($node) {
+ method process_literal($node) {
XQuery::Core::Literal.new(
value => ~$node
);

0 comments on commit 8f48ef8

Please sign in to comment.