def setUp(self):
     self.macros = preprocessing_parser.Macros(config_flags={})
     self.macro_expander = macro_expander.MacroParser(self.macros)
     self.expression_parser = expression_parser.ExpressionParser()
     self.expression_evaluator = (
         macro_expression_evaluator_visitor.MacroExpressionEvaluatorVisitor(
             self.macros))
Exemple #2
0
    def setUp(self):
        self.type_manager = type_manager_module.TypeManager()
        self.parser = expression_parser.ExpressionParser(
            type_manager=self.type_manager)

        self.unary_operators = '+', '-', '!', '~'
        self.binary_operators = (
            '*',
            '/',
            '%',
            '+',
            '-',
            '<<',
            '>>',
            '<',
            '<=',
            '>',
            '>=',
            '==',
            '!=',
            '&',
            '^',
            '|',
            '&&',
            '||',
        )
Exemple #3
0
 def __init__(self, macros, progress_cb=None):
     self.progress_cb = progress_cb or (lambda *_: None)
     self._macros = macros
     # Ensure that the macro expander produces output suitable to evaluation.
     self._macro_expander = macro_expander.MacroParser(macros,
                                                       progress_cb=None)
     self._expression_parser = expression_parser.ExpressionParser()
     self._expression_evaluator = (macro_expression_evaluator_visitor.
                                   MacroExpressionEvaluatorVisitor(macros))
Exemple #4
0
 def setUp(self):
     self.parser = expression_parser.ExpressionParser()
Exemple #5
0
 def __init__(self, type_manager=None):
     self.type_manager = type_manager
     self.expression_parser = expression_parser.ExpressionParser(
         type_manager=self.type_manager)
     self.parser = self._program()
     self.anonymous_id = 0