SpiderScript - Moved header to directory, ready to remove from tree
[tpg/acess2.git] / Usermode / Libraries / libspiderscript.so_src / bytecode.h
1 /*
2  * SpiderScript
3  * - Bytecode definitions
4  */
5 #ifndef _BYTECODE_H_
6 #define _BYTECODE_H_
7
8 #include "bytecode_ops.h"
9
10 #define BC_NS_SEPARATOR '@'
11
12 typedef struct sBC_Op   tBC_Op;
13 typedef struct sBC_Function     tBC_Function;
14
15 struct sBC_Op
16 {
17         tBC_Op  *Next;
18          int    Operation;
19         char    bUseInteger;    // Used for serialisation
20         char    bUseString;     // Used for serialisation
21
22         void    *CacheEnt;      // Used to runtime cache function calls
23
24         union {
25                 struct {
26                          int    Integer;
27                         char    String[];
28                 } StringInt;
29                 
30                 uint64_t        Integer;
31                 double  Real;
32         } Content;
33 };
34
35 struct sBC_Function
36 {
37          int    LabelCount;
38          int    LabelSpace;
39         tBC_Op  **Labels;
40         
41          int    MaxVariableCount;
42         // NOTE: These fields are invalid after compilation
43          int    VariableCount;
44          int    VariableSpace;
45         const char      **VariableNames;
46          int    CurContextDepth;        // Used to get the real var count
47
48          int    OperationCount;
49         tBC_Op  *Operations;
50         tBC_Op  *OperationsEnd;
51 };
52
53 #endif

UCC git Repository :: git.ucc.asn.au