Esempio n. 1
0
 def pp(self, packed=False):
   _ob = ppr.IOpenBlock()
   _cb = ppr.ICloseBlock()
   _nl = ppr.INewline()
   
   _let = ppr.IWord('letrec') if self.isRec else ppr.IWord('let')
   _in = ppr.IWord('in')
   
   _definitions = self.pp_definitions(self.deflist, packed)
   pp_expr = self.expr.pp(packed)
   return ppr.sequence(_ob, _let, _ob, _definitions, _cb, _in, pp_expr, _cb)
Esempio n. 2
0
 def pp(self, packed=False):
   _ob = ppr.IOpenBlock()
   _cb = ppr.ICloseBlock()
   
   _case = ppr.IWord('case')
   _of = ppr.IWord('of')
   _esac = ppr.IWord('esac')
   
   pp_expr = self.expr.pp(packed)
   alternatives = self.pp_alternatives(self.alts, packed)
   pp_alts = ppr.sequence(_ob, alternatives, _cb)
   return ppr.sequence(_ob, _case, pp_expr, _of, pp_alts, _esac, _cb)
Esempio n. 3
0
 def pp(self, packed=False):
   return ppr.IWord(str(self.intVal))
Esempio n. 4
0
 def pp(self, packed=False):
   return ppr.IWord(self.ident)
Esempio n. 5
0
 def pp(self, packed=False):
   _name = self.name.pp(packed)
   _eq = ppr.IWord('=')
   _val = self.val.pp(packed)
   return ppr.sequence(_name, _eq, _val)
Esempio n. 6
0
 def pp(self, packed=False):
   if len(self.pars) == 0:
     return ppr.IWord(self.name)
   else:
     parlist = [ppr.IWord(par) for par in self.pars]
     return ppr.sequence(ppr.IWord(self.name), ppr.ISequence(parlist))
Esempio n. 7
0
 def pp(self, packed=False):
   return ppr.sequence(self.lhs.pp(), ppr.IWord('='), self.expr.pp())
Esempio n. 8
0
 def pp(self, packed=False):
   return ppr.IWord('No method pp defined for ' + str(type(self)))
Esempio n. 9
0
 def pp(self, packed=False):
   tag = ppr.sequence(ppr.IStr('<'), self.tag.pp(packed), ppr.IStr('> '))
   varlist = [var.pp(packed) for var in self.vars]
   expr = self.expr.pp(packed)
   return ppr.sequence(tag, ppr.ISequence(varlist), ppr.IWord('->'), expr)