cecko
|
Lexical level of compiler context + error messaging. More...
#include <ckcontext.hpp>
Public Member Functions | |
Generating error messages | |
void | message (errors::err_s err, loc_t loc, std::string_view msg) |
void | message (errors::err_n err, loc_t loc) |
Lexer source-line counting | |
loc_t | line () const |
Get current line. | |
loc_t | incline () |
Increment current line. | |
![]() | |
void | enter_function (CKFunctionObs f, CKFunctionFormalPackArray pack, loc_t loc) |
Signalize entering of the compound statement of the definition of the function f. | |
void | exit_function () |
Signalize exiting of the compound statement of the definition of a function. | |
void | enter_block () |
Signalize entering of a compound statement other than a function definition. | |
void | exit_block () |
Signalize exiting of a compound statement other than a function definition. | |
CKTypeSafeObs | current_function_return_type () |
The return type of the current function. | |
CKVoidTypeSafeObs | get_void_type () const |
The built-in "void" type descriptor. | |
CKBoolTypeSafeObs | get_bool_type () const |
The built-in "_Bool" type descriptor. | |
CKCharTypeSafeObs | get_char_type () const |
The built-in "char" type descriptor. | |
CKIntTypeSafeObs | get_int_type () const |
The built-in "int" type descriptor. | |
CKPtrTypeSafeObs | get_pointer_type (const CKTypeRefPack &pack) |
A pointer type descriptor. | |
CKArrayTypeSafeObs | get_array_type (CKTypeObs element_type, CKIRConstantIntObs size) |
An array type descriptor. | |
CKFunctionTypeSafeObs | get_function_type (CKTypeObs ret_type, CKTypeObsArray arg_types, bool variadic=false) |
A function type descriptor. | |
CKStructTypeSafeObs | declare_struct_type (const CIName &n, loc_t loc) |
Reference or declare a struct type. | |
CKStructTypeSafeObs | define_struct_type_open (const CIName &n, loc_t loc) |
Signalize entering the definition of the struct type named n. | |
void | define_struct_type_close (CKStructTypeObs type, const CKStructItemArray &items) |
Signalize exiting the definition of the struct type type. | |
CKEnumTypeSafeObs | declare_enum_type (const CIName &n, loc_t loc) |
Reference or declare an enum type. | |
CKEnumTypeSafeObs | define_enum_type_open (const CIName &n, loc_t loc) |
Signalize entering the definition of the enum type named n. | |
void | define_enum_type_close (CKEnumTypeObs type, CKConstantObsVector items) |
Signalize exiting the definition of the enum type type. | |
void | define_var (const CIName &name, const CKTypeRefPack &type_pack, loc_t loc) |
Define a global or local variable. | |
CKTypedefConstSafeObs | define_typedef (const CIName &name, const CKTypeRefPack &type_pack, loc_t loc) |
Define a typedef. | |
CKConstantConstSafeObs | define_constant (const CIName &name, CKIRConstantIntObs value, loc_t loc) |
Define an enumeration constant. | |
CKFunctionSafeObs | declare_function (const CIName &n, CKTypeObs type, loc_t loc) |
Declare a function (with or without body) | |
CKNamedSafeObs | find (const CIName &n) |
Find a named (constant, variable, or function) object. | |
CKTypedefConstSafeObs | find_typedef (const CIName &n) const |
Find a typedef. | |
bool | is_typedef (const CIName &n) const |
Check whether the name is a typedef (for the lexer) | |
CKIRTypeObs | get_ir_int64 () |
LLVM representation of C-types "int64_t" and "uint64_t". | |
CKIRConstantIntObs | get_int8_constant (std::int_fast32_t v) |
LLVM constant of type "char". | |
CKIRConstantIntObs | get_int32_constant (std::int_fast32_t v) |
LLVM constant of type "int". | |
CKIRBasicBlockObs | create_basic_block (const std::string &name) |
Create a new basic block in the current function. | |
CKIRBuilderObs | builder () |
The active builder for the currently open basic block (or inactive) | |
CKIRConstantIntObs | get_type_size (CKTypeObs type) const |
Size of a type in bytes. | |
Lexical level of compiler context + error messaging.
void cecko::context::message | ( | errors::err_n | err, |
loc_t | loc | ||
) |
err | Error descriptor |
loc | Line number |
void cecko::context::message | ( | errors::err_s | err, |
loc_t | loc, | ||
std::string_view | msg | ||
) |
err | Error descriptor |
loc | Line number |
msg | A string argument |