OmniSciDB  471d68cefb
 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 721 of file generate_TableFunctionsFactory_init.py.

Member Function Documentation

def generate_TableFunctionsFactory_init.TemplateTransformer.visit_composed_node (   self,
  composed_node 
)

Definition at line 745 of file generate_TableFunctionsFactory_init.py.

746  def visit_composed_node(self, composed_node):
747  typ = composed_node.type
748  typ = self.mapping_dict.get(typ, typ)
749 
750  inner = [i.accept(self) for i in composed_node.inner]
751  return composed_node.copy(typ, inner)
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_primitive_node (   self,
  primitive_node 
)

Definition at line 752 of file generate_TableFunctionsFactory_init.py.

753  def visit_primitive_node(self, primitive_node):
754  typ = primitive_node.type
755  typ = self.mapping_dict.get(typ, typ)
756  return primitive_node.copy(typ)
757 
def generate_TableFunctionsFactory_init.TemplateTransformer.visit_udtf_node (   self,
  udtf_node 
)

Definition at line 724 of file generate_TableFunctionsFactory_init.py.

References generate_TableFunctionsFactory_init.product_dict().

725  def visit_udtf_node(self, udtf_node):
726  if not udtf_node.templates:
727  return udtf_node
728 
729  udtfs = []
730 
731  d = dict([(node.key, node.types) for node in udtf_node.templates])
732  name = udtf_node.name
733 
734  for product in product_dict(**d):
735  self.mapping_dict = product
736  inputs = [input_arg.accept(self) for input_arg in udtf_node.inputs]
737  outputs = [output_arg.accept(self) for output_arg in udtf_node.outputs]
738  udtfs.append(UdtfNode(name, inputs, outputs, udtf_node.annotations, None, udtf_node.line))
739  self.mapping_dict = {}
740 
741  if len(udtfs) == 1:
742  return udtfs[0]
743 
744  return udtfs

+ Here is the call graph for this function:

Member Data Documentation

generate_TableFunctionsFactory_init.TemplateTransformer.mapping_dict

Definition at line 734 of file generate_TableFunctionsFactory_init.py.


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