mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Prepended file names with "toy_"
This commit is contained in:
21
source/toy_compiler.h
Normal file
21
source/toy_compiler.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "toy_common.h"
|
||||
#include "opcodes.h"
|
||||
#include "ast_node.h"
|
||||
#include "literal_array.h"
|
||||
|
||||
//the compiler takes the nodes, and turns them into sequential chunks of bytecode, saving literals to an external array
|
||||
typedef struct Compiler {
|
||||
LiteralArray literalCache;
|
||||
unsigned char* bytecode;
|
||||
int capacity;
|
||||
int count;
|
||||
} Compiler;
|
||||
|
||||
TOY_API void initCompiler(Compiler* compiler);
|
||||
TOY_API void writeCompiler(Compiler* compiler, ASTNode* node);
|
||||
TOY_API void freeCompiler(Compiler* compiler);
|
||||
|
||||
//embed the header, data section, code section, function section, etc.
|
||||
TOY_API unsigned char* collateCompiler(Compiler* compiler, int* size);
|
||||
Reference in New Issue
Block a user