# Lib.Statement module

The base class for RISCV ASM statements is `Statement`. It is inherited by `Comment`, `Label` and `Instruction`. In turn, `Instruction` is inherited by `Instru3A` (for regular non-branching 3-address instructions), `AbsoluteJump` and `ConditionalJump`.

class Lib.Statement.AbsoluteJump(label: Label)

  Bases: `Instruction`

  An Absolute Jump is a specific kind of instruction

  args()
  ins: str = 'j'
  label: Label
  rename(renamer: Renamer)
  substitute(subst: Dict[Operand, Operand])
  targets() → List[Label]

class Lib.Statement.Comment(comment: str)

  Bases: `Statement`

  A comment.

  comment: str
  printIns(stream)

    Print the statement on the output. Should never be called on the base class.

class Lib.Statement.ConditionalJump(cond: Condition, op1: Operand, op2: Operand, label: Label)

  Bases: `Instruction`

  A Conditional Jump is a specific kind of instruction

  args()
  cond: Condition
  label: Label
  op1: Operand
  op2: Operand
  rename(renamer: Renamer)
  substitute(subst: Dict[Operand, Operand])

class Lib.Statement.Instru3A(ins, *args: Lib.Operands.Operand)

  Bases: `Instruction`

  args()
  rename(renamer: Renamer)
  substitute(subst: Dict[Operand, Operand])

class Lib.Statement.Instruction

  Bases: `Statement`

  args() → List[Operand]
  defined()
  ins: str
  is_read_only()

    True if the instruction only reads from its operands.

    Otherwise, the first operand is considered as the destination and others are source.

  printIns(stream)

    Print the instruction on the output.

  rename(renamer: Renamer) → None
  used()

class Lib.Statement.Label(name: str)

  Bases: `Statement`, `Operand`

  A label is both a Statement and an Operand.

  name: str
  printIns(stream)

    Print the statement on the output. Should never be called on the base class.

class Lib.Statement.Statement

  Bases: `object`

  A Statement, which is an instruction, a comment or a label.

  defined() → List[Operand]
  printIns(stream)

    Print the statement on the output. Should never be called on the base class.

  substitute(subst: Dict[Operand, Operand]) → TStatement
  used() → List[Operand]

Lib.Statement.regset_to_string(registerset)

  Utility function: pretty-prints a set of locations.