Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epidemian
GitHub Repository: epidemian/gravity
Path: blob/master/src/compiler/gravity_compiler.h
1214 views
1
//
2
// gravity_compiler.h
3
// gravity
4
//
5
// Created by Marco Bambini on 29/08/14.
6
// Copyright (c) 2014 CreoLabs. All rights reserved.
7
//
8
9
#ifndef __GRAVITY_COMPILER__
10
#define __GRAVITY_COMPILER__
11
12
#include "gravity_delegate.h"
13
#include "debug_macros.h"
14
#include "gravity_utils.h"
15
#include "gravity_value.h"
16
#include "gravity_ast.h"
17
18
// opaque compiler data type
19
typedef struct gravity_compiler_t gravity_compiler_t;
20
21
gravity_compiler_t *gravity_compiler_create (gravity_delegate_t *delegate);
22
gravity_closure_t *gravity_compiler_run (gravity_compiler_t *compiler, const char *source, size_t len, uint32_t fileid, bool is_static);
23
json_t *gravity_compiler_serialize (gravity_compiler_t *compiler, gravity_closure_t *closure);
24
bool gravity_compiler_serialize_infile (gravity_compiler_t *compiler, gravity_closure_t *closure, const char *path);
25
void gravity_compiler_transfer (gravity_compiler_t *compiler, gravity_vm *vm);
26
gnode_t *gravity_compiler_ast (gravity_compiler_t *compiler);
27
void gravity_compiler_free (gravity_compiler_t *compiler);
28
29
#endif
30
31