Esempio n. 1
0
 def html(self, indent):
     out = html.instruction(self.addr, 'switch ('+self.arg.html()+', '+self.jtAddr.html()+') {', '', indent)
     for (i, b) in enumerate(self.branches):
         out += html.instruction(self.addr, 'case '+operand.Constant(i).html()+':', '', indent)
         out += b.html(indent+1)
     out += html.instruction(self.addr, '}', '', indent)
     return out
Esempio n. 2
0
    def html(self, indent):
        addr = self.addr
        out = html.instruction(addr, 'if ('+self.cond.html()+') {', '', indent)

        if not self.option_a and not self.option_b:
            out += html.instruction(addr, 'WARN: empty if', '', indent)
        elif not self.option_a:
            out += self.option_b.html(indent+1)
        else:
            out += self.option_a.html(indent+1)

        if self.option_b and self.option_a:
            out += html.instruction(addr, '} else {', '', indent)
            out += self.option_b.html(indent+1)

        out += html.instruction(addr, '}', '', indent)
        return out
Esempio n. 3
0
 def html(self, indent):
     addr = "0000:0000"  # TODO: inner first addr
     out = html.instruction(addr, 'while (1) {', '', indent, self.signature())
     out += self.inner.html(indent+1)
     out += html.instruction(addr, '}', '', indent)
     return out
Esempio n. 4
0
 def html(self, indent):
     addr = "0000:0000"  # TODO: inner first addr
     out = html.instruction(addr, 'do {', '', indent, self.signature())
     out += self.inner.html(indent+1)
     out += html.instruction(addr, '} while ('+self.postcond.html()+')', '', indent)
     return out
Esempio n. 5
0
 def html(self, indent=0):
     out = ''
     operand_html = ', '.join(op.html() for op in self.operands())
     out += html.instruction(self.addr, self.name, operand_html, indent, self.signature())
     return out