ScriptStack 1.0.0
A .NET scripting language
Lade ...
Suche ...
Keine Treffer
ScriptStack.Runtime.Executable Klassenreferenz

Öffentliche Methoden

 Executable (Script script)
 
bool FunctionExists (string function)
 

Propertys

Script Script [get]
 
ReadOnlyCollection< InstructionRunnable [get]
 
Dictionary< String, FunctionFunctions [get]
 
Function MainFunction [get]
 
Memory ScriptMemory [get]
 

Private Methoden

void Clean (Operand operand)
 

Private Attribute

Script script
 
List< Instructioninstructions
 
Dictionary< String, Functionfunctions
 
Memory scriptMemory
 

Beschreibung der Konstruktoren und Destruktoren

◆ Executable()

ScriptStack.Runtime.Executable.Executable ( Script script)
103 {
104
105 this.script = script;
106
107 instructions = new List<Instruction>();
108
109 functions = new Dictionary<string, Function>();
110
112
113 }
Memory SharedMemory
Definition Manager.cs:238
Dictionary< String, Function > functions
Definition Executable.cs:21
Script script
Definition Executable.cs:19
List< Instruction > instructions
Definition Executable.cs:20
Memory scriptMemory
Definition Executable.cs:22
static Memory AllocateScriptMemory(Memory sharedMemory)
Definition Memory.cs:60
Manager Manager
Definition Script.cs:154

Benutzt ScriptStack.Runtime.Memory.AllocateScriptMemory(), ScriptStack.Runtime.Executable.functions, ScriptStack.Runtime.Executable.instructions, ScriptStack.Runtime.Script.Manager, ScriptStack.Runtime.Executable.script, ScriptStack.Runtime.Executable.scriptMemory und ScriptStack.Manager.SharedMemory.

Dokumentation der Elementfunktionen

◆ Clean()

void ScriptStack.Runtime.Executable.Clean ( Operand operand)
private
29 {
30
31 if (operand == null)
32 return;
33
34 if (operand.Type != OperandType.InstructionPointer)
35 return;
36
37 Instruction instruction = operand.InstructionPointer;
38
39 if (instruction.OpCode != OpCode.NOP && instruction.OpCode != OpCode.DBG)
40 return;
41
42 Instruction nextInstruction = instruction;
43
44 while (nextInstruction.OpCode == OpCode.NOP || nextInstruction.OpCode == OpCode.DBG)
45 nextInstruction = instructions[(int)nextInstruction.Address + 1];
46
47 operand.InstructionPointer = nextInstruction;
48
49 }
OperandType
Definition Operand.cs:12
OpCode
Definition Opcode.cs:9

Benutzt ScriptStack.Runtime.Instruction.Address, ScriptStack.Runtime.Operand.InstructionPointer, ScriptStack.Runtime.Executable.instructions, ScriptStack.Runtime.Instruction.OpCode und ScriptStack.Runtime.Operand.Type.

Wird benutzt von ScriptStack.Compiler.Parser.Parse().

◆ FunctionExists()

bool ScriptStack.Runtime.Executable.FunctionExists ( string function)
116 {
117
118 return functions.ContainsKey(function);
119
120 }

Benutzt ScriptStack.Runtime.Executable.functions.

Wird benutzt von ScriptStack.Runtime.Script.EntryPoint().

Dokumentation der Datenelemente

◆ functions

Dictionary<String, Function> ScriptStack.Runtime.Executable.functions
private

◆ instructions

List<Instruction> ScriptStack.Runtime.Executable.instructions
private

◆ script

Script ScriptStack.Runtime.Executable.script
private

◆ scriptMemory

Memory ScriptStack.Runtime.Executable.scriptMemory
private

Dokumentation der Propertys

◆ Functions

Dictionary<String, Function> ScriptStack.Runtime.Executable.Functions
get

◆ MainFunction

Function ScriptStack.Runtime.Executable.MainFunction
get
142 {
143
144 get
145 {
146
147 if (!functions.ContainsKey("main"))
148 throw new ParserException("Das Script hat keinen Einstiegspunkt.");
149
150 return functions["main"];
151
152 }
153
154 }
Definition ParserException.cs:11

◆ Runnable

ReadOnlyCollection<Instruction> ScriptStack.Runtime.Executable.Runnable
get
132 {
133 get { return instructions.AsReadOnly(); }
134 }

◆ Script

Script ScriptStack.Runtime.Executable.Script
get

◆ ScriptMemory


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: