Пример #1
0
 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;')
Пример #2
0
 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;')
Пример #3
0
 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;')
Пример #4
0
 def print(self):
     TokList.printIndent()
     print('input ', end='')
     self.idList.print()
     print(';')
Пример #5
0
 def print(self):
     TokList.printIndent()
     print('output ', end='')
     self.expr.print()
     print(';')
Пример #6
0
 def print(self):
     TokList.printIndent()
     self.id.print()
     print(':=', end='')
     self.expr.print()
     print(';')
Пример #7
0
 def print(self):
     TokList.printIndent()
     self.decl.print()
     print(';')
     if self.decl_seq is not None:
         self.decl_seq.print()
Пример #8
0
 def print(self):
     if self.caseLine is not None:
         print()
         TokList.printIndent()
         print('|', end='')
         self.caseLine.print()