#NEWLINE# def visit_expression( self , node , children ) : #NEWLINE# #INDENT# '\n        Adds or substracts terms.\n        Term nodes will be already evaluated.\n        ' #NEWLINE# if self . debug : #NEWLINE# #INDENT# print ( 'Expression {}' . format ( children ) ) #NEWLINE# #UNINDENT# expr = children [ 0 ] #NEWLINE# for i in range ( 2 , len ( children ) , 2 ) : #NEWLINE# #INDENT# if ( i and ( children [ ( i - 1 ) ] == '-' ) ) : #NEWLINE# #INDENT# expr -= children [ i ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# expr += children [ self ] #NEWLINE# #UNINDENT# #UNINDENT# if self . debug : #NEWLINE# #INDENT# print ( 'Expression = {}' . format ( expr ) ) #NEWLINE# #UNINDENT# return expr