12 #include "pl0_bison.h"
32 [ePl0TagValues] = const_count + global_count,
33 [ePl0TagProcs] = proc_count,
34 [ePl0TagImportedValues] = 64,
35 [ePl0TagImportedProcs] = 64
41 static const char *
const kLangNames[] =
CT_LANG_EXTS(
"pl",
"pl0");
51 #define DECL_TAG(id, init, str) [id] = (str),
61 .author =
"Elliot Haisley",
62 .desc =
"PL/0 language driver",
74 .ast_size =
sizeof(
pl0_t),
80 .fn_postparse = pl0_postparse,
81 .scanner = &kCallbacks,
#define CT_TEXT_VIEW(str)
create a text view from a string literal
CT_NODISCARD CT_PUREFN CT_SCAN_API const char * scan_path(const scan_t *scan)
get the path of a scanner
CT_BROKER_API void lang_add_unit(language_runtime_t *runtime, unit_id_t id, const node_t *node, void *ast, const size_t *sizes, size_t count)
all runtime apis
#define CT_LANG_EXTS(...)
CT_BROKER_API text_view_t build_unit_id(const vector_t *parts, arena_t *arena)
#define CT_NEW_VERSION(major, minor, patch)
creates a new ctu_version_t from major, minor and patch
#define CT_LANG_EXPORT(mod)
declares the entry point for a language driver module
#define CTASSERT(expr)
assert a condition, prints the condition as a message
CT_NODISCARD CT_STD_API char * str_basename(const char *path, arena_t *arena)
get the filename from a path
CT_NODISCARD CT_STD_API vector_t * vector_init(void *value, arena_t *arena)
create a new vector with a single initial value
CT_NODISCARD CT_PUREFN CT_STD_API size_t vector_len(const vector_t *vector)
get the length of a vector
CT_CALLBACKS(kCallbacks, ctu)
CT_DRIVER_API const language_t kPl0Module
void pl0_process_imports(language_runtime_t *runtime, compile_unit_t *context)
void pl0_init(language_runtime_t *runtime, tree_t *root)
void pl0_forward_decls(language_runtime_t *runtime, compile_unit_t *context)
void pl0_compile_module(language_runtime_t *runtime, compile_unit_t *context)
arena_t * arena
default memory arena
a language driver support capabilities
module_info_t info
common information about the language
const char * id
unique id for the module
a generic vector of pointers