Beispiel #1
0
 def visit_inequality_sequence(self, node: ParseTreeNode, children: Tuple[ast.Value, ...]
                               ) -> OperatorSequence:
     res: OperatorSequence = [children[0], ast.Operator('!='), children[1]]
     i: int = 2
     while i < len(children):
         res += [ast.Operator('&&'), children[0], ast.Operator('!='), children[i]]
         i += 1
     return res
Beispiel #2
0
 def visit_comparison_operator(self, node: ParseTreeNode, children: StrMatch) -> ast.Operator:
     return ast.Operator(str(node))
Beispiel #3
0
 def visit_bitwise_operator(self, node: ParseTreeNode, children: StrMatch) -> ast.Operator:
     return ast.Operator(str(node))
Beispiel #4
0
 def visit_mathematical_operator(self, node: ParseTreeNode, children: StrMatch) -> ast.Operator:
     return ast.Operator(str(node))
Beispiel #5
0
 def visit_greater_than_sequence(self, node: ParseTreeNode, children: ComparisonSequence
                                 ) -> OperatorSequence:
     return [children[0], ast.Operator(str(children[1])), children[2], ast.Operator('&&'),
             children[2], ast.Operator(str(children[3])), children[4]]