def print(self): TokList.printIndent() print('while ', end='') self.cond.print() print(' begin') TokList.increaseIndent() self.stmt_seq.print() TokList.decreaseIndent() TokList.printIndent() print('endwhile;')
def print(self): print("program") TokList.increaseIndent() self.decl_seq.print() TokList.decreaseIndent() print("begin") TokList.increaseIndent() self.stmt_seq.print() TokList.decreaseIndent() print("end")
def print(self): TokList.printIndent() print('if ', end='') self.cond.print() print(' then') TokList.increaseIndent() self.stmt_seq_then.print() if self.stmt_seq_else is not None: TokList.decreaseIndent() TokList.printIndent() print('else') TokList.increaseIndent() self.stmt_seq_else.print() TokList.decreaseIndent() TokList.printIndent() print('endif;')
def print(self): TokList.printIndent() print('case ', end='') self.id.print() print(' of') TokList.increaseIndent() TokList.printIndent() self.case_line.print() #Necessary for new line printings print() TokList.printIndent() print('else ', end='') self.expr.print() print() TokList.decreaseIndent() TokList.printIndent() print('end;')