Debug
Enumerations
| Name | Description |
|---|---|
TokenPrintFlags |
Bitmask controlling which token fields are printed. |
TokenPrintFlags
enum TokenPrintFlags
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_token |
Prints token diagnostics. |
const char * |
datatype_str |
Converts type kind to display string. |
const char * |
stmt_kind_str |
Converts a statement kind to a human-readable display string. |
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 |
|
void |
print_stmt |
Prints a statement tree using ASCII connectors. |
token_type_str
const char * token_type_str(TokenKind type)
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)
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)
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)
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)
Prints token diagnostics.
Prints token diagnostics.
Parameters
-
tokenToken to print. -
flagsPrint-field bitmask.
Prints token diagnostics.
Parameters
-
tokenToken to print. -
flagsPrint-field bitmask.
Prints token diagnostics.
print_expr
void print_expr(const Expr * expr, int depth, int is_last, int sibling)
Prints an expression tree using ASCII connectors.
Prints an expression tree using ASCII connectors.
Parameters
-
exprRoot expression to print. -
depthCurrent depth in the recursion. -
is_lastNon-zero if node is last child at its level. -
siblingBitmask describing ancestor sibling structure.
Prints an expression tree using ASCII connectors.
Parameters
-
exprRoot expression to print. -
depthCurrent depth in the recursion. -
is_lastNon-zero if node is last child at its level. -
siblingBitmask describing ancestor sibling structure.
Prints an expression tree using ASCII connectors.
stmt_kind_str
const char * stmt_kind_str(StmtKind kind)
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_stmt
void print_stmt(const Stmt * stmt, int depth, int is_last, int sibling)
Prints a statement tree using ASCII connectors.
Prints a statement tree using ASCII connectors.
Parameters
-
stmtRoot statement to print. Statements linked through next are also printed. -
depthCurrent depth in the recursion. -
is_lastNon-zero if node is last child at its level. -
siblingBitmask describing ancestor sibling structure.
Prints a statement tree using ASCII connectors.
Parameters
-
stmtRoot statement to print. Statements linked through next are also printed. -
depthCurrent depth in the recursion. -
is_lastNon-zero if node is last child at its level. -
siblingBitmask describing ancestor sibling structure.
Prints a statement tree using ASCII connectors.
use_color
static
static int use_color(void)
print_token
void print_token(Token * token, TokenPrintFlags flags)
Prints token diagnostics.
Prints token diagnostics.
Parameters
-
tokenToken to print. -
flagsPrint-field bitmask.
Prints token diagnostics.
Prints token diagnostics.
Parameters
-
tokenToken to print. -
flagsPrint-field bitmask.
datatype_str
const char * datatype_str(TypeKind t)
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)
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)
print_type_expr
static
static void print_type_expr(const TypeExpr * type)
print_children
void print_children(const Expr ** children, int count, int depth, int sibling)
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)
print_expr_child
static
static void print_expr_child(const Expr * expr, int depth, int is_last, int sibling)
print_stmt_node
static
static void print_stmt_node(const Stmt * stmt, int depth, int is_last, int sibling)
print_stmt
void print_stmt(const Stmt * stmt, int depth, int is_last, int sibling)
Prints a statement tree using ASCII connectors.
Prints a statement tree using ASCII connectors.
Parameters
-
stmtRoot statement to print. Statements linked through next are also printed. -
depthCurrent depth in the recursion. -
is_lastNon-zero if node is last child at its level. -
siblingBitmask describing ancestor sibling structure.
Prints a statement tree using ASCII connectors.
Prints a statement tree using ASCII connectors.
Parameters
-
stmtRoot statement to print. Statements linked through next are also printed. -
depthCurrent depth in the recursion. -
is_lastNon-zero if node is last child at its level. -
siblingBitmask describing ancestor sibling structure.