removed debug prints and corrected returning of modified nodes

git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@162 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
LtWorf
2009-05-12 08:11:45 +00:00
parent 61a94e73c0
commit e35b85e534
2 changed files with 2 additions and 7 deletions

View File

@@ -216,7 +216,7 @@ def swap_rename_select(n):
changes=0
if n.name=='σ' and n.child.name=='ρ':
changes=1
#Dictionary containing attributes of rename
_vars={}
for i in n.child.prop.split(','):
@@ -225,13 +225,11 @@ def swap_rename_select(n):
#tokenizes expression in select
_tokens=tokenize_select(n.prop)
print _tokens, _vars
#Renaming stuff
for i in range(len(_tokens)):
if _tokens[i] in _vars:
_tokens[i]=_vars[_tokens[i]]
print _tokens, _vars
n.name='ρ'
n.child.name='σ'
@@ -241,9 +239,6 @@ def swap_rename_select(n):
for i in _tokens:
n.child.prop+=i+ " "
pass
#recoursive scan
if n.kind==optimizer.UNARY:
changes+=swap_rename_select(n.child)

View File

@@ -194,7 +194,7 @@ if __name__=="__main__":
#a=tokenize("(a-b*c)*(b-c)")
#print tree("σ i==2 (c d - (aᑎb))") == tree("σ i==3 (c d - (aᑎb))")
a=general_optimize("σ age==3 and qq<=2 or nome!='ciccio d\\'urso'(ρ ciccio➡age,nome➡nom(R))")
a=general_optimize("σ age==3 and qq<=2 or nome!='ciccio d\\'urso'(ρ ciccio➡age,nome➡nom(R-Q))")
#a=general_optimize("σ i==2 (σ b>5 (d))")
print a
#print node(a)