Statement

To store a single line of bytecode. This is used for raw bytecode.

Constructors

this
this(string instName, string[] arguments, string comment)

constructor, for instruction + args + comment

this
this(string label, string instName, string[] arguments, string comment)

constructor, for label + instruction

Postblit

this(this)
this(this)

postblit

Members

Functions

fromString
void fromString(string statement)

Reads statement from string

toString
string toString()

Variables

arguments
string[] arguments;

arguments, if any. These are ignored if instName.length == 0

comment
string comment;

comment, if any

instName
string instName;

instruction name

label
string label;

label, if any, otherwise, null or empty string

Examples

Statement s;
s.fromString("someLabel: someInst arg1 arg2#comment");
assert(s == Statement("someLabel", "someInst", ["arg1", "arg2"]));
s.fromString("someInst arg1 # comment");
assert(s == Statement("someInst", ["arg1"]), s.toString);
s.fromString("load 0");
assert(s == Statement("load", ["0"]));

Meta