public static Statement CreateStatement(Opcode opcode)
{
switch (opcode) {
case Opcode.Add: return new Add();
case Opcode.Add_IntInt: return new Add_IntInt();
case Opcode.Assign: return new Assign();
case Opcode.Branch: return new Branch();
case Opcode.BranchIfFalse: return new BranchIfFalse();
case Opcode.ConCat_StrStr: return new ConCat_StrStr();
case Opcode.DeclareParameter: return new DeclareParameter();
case Opcode.Equals_StringString: return new Equals_StringString();
case Opcode.Equals_IntInt: return new Equals_IntInt();
case Opcode.Field: return new Field();
case Opcode.FRand: return new FRand();
case Opcode.InStr: return new InStr();
case Opcode.Index: return new Index();
case Opcode.IntToString: return new IntToString();
case Opcode.Left: return new Left();
case Opcode.Len: return new Len();
case Opcode.LessThan: return new LessThan();
case Opcode.LiteralInt: return new LiteralInt();
case Opcode.LiteralIntByte: return new LiteralIntByte();
case Opcode.Local: return new Local();
case Opcode.Log: return new Log();
case Opcode.LogicalAnd: return new LogicalAnd();
case Opcode.LogicalOr: return new LogicalOr();
case Opcode.Mid: return new Mid();
case Opcode.Multiply: return new Multiply();
case Opcode.NotEqual_IntInt: return new NotEqual_IntInt();
case Opcode.NotEqual_StringString: return new NotEqual_StringString();
case Opcode.Null: return new Null();
case Opcode.One: return new One();
case Opcode.PostIncrement: return new PostIncrement();
case Opcode.Return: return new Return();
//case Opcode.ReturnNothing: return new ReturnNothing();
case Opcode.Right: return new Right();
case Opcode.StringLiteralAsciiz: return new LiteralStringAsciiz();
case Opcode.Subtract: return new Subtract();
case Opcode.Subtract_IntInt: return new Subtract_IntInt();
case Opcode.Zero: return new Zero();
default: throw new Exception(String.Format("Unsupported, unimplemented, or unexisting opcode " + opcode + " ({0:X}h) encountered.", (int)opcode));
}
}