Ejemplo n.º 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;')
Ejemplo n.º 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;')
Ejemplo n.º 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;')
Ejemplo n.º 4
0
 def print(self):
     TokList.printIndent()
     print('input ', end='')
     self.idList.print()
     print(';')
Ejemplo n.º 5
0
 def print(self):
     TokList.printIndent()
     print('output ', end='')
     self.expr.print()
     print(';')
Ejemplo n.º 6
0
 def print(self):
     TokList.printIndent()
     self.id.print()
     print(':=', end='')
     self.expr.print()
     print(';')
Ejemplo n.º 7
0
 def print(self):
     TokList.printIndent()
     self.decl.print()
     print(';')
     if self.decl_seq is not None:
         self.decl_seq.print()
Ejemplo n.º 8
0
 def print(self):
     if self.caseLine is not None:
         print()
         TokList.printIndent()
         print('|', end='')
         self.caseLine.print()