OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
generate_TableFunctionsFactory_init.TemplateTransformer Class Reference
+ Inheritance diagram for generate_TableFunctionsFactory_init.TemplateTransformer:
+ Collaboration diagram for generate_TableFunctionsFactory_init.TemplateTransformer:

Public Member Functions

def visit_udtf_node
 
def visit_composed_node
 
def visit_primitive_node
 
- Public Member Functions inherited from generate_TableFunctionsFactory_init.AstTransformer
def visit_udtf_node
 
def visit_composed_node
 
def visit_arg_node
 
def visit_primitive_node
 
def visit_template_node
 
def visit_annotation_node
 
- Public Member Functions inherited from generate_TableFunctionsFactory_init.AstVisitor
def visit_udtf_node
 
def visit_composed_node
 
def visit_arg_node
 
def visit_primitive_node
 
def visit_annotation_node
 
def visit_template_node
 

Public Attributes

 mapping_dict
 

Detailed Description

Expand template definition into multiple inputs

Definition at line 758 of file generate_TableFunctionsFactory_init.py.

Member Function Documentation

def generate_TableFunctionsFactory_init.TemplateTransformer.visit_composed_node (   self,
  composed_node 
)

Definition at line 782 of file generate_TableFunctionsFactory_init.py.

783  def visit_composed_node(self, composed_node):
784  typ = composed_node.type
785  typ = self.mapping_dict.get(typ, typ)
786 
787  inner = [i.accept(self) for i in composed_node.inner]
788  return composed_node.copy(typ, inner)
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_primitive_node (   self,
  primitive_node 
)

Definition at line 789 of file generate_TableFunctionsFactory_init.py.

790  def visit_primitive_node(self, primitive_node):
791  typ = primitive_node.type
792  typ = self.mapping_dict.get(typ, typ)
793  return primitive_node.copy(typ)
794 
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_udtf_node (   self,
  udtf_node 
)

Definition at line 761 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.product_dict().

762  def visit_udtf_node(self, udtf_node):
763  if not udtf_node.templates:
764  return udtf_node
765 
766  udtfs = []
767 
768  d = dict([(node.key, node.types) for node in udtf_node.templates])
769  name = udtf_node.name
770 
771  for product in product_dict(**d):
772  self.mapping_dict = product
773  inputs = [input_arg.accept(self) for input_arg in udtf_node.inputs]
774  outputs = [output_arg.accept(self) for output_arg in udtf_node.outputs]
775  udtfs.append(UdtfNode(name, inputs, outputs, udtf_node.annotations, None, udtf_node.sizer, udtf_node.line))
776  self.mapping_dict = {}
777 
778  if len(udtfs) == 1:
779  return udtfs[0]
780 
781  return udtfs

+ Here is the call graph for this function:

Member Data Documentation

generate_TableFunctionsFactory_init.TemplateTransformer.mapping_dict

Definition at line 771 of file generate_TableFunctionsFactory_init.py.


The documentation for this class was generated from the following file: