+CInfixOperatorDeclaration = collections.namedtuple(
+ 'CInfixOperatorDeclaration',
+ [
+ 'name',
+ 'input_type',
+ 'result_type',
+ 'c_operator',
+ ],
+)
+
+INFIX_OPERATOR_TO_DECLARATION = {
+ '+': CInfixOperatorDeclaration(name='add', input_type='INTEGER', result_type='INTEGER', c_operator='+'),
+ '-': CInfixOperatorDeclaration(name='subtract', input_type='INTEGER', result_type='INTEGER', c_operator='-'),
+ '*': CInfixOperatorDeclaration(name='multiply', input_type='INTEGER', result_type='INTEGER', c_operator='*'),
+ '//': CInfixOperatorDeclaration(name='integerDivide', input_type='INTEGER', result_type='INTEGER', c_operator='/'),
+ '%': CInfixOperatorDeclaration(name='modularDivide', input_type='INTEGER', result_type='INTEGER', c_operator='%'),
+ 'and': CInfixOperatorDeclaration(name='and', input_type='BOOLEAN', result_type='BOOLEAN', c_operator='&&'),
+ 'or': CInfixOperatorDeclaration(name='or', input_type='BOOLEAN', result_type='BOOLEAN', c_operator='||'),
+}
+