Ejemplo n.º 1
0
 def get_tuple_level_expression(self):
     if self.op.val == "-" or self.op.val == "+":
         left = self.left.get_aggr_arithmetic_expression()
         return ArithmeticExpressionUNOP(opstr_to_op(self.op.val), left)
     elif self.op.val == "not":
         left = self.left.get_aggr_arithmetic_expression()
         return LogicalExpressionUNOP(opstr_to_op(self.op.val), left)
     else:
         raise Exception("Exception: math unop not supported: {}".format(
             self.op))
Ejemplo n.º 2
0
 def get_sql_arithmetic_expression(self):
     if self.op.val == "-" or self.op.val == "/" or self.op.val == "*" or self.op.val == "+":
         left = self.left.get_sql_arithmetic_expression()
         right = self.right.get_sql_arithmetic_expression()
         return ArithmeticExpressionBINOP(opstr_to_op(self.op.val), left,
                                          right)
     else:
         raise Exception("Exception: math op not supported: {}".format(
             self.op))
Ejemplo n.º 3
0
 def get_tuple_level_expression(self):
     if self.op.val == "-" or self.op.val == "/" or self.op.val == "*" or self.op.val == "+":
         left = self.left.get_tuple_level_expression()
         right = self.right.get_tuple_level_expression()
         return ArithmeticExpressionBINOP(opstr_to_op(self.op.val), left,
                                          right)
     elif self.op.val == "and" or self.op.val == "or":
         left = self.left.get_tuple_level_expression()
         right = self.right.get_tuple_level_expression()
         return LogicalExpressionBINOP(opstr_to_op(self.op.val), left,
                                       right)
     elif self.op.val == "<=" or self.op.val == ">=" or self.op.val == "=":
         left = self.left.get_tuple_level_expression()
         right = self.right.get_tuple_level_expression()
         return ComparisonExpressionBINOP(opstr_to_op(self.op.val), left,
                                          right)
     else:
         raise Exception("Exception: math op not supported: {}".format(
             self.op))