Cthulhu  0.2.10
Cthulhu compiler collection
Compiler events

Generic errors shared between frontends. More...

Collaboration diagram for Compiler events:

Macros

#define CTU_EVENT(name, ...)   CT_EVENTS_API extern const diagnostic_t kEvent_##name;
 

Functions

CT_NODISCARD CT_CONSTFN CT_EVENTS_API diagnostic_list_t get_common_diagnostics (void)
 get all common diagnostics More...
 
CT_EVENTS_API void evt_scan_error (logger_t *logger, const node_t *node, const char *msg)
 signal that a scan error has occurred More...
 
CT_EVENTS_API void evt_scan_unknown (logger_t *logger, const node_t *node, const char *msg)
 signal that a scanner has encountered an unknown token More...
 
CT_EVENTS_API event_builder_t evt_symbol_shadowed (logger_t *logger, const char *name, const node_t *prev, const node_t *next)
 signal that a declaration would shadow a previous declaration More...
 
CT_EVENTS_API event_builder_t evt_os_error (logger_t *logger, const diagnostic_t *diagnostic, os_error_t error, const char *msg)
 signal that an os error has occurred More...
 

Detailed Description

Generic errors shared between frontends.

Macro Definition Documentation

◆ CTU_EVENT

#define CTU_EVENT (   name,
  ... 
)    CT_EVENTS_API extern const diagnostic_t kEvent_##name;

Definition at line 19 of file events.h.

Function Documentation

◆ evt_os_error()

CT_EVENTS_API event_builder_t evt_os_error ( logger_t logger,
const diagnostic_t diagnostic,
os_error_t  error,
const char *  msg 
)

signal that an os error has occurred

Parameters
loggerthe logger to report to
diagnosticthe diagnostic to report
errorthe os error
msgthe error message
Returns
the event builder

Definition at line 59 of file events.c.

◆ evt_scan_error()

CT_EVENTS_API void evt_scan_error ( logger_t logger,
const node_t node,
const char *  msg 
)

signal that a scan error has occurred

Parameters
loggerthe logger to report to
nodethe node that caused the error
msgthe error message

Definition at line 33 of file events.c.

◆ evt_scan_unknown()

CT_EVENTS_API void evt_scan_unknown ( logger_t logger,
const node_t node,
const char *  msg 
)

signal that a scanner has encountered an unknown token

Parameters
loggerthe logger to report to
nodethe node that caused the error
msgthe error message

Definition at line 39 of file events.c.

◆ evt_symbol_shadowed()

CT_EVENTS_API event_builder_t evt_symbol_shadowed ( logger_t logger,
const char *  name,
const node_t prev,
const node_t next 
)

signal that a declaration would shadow a previous declaration

Parameters
loggerthe logger to report to
namethe name of the symbol
prevthe previous declaration
nextthe new declaration
Returns
the event builder

Definition at line 47 of file events.c.

◆ get_common_diagnostics()

CT_NODISCARD CT_CONSTFN CT_EVENTS_API diagnostic_list_t get_common_diagnostics ( void  )

get all common diagnostics

Returns
all common diagnostics

Definition at line 22 of file events.c.