18 #include "obr_bison.h"
30 for (
size_t i = 0; i < len; i++)
36 [eObrTagValues] = decl_count,
37 [eObrTagTypes] = decl_count,
38 [eObrTagProcs] = decl_count,
39 [eObrTagModules] = 32,
48 #define NEW_EVENT(id, ...) const diagnostic_t kEvent_##id = __VA_ARGS__;
52 #define NEW_EVENT(id, ...) &kEvent_##id,
56 static const char *
const kLangNames[] =
CT_LANG_EXTS(
"m",
"mod",
"obr",
"oberon");
62 [eObrTagModules] = 32,
66 #define DECL_TAG(id, val, name) [id] = (name),
76 .desc =
"Oberon-2 language frontend",
77 .author =
"Elliot Haisley",
82 .diagnostics = kDiagnosticTable,
83 .count =
sizeof(kDiagnosticTable) /
sizeof(
const diagnostic_t *)
96 .ast_size =
sizeof(
obr_t),
99 .fn_destroy = obr_destroy,
101 .fn_postparse = obr_postparse,
103 .scanner = &kCallbacks,
#define CT_TEXT_VIEW(str)
create a text view from a string literal
CT_PUREFN CT_BASE_API text_view_t text_view_from(const char *text)
create a new non-owning text array this is a shortcut for
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(...)
#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 CT_UNUSED(x)
mark a variable as unused
CT_NODISCARD CT_PUREFN CT_STD_API void * vector_get(const vector_t *vector, size_t index)
get a value from a vector
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)
void obr_create(language_runtime_t *runtime, tree_t *root)
void obr_forward_decls(language_runtime_t *runtime, compile_unit_t *unit)
void obr_process_imports(language_runtime_t *runtime, compile_unit_t *unit)
CT_DRIVER_API const language_t kOberonModule
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