2020-12-31 17:12:01 -05:00
|
|
|
#ifndef COMPILER_UTIL_H
|
|
|
|
#define COMPILER_UTIL_H
|
|
|
|
#include "vm-lines.h"
|
|
|
|
#include "compiler-scopes.h"
|
|
|
|
#include "compiler.h"
|
|
|
|
|
2020-12-31 18:02:04 -05:00
|
|
|
/* compiler-util
|
|
|
|
* Random utilities for the compiler. */
|
|
|
|
|
2020-12-31 17:12:01 -05:00
|
|
|
#define mkln(id) mksimpleln(id, strcount(id))
|
|
|
|
|
|
|
|
LINE* onetoken(char* str);
|
|
|
|
LINE* mksimpleln(char** tokens, int count);
|
|
|
|
|
|
|
|
LINE* pushvarraw(SCOPE*s, VAR* v);
|
|
|
|
LINE* pushvar(SCOPE* s, const char* name);
|
|
|
|
LINE* popvar(SCOPE* s, const char* name);
|
|
|
|
LINE* poptemp();
|
|
|
|
LINE* popthatadd();
|
|
|
|
|
|
|
|
#endif
|