Exemplo n.º 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
Exemplo n.º 2
0
 def visit_comparison_operator(self, node: ParseTreeNode, children: StrMatch) -> ast.Operator:
     return ast.Operator(str(node))
Exemplo n.º 3
0
 def visit_bitwise_operator(self, node: ParseTreeNode, children: StrMatch) -> ast.Operator:
     return ast.Operator(str(node))
Exemplo n.º 4
0
 def visit_mathematical_operator(self, node: ParseTreeNode, children: StrMatch) -> ast.Operator:
     return ast.Operator(str(node))
Exemplo n.º 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]]