Logo Search packages:      
Sourcecode: relational version File versions  Download package

def relational::parser::node::toPython (   self  ) 

This method converts the expression into python code, which will require the
relation module to be executed.

Definition at line 88 of file parser.py.

00088                       :
        '''This method converts the expression into python code, which will require the
        relation module to be executed.'''
        if self.name in b_operators:
            return '%s.%s(%s)' % (self.left.toPython(),op_functions[self.name],self.right.toPython())
        elif self.name in u_operators:
            prop =self.prop
            
            #Converting parameters
            if self.name=='π':#Projection
                prop='\"%s\"' %  prop.replace(' ','').replace(',','\",\"')
            elif self.name=="ρ": #Rename
                prop='{\"%s\"}' % prop.replace(',','\",\"').replace('➡','\":\"').replace(' ','')
            else: #Selection
                prop='\"%s\"' %  prop
                        
            return '%s.%s(%s)' % (self.child.toPython(),op_functions[self.name],prop)
        else:
            return self.name
        pass
    def result_format(self,rels):


Generated by  Doxygen 1.6.0   Back to index