Debug Submodule
Enumerations
| Name | Description |
|---|---|
TokenPrintFlags |
Bitmask controlling which token fields are printed. |
TokenPrintFlags
enum TokenPrintFlags
Defined in include/rocky/debug.h:15
Bitmask controlling which token fields are printed.
| Value | Description |
|---|---|
TOK_PRINT_FLAG_KIND |
|
TOK_PRINT_FLAG_LEXEME |
|
TOK_PRINT_FLAG_LINE |
|
TOK_PRINT_FLAG_COL |
|
TOK_PRINT_ALL |
Functions
| Return | Name | Description |
|---|---|---|
const char * |
token_type_str |
Converts token kind to display string. |
const char * |
unary_op_str |
Converts unary operator to display string. |
const char * |
datatype_str |
Converts type kind to display string. |
const char * |
binary_op_str |
Converts binary operator to display string. |
void |
print_token |
Prints token diagnostics. |
void |
print_expr |
Prints an expression tree using ASCII connectors. |
const char * |
stmt_kind_str |
Converts a statement kind to a human-readable display string. |
void |
print_stmt |
Prints a statement tree using ASCII connectors. |
int |
use_color static |
|
void |
print_tree_prefix static |
|
void |
print_type_expr static |
|
void |
print_children |
Recursively prints a list of child expressions in tree form. |
void |
print_stmt_child static |
|
void |
print_expr_child static |
|
void |
print_stmt_node static |
token_type_str
const char * token_type_str(TokenKind type)
Defined in include/rocky/debug.h:24
Converts token kind to display string.
Converts token kind to display string.
Converts token kind to display string.
Converts token kind to display string.
unary_op_str
const char * unary_op_str(UnaryOp op)
Defined in include/rocky/debug.h:27
Converts unary operator to display string.
Converts unary operator to display string.
Converts unary operator to display string.
Converts unary operator to display string.
datatype_str
const char * datatype_str(TypeKind t)
Defined in include/rocky/debug.h:30
Converts type kind to display string.
Converts type kind to display string.
Converts type kind to display string.
Converts type kind to display string.
binary_op_str
const char * binary_op_str(BinaryOp op)
Defined in include/rocky/debug.h:33
Converts binary operator to display string.
Converts binary operator to display string.
Converts binary operator to display string.
Converts binary operator to display string.
print_token
void print_token(Token * token, TokenPrintFlags flags)
Defined in include/rocky/debug.h:40
Prints token diagnostics.
Prints token diagnostics.
Prints token diagnostics.
Prints token diagnostics.
Parameters
| Parameter | Type | Description |
|---|---|---|
token |
Token * |
Token to print. |
flags |
TokenPrintFlags |
Print-field bitmask. |
stmt_kind_str
const char * stmt_kind_str(StmtKind kind)
Defined in include/rocky/debug.h:52
Converts a statement kind to a human-readable display string.
Converts a statement kind to a human-readable display string.
Converts a statement kind to a human-readable display string.
Converts a statement kind to a human-readable display string.
use_color
static
static int use_color(void)
Defined in src/debug.c:26
datatype_str
const char * datatype_str(TypeKind t)
Defined in src/debug.c:189
Converts type kind to display string.
Converts type kind to display string.
Converts type kind to display string.
Converts type kind to display string.
stmt_kind_str
const char * stmt_kind_str(StmtKind kind)
Defined in src/debug.c:258
Converts a statement kind to a human-readable display string.
Converts a statement kind to a human-readable display string.
Converts a statement kind to a human-readable display string.
Converts a statement kind to a human-readable display string.
print_tree_prefix
static
static void print_tree_prefix(int depth, int is_last, int sibling)
Defined in src/debug.c:287
print_type_expr
static
static void print_type_expr(const TypeExpr * type)
Defined in src/debug.c:296
print_children
void print_children(const Expr ** children, int count, int depth, int sibling)
Defined in src/debug.c:347
Recursively prints a list of child expressions in tree form.
print_stmt_child
static
static void print_stmt_child(const Stmt * stmt, int depth, int is_last, int sibling)
Defined in src/debug.c:416
print_expr_child
static
static void print_expr_child(const Expr * expr, int depth, int is_last, int sibling)
Defined in src/debug.c:420
print_stmt_node
static
static void print_stmt_node(const Stmt * stmt, int depth, int is_last, int sibling)
Defined in src/debug.c:424