17 #region Private Variables
20 private List<Instruction> instructions;
21 private Dictionary<String, Function> functions;
22 private Memory scriptMemory;
26 #region Private Methods
28 private void Clean(
Operand operand)
45 nextInstruction = instructions[(int)nextInstruction.
Address + 1];
47 operand.InstructionPointer = nextInstruction;
53 #region Internal Methods
62 Clean(instruction.
First);
66 foreach (
Function function in functions.Values)
74 nextInstruction = instructions[(int)nextInstruction.
Address + 1];
76 function.EntryPoint = nextInstruction;
80 for (
int i = instructions.Count - 1; i >= 0; i--)
82 instructions.RemoveAt(i);
90 for (
int i = 0; i < instructions.Count; i++)
91 instructions[i].Address = (uint)i;
94 internal List<Instruction> InstructionsInternal
96 get {
return instructions; }
101 #region Public Methods
105 this.script = script;
107 instructions =
new List<Instruction>();
109 functions =
new Dictionary<string, Function>();
118 return functions.ContainsKey(
function);
124 #region Public Properties
131 get {
return script; }
136 get {
return instructions.AsReadOnly(); }
141 get {
return functions; }
150 if (!functions.ContainsKey(
"main"))
153 return functions[
"main"];
161 get {
return scriptMemory; }