52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
#ifndef VM_COMPILE_H
|
|
#define VM_COMPILE_H
|
|
#include "../common/fio.h"
|
|
#include "../common/llist.h"
|
|
#include "../common/data.h"
|
|
#include <stdio.h> // FILE
|
|
|
|
extern char* vm_datatypes[];
|
|
extern char* vm_expressions[];
|
|
extern char* vm_assignments[];
|
|
extern char* vm_operations[];
|
|
|
|
struct Table *vm_pc_globalFunctions;
|
|
struct Table *vm_pc_groupFunctions;
|
|
struct Table *vm_pc_localFunctions;
|
|
|
|
struct Table *vm_pc_globalVariables;
|
|
struct Table *vm_pc_groupVariables;
|
|
struct Table *vm_pc_localVariables;
|
|
|
|
struct vm_pc_Variable {
|
|
// ??
|
|
};
|
|
|
|
struct vm_pc_Operation {
|
|
int operation;
|
|
char *var_1;
|
|
char *var_2;
|
|
char *var_3;
|
|
char *var_4;
|
|
};
|
|
|
|
struct vm_pc_Function {
|
|
struct Table *variables;
|
|
struct Table *operations;
|
|
};
|
|
|
|
struct vm_pc_Scope {
|
|
struct Table *variables;
|
|
struct Table *functions;
|
|
};
|
|
|
|
struct vm_pc_Scope vm_pc_global_scope;
|
|
struct Table *vm_pc_group_scopes;
|
|
struct Table *vm_pc_local_scopes;
|
|
|
|
int vm_precompileFile(const char *file_name);
|
|
int vm_precompileCode(FILE *file, int *lpos_, int *cpos_, struct vm_pc_Scope *global, struct vm_pc_Scope *group, struct vm_pc_Scope *local);
|
|
int vm_isReserved(char *word);
|
|
|
|
#endif
|