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

Public Member Functions

def visit_arg_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
 

Detailed Description

* Append require annotation if range is used

Definition at line 916 of file generate_TableFunctionsFactory_init.py.

Member Function Documentation

def generate_TableFunctionsFactory_init.RangeAnnotationTransformer.visit_arg_node (   self,
  arg_node 
)

Definition at line 920 of file generate_TableFunctionsFactory_init.py.

921  def visit_arg_node(self, arg_node):
922  for ann in arg_node.annotations:
923  if ann.key == 'range':
924  name = arg_node.get_annotation('name')
925  if name is None:
926  raise TransformerException('"range" requires a named argument')
927 
928  l = ann.value
929  if len(l) == 2:
930  lo, hi = ann.value
931  value = '"{lo} <= {name} && {name} <= {hi}"'.format(lo=lo, hi=hi, name=name)
932  else:
933  raise TransformerException('"range" requires an interval. Got {l}'.format(l=l))
934  arg_node.set_annotation('require', value)
935  return arg_node
936 

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