diff options
-rw-r--r-- | libraries/libLSL/lsl.cs | 8 | ||||
-rw-r--r-- | libraries/libLSL/lslByteCode.cs | 39 |
2 files changed, 43 insertions, 4 deletions
diff --git a/libraries/libLSL/lsl.cs b/libraries/libLSL/lsl.cs index e84c2bf..37a6429 100644 --- a/libraries/libLSL/lsl.cs +++ b/libraries/libLSL/lsl.cs | |||
@@ -6,7 +6,7 @@ namespace libLSL | |||
6 | { | 6 | { |
7 | 7 | ||
8 | 8 | ||
9 | enum lslVarType | 9 | enum lslVarType : byte |
10 | { | 10 | { |
11 | VARTYPE_VOID = 0, | 11 | VARTYPE_VOID = 0, |
12 | VARTYPE_INTEGER = 1, | 12 | VARTYPE_INTEGER = 1, |
@@ -18,7 +18,7 @@ namespace libLSL | |||
18 | VARTYPE_LIST = 7 | 18 | VARTYPE_LIST = 7 |
19 | } | 19 | } |
20 | 20 | ||
21 | enum lslEventType | 21 | enum lslEventType : byte |
22 | { | 22 | { |
23 | EVENT_STATE_ENTRY = 0, | 23 | EVENT_STATE_ENTRY = 0, |
24 | EVENT_STATE_EXIT = 1, | 24 | EVENT_STATE_EXIT = 1, |
@@ -55,7 +55,7 @@ namespace libLSL | |||
55 | EVENT_HTTP_RESPONSE = 32 | 55 | EVENT_HTTP_RESPONSE = 32 |
56 | } | 56 | } |
57 | 57 | ||
58 | enum lslOpcodes | 58 | enum lslOpcodes : byte |
59 | { | 59 | { |
60 | // No Operation | 60 | // No Operation |
61 | OP_NOOP = 0x00, | 61 | OP_NOOP = 0x00, |
@@ -319,7 +319,7 @@ namespace libLSL | |||
319 | class lslCodeChunk | 319 | class lslCodeChunk |
320 | { | 320 | { |
321 | lslCodeChunkHeader header; | 321 | lslCodeChunkHeader header; |
322 | byte[] bytecode; | 322 | lslByteCode bytecode; |
323 | 323 | ||
324 | public void readFromBytes(byte[] data) | 324 | public void readFromBytes(byte[] data) |
325 | { | 325 | { |
diff --git a/libraries/libLSL/lslByteCode.cs b/libraries/libLSL/lslByteCode.cs new file mode 100644 index 0000000..eb98773 --- /dev/null +++ b/libraries/libLSL/lslByteCode.cs | |||
@@ -0,0 +1,39 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace libLSL | ||
6 | { | ||
7 | class lslByteCode | ||
8 | { | ||
9 | byte[] bytecode; | ||
10 | |||
11 | public void executeStep() | ||
12 | { | ||
13 | byte ins = nextInstruction(); | ||
14 | lslOpcodes code = (lslOpcodes)ins; | ||
15 | |||
16 | switch (code) | ||
17 | { | ||
18 | case lslOpcodes.OP_NOOP: | ||
19 | break; | ||
20 | case lslOpcodes.OP_POP: | ||
21 | popBytes(4); | ||
22 | break; | ||
23 | |||
24 | default: | ||
25 | break; | ||
26 | } | ||
27 | } | ||
28 | |||
29 | byte nextInstruction() | ||
30 | { | ||
31 | return 0; | ||
32 | } | ||
33 | |||
34 | void popBytes(int num) | ||
35 | { | ||
36 | |||
37 | } | ||
38 | } | ||
39 | } | ||