reserved = ('BOOLEAN', 'CONDITIONAL', 'CONTINUE', 'DATA', 'DIMENSION',
'END', 'ENTRY', 'EXECUTE', 'EXTERNAL', 'FOR', 'FUNCTION',
'INTEGER', 'INTERNAL', 'IS', 'MODE', 'NORMAL',
- 'OF', 'PAUSE', 'PRINT_FORMAT', 'PROGRAM', 'READ_FORMAT',
+ 'OF', 'OR', 'PAUSE', 'PRINT_FORMAT', 'PROGRAM', 'READ_FORMAT',
'RESTORE', 'RETURN', 'SAVE', 'SET_LIST_TO', 'THROUGH',
'TO', 'TRANSFER', 'VALUES', 'VECTOR', 'WHENEVER',
# COMMENT is a pseudo-keyword generated early in compilation.
'NAME','INTNUM', 'DOUBLENUM', 'BOOLNUM', 'STRING', 'FUNCALL',
'LPAREN','RPAREN',
'PLUS','MINUS','TIMES','DIVIDE','EQUALS',
- 'NOT', 'OR', 'AND', 'THEN', 'EQV',
+ 'NOT', 'AND', 'THEN', 'EQV', # See above for OR
'EQ', 'NE', 'LT', 'LE', 'GT', 'GE',
'ABS', 'POW',
)
elif statement[0] == 'continue':
return "/* continue */;"
elif statement[0] in ('end_program', 'end_function', 'end_conditional'):
- return "} /* %s */" % statement[0]
+ rep = "}"
+ if mad_debug:
+ rep += " /* %s */" % statement[0]
+ return rep
elif statement[0] == 'entry':
currentfunc = statement[1]
types = typedict[currentfunc]
rep += "((%s [%d]){%s})[%s];" % (statement[3][0][0][:-3], count, ", ".join(map(lambda x: `x[1]`, statement[3])), dummy)
return rep
elif statement[0] == 'or':
- return 'else if (' + print_C_expr(statement[2]) + ') {'
+ return '} else if (' + print_C_expr(statement[1]) + ') {'
elif statement[0] == 'otherwise':
return 'else {'
elif statement[0] == 'pause':