can generate empty nodes

git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@141 014f5005-505e-4b48-8d0a-63407b615a7c
master
LtWorf 2009-04-30 17:10:05 +07:00
parent bc0492ef77
commit b694fdd99d
1 changed files with 3 additions and 1 deletions

@ -35,6 +35,8 @@ class node (object):
kind=None
def __init__(self,expression):
if expression==None or len(expression)==0:
return
'''Generates the tree from the tokenized expression'''
while len(expression)==1 and isinstance(expression[0],list): #We have a list, removing
expression=expression[0]
@ -177,7 +179,7 @@ if __name__=="__main__":
#a= tokenize("(a - (a b) * π a,b (a-b)) - ρ 123 (a)")
#a= tokenize(u"π a,b (a*b)")
#a=tokenize("(a-b*c)*(b-c)")
a=general_optimize("σ i==2 (σ b>5 ( σ a>2 (C))) * σ a>2 ( σ a>2 (C))")
a=general_optimize("σ i==2 (c d- b)")
#a=general_optimize("σ i==2 (σ b>5 (d))")
print a
#print node(a)