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:
@@ -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)
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user