2020-12-20 13:58:10 -05:00
|
|
|
#ifndef COMPILER_H
|
|
|
|
#define COMPILER_H
|
2020-12-31 11:39:07 -05:00
|
|
|
#include <pthread.h>
|
2020-12-21 19:56:59 -05:00
|
|
|
#include "parser-tree.h"
|
|
|
|
#include "vm-lines.h"
|
2020-12-31 11:39:07 -05:00
|
|
|
#include "compiler-scopes.h"
|
2020-12-20 13:58:10 -05:00
|
|
|
|
2020-12-31 18:02:04 -05:00
|
|
|
/* compiler
|
|
|
|
* This is the file that should be included in other modules
|
|
|
|
* that want to compile a class/program. */
|
2020-12-31 17:12:01 -05:00
|
|
|
|
2020-12-31 18:02:04 -05:00
|
|
|
struct scope;
|
2020-12-31 11:39:07 -05:00
|
|
|
typedef struct compiler {
|
2020-12-31 08:00:21 -05:00
|
|
|
pthread_mutex_t ifmutex;
|
|
|
|
pthread_mutex_t whilemutex;
|
2020-12-31 11:39:07 -05:00
|
|
|
pthread_mutex_t staticmutex;
|
2020-12-24 14:22:22 -05:00
|
|
|
CLASS* classes;
|
2020-12-31 17:12:01 -05:00
|
|
|
struct scope* globalscope;
|
2020-12-20 13:58:10 -05:00
|
|
|
} COMPILER;
|
|
|
|
|
|
|
|
COMPILER* mkcompiler(CLASS* classes);
|
2020-12-29 19:27:48 -05:00
|
|
|
LINEBLOCK* compileclass(COMPILER* c, CLASS* class);
|
2020-12-31 08:00:21 -05:00
|
|
|
void freecompiler(COMPILER* c);
|
2020-12-20 13:58:10 -05:00
|
|
|
#endif
|