API Reference
Groups
| Name | Description |
|---|---|
Debug Submodule |
Classes
| Name | Description |
|---|---|
BP |
|
Expr |
|
Sema |
|
Stmt |
|
Arena |
Linear allocation arena. |
Lexer |
Stateful lexer cursor over an input source buffer. |
Param |
|
Token |
|
Parser |
Parser state over a linked list of Token pointers. |
Symbol |
|
HashMap |
|
TypeExpr |
|
JITModule |
Mutable LLVM module tracked by the JIT context. |
JITContext |
Global JIT state for one runtime session. |
LinkedList |
|
HashMapNode |
|
PassManager |
Owns the ordered pass pipeline and the state shared between its passes. |
SymbolTable |
|
LinkedListNode |
|
RockyCliParser |
|
InputPassResult |
|
LexerPassResult |
|
RockyCliOptions |
Macros
MODULE_NAME_MAX
#define MODULE_NAME_MAX 256
Defined in src/jit.c:13
ROCKY_CONTEXT_CLI_OPTIONS
#define ROCKY_CONTEXT_CLI_OPTIONS "cli-options"
Defined in include/rocky/pass/pass.h:14
ROCKY_CONTEXT_INPUT
#define ROCKY_CONTEXT_INPUT "input"
Defined in include/rocky/pass/input.h:12
ROCKY_CONTEXT_SOURCE
#define ROCKY_CONTEXT_SOURCE "source"
Defined in include/rocky/pass/input.h:13
PASS_MANAGER_ARENA_CAPACITY
#define PASS_MANAGER_ARENA_CAPACITY (256 * 1024)
Defined in src/pass/manager.c:12
PASS_MANAGER_CONTEXT_CAPACITY
#define PASS_MANAGER_CONTEXT_CAPACITY 16
Defined in src/pass/manager.c:13
TABLE_MAX_LOAD
#define TABLE_MAX_LOAD 0.75
Defined in src/symtable.c:6
GROW_CAPACITY
#define GROW_CAPACITY(cap) ((cap) < 8 ? 8 : (cap) * 2)
Defined in src/symtable.c:7
ROCKY_CONTEXT_SEMA
#define ROCKY_CONTEXT_SEMA "sema"
Defined in include/rocky/pass/sema.h:7
ROCKY_CONTEXT_SYMBOL_TABLE
#define ROCKY_CONTEXT_SYMBOL_TABLE "symbol-table"
Defined in include/rocky/pass/sema.h:8
ROCKY_CONTEXT_TOKENS
#define ROCKY_CONTEXT_TOKENS "tokens"
Defined in include/rocky/pass/lexer.h:14
LEXER_PASS_MAX_TOKENS
#define LEXER_PASS_MAX_TOKENS 4096
Defined in src/pass/lexer.c:12
ROCKY_CONTEXT_AST
#define ROCKY_CONTEXT_AST "ast"
Defined in include/rocky/pass/parser.h:7
Enumerations
RockyCliParseStatus
enum RockyCliParseStatus
Defined in include/rocky/cli.h:20
| Value | Description |
|---|---|
ROCKY_CLI_PARSE_OK |
|
ROCKY_CLI_PARSE_HELP |
|
ROCKY_CLI_PARSE_ERROR |
TypeKind
enum TypeKind
Defined in include/rocky/parser/ast.h:9
| Value | Description |
|---|---|
TYPE_INT |
|
TYPE_FLOAT |
|
TYPE_BOOL |
|
TYPE_VOID |
UnaryOp
enum UnaryOp
Defined in include/rocky/parser/ast.h:18
| Value | Description |
|---|---|
UNOP_NEG |
|
UNOP_BITNOT |
|
UNOP_LOGICNOT |
BinaryOp
enum BinaryOp
Defined in include/rocky/parser/ast.h:24
| Value | Description |
|---|---|
BINOP_ADD |
|
BINOP_SUB |
|
BINOP_MUL |
|
BINOP_DIV |
|
BINOP_MOD |
|
BINOP_BAND |
|
BINOP_BOR |
|
BINOP_BXOR |
|
BINOP_SHL |
|
BINOP_SHR |
|
BINOP_EQ |
|
BINOP_NEQ |
|
BINOP_LT |
|
BINOP_GT |
|
BINOP_LE |
|
BINOP_GE |
|
BINOP_AND |
|
BINOP_OR |
ExprKind
enum ExprKind
Defined in include/rocky/parser/ast.h:49
| Value | Description |
|---|---|
EXPR_INT_LIT |
|
EXPR_FLOAT_LIT |
|
EXPR_BOOL_LIT |
|
EXPR_STRING_LIT |
|
EXPR_IDENT |
|
EXPR_UNARY |
|
EXPR_BINARY |
|
EXPR_CAST |
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 |
TokenKind
enum TokenKind
Defined in include/rocky/lexer/token.h:6
| Value | Description |
|---|---|
TOKEN_TYPE_INT |
|
TOKEN_TYPE_FLOAT |
|
TOKEN_TYPE_STRING |
|
TOKEN_TYPE_BOOL |
|
TOKEN_TYPE_SIZE_T |
|
TOKEN_INT |
|
TOKEN_FLOAT |
|
TOKEN_STRING |
|
TOKEN_BOOL |
|
TOKEN_SIZE_T |
|
TOKEN_IDENTIFIER |
|
TOKEN_ELSE |
|
TOKEN_IF |
|
TOKEN_RETURN |
|
TOKEN_WHILE |
|
TOKEN_FALSE |
|
TOKEN_TRUE |
|
TOKEN_FOR |
|
TOKEN_BREAK |
|
TOKEN_CONTINUE |
|
TOKEN_FUNCTION |
|
TOKEN_PLUS |
|
TOKEN_MINUS |
|
TOKEN_STAR |
|
TOKEN_SLASH |
|
TOKEN_PERCENT |
|
TOKEN_EQUAL |
|
TOKEN_CARET |
|
TOKEN_PIPE |
|
TOKEN_AMP |
|
TOKEN_BANG |
|
TOKEN_EQEQ |
|
TOKEN_BANGEQ |
|
TOKEN_LT |
|
TOKEN_GT |
|
TOKEN_LTEQ |
|
TOKEN_GTEQ |
|
TOKEN_AMPAMP |
|
TOKEN_PIPEPIPE |
|
TOKEN_LSHIFT |
|
TOKEN_RSHIFT |
|
TOKEN_TILDE |
|
TOKEN_PLUS_PLUS |
|
TOKEN_MINUS_MINUS |
|
TOKEN_PLUS_EQUAL |
|
TOKEN_MINUS_EQUAL |
|
TOKEN_COMMA |
|
TOKEN_LPAREN |
|
TOKEN_RPAREN |
|
TOKEN_LBRACE |
|
TOKEN_RBRACE |
|
TOKEN_COLON |
|
TOKEN_SEMICOLON |
|
TOKEN_EOF |
|
TOKEN_INVALID |
|
TOKEN_ERROR |
StmtKind
enum StmtKind
Defined in include/rocky/parser/nodes.h:18
| Value | Description |
|---|---|
STMT_EXPR |
|
STMT_IF |
|
STMT_WHILE |
|
STMT_RETURN |
|
STMT_FOR |
|
STMT_BLOCK |
|
STMT_FUNC |
|
STMT_DECLARATION |
|
STMT_ASSIGN |
|
STMT_CONTINUE |
|
STMT_BREAK |
TypeExprKind
enum TypeExprKind
Defined in include/rocky/parser/nodes.h:92
| Value | Description |
|---|---|
TYPE_PRIMITIVE |
|
TYPE_POINTER |
|
TYPE_FUNC_POINTER |
Typedefs
RockyCliParser
using RockyCliParser = struct RockyCliParser
Defined in include/rocky/cli.h:7
VoidFunc
using VoidFunc = void
Defined in include/rocky/jit.h:20
JITModule
using JITModule = struct JITModule
Defined in include/rocky/jit.h:22
JITContext
using JITContext = struct JITContext
Defined in include/rocky/jit.h:31
Expr
using Expr = struct Expr
Defined in include/rocky/parser/ast.h:47
PassManager
using PassManager = struct PassManager
Defined in include/rocky/pass/pass.h:10
Pass
using Pass = void(*
Defined in include/rocky/pass/pass.h:12
Parser
using Parser = struct Parser
Defined in include/rocky/parser/nodes.h:6
Param
using Param = struct Param
Defined in include/rocky/parser/nodes.h:8
Stmt
using Stmt = struct Stmt
Defined in include/rocky/parser/nodes.h:9
TypeExpr
using TypeExpr = struct TypeExpr
Defined in include/rocky/parser/nodes.h:10
HashMapNode
using HashMapNode = struct HashMapNode
Defined in include/rocky/adt/hashmap.h:10
HashMap
using HashMap = struct HashMap
Defined in include/rocky/adt/hashmap.h:16
LinkedListNode
using LinkedListNode = struct LinkedListNode
Defined in include/rocky/adt/linked_list.h:12
LinkedList
using LinkedList = struct LinkedList
Defined in include/rocky/adt/linked_list.h:13
Parser
using Parser = struct Parser
Defined in include/rocky/parser/parser.h:15
Parser state over a linked list of Token pointers.
Functions
rocky_cli_options_init
void rocky_cli_options_init(RockyCliOptions * options)
Defined in include/rocky/cli.h:26
rocky_cli_parse_init
RockyCliParser * rocky_cli_parse_init(RockyCliOptions * options)
Defined in include/rocky/cli.h:27
rocky_cli_parser_free
void rocky_cli_parser_free(RockyCliParser * parser)
Defined in include/rocky/cli.h:28
rocky_cli_parser_add_option
int rocky_cli_parser_add_option(RockyCliParser * parser, const struct argparse_option * option)
Defined in include/rocky/cli.h:30
Copies a normal argparse option into the parser's option list.
rocky_cli_parse
RockyCliParseStatus rocky_cli_parse(RockyCliParser * parser, int argc, char ** argv, char * errbuf, size_t errbuf_size)
Defined in include/rocky/cli.h:31
rocky_cli_print_usage
void rocky_cli_print_usage(FILE * out, const char * program_name)
Defined in include/rocky/cli.h:33
jit_init
void jit_init(JITContext * ctx)
Defined in include/rocky/jit.h:51
Initializes a JIT context and ORC engine.
Initializes a JIT context and ORC engine.
Initializes a JIT context and ORC engine.
Initializes a JIT context and ORC engine.
jit_free
void jit_free(JITContext * ctx)
Defined in include/rocky/jit.h:53
Releases all JIT resources.
Releases all JIT resources.
Releases all JIT resources.
Releases all JIT resources.
jit_add_dummy_functions
void jit_add_dummy_functions(JITContext * ctx)
Defined in include/rocky/jit.h:55
Adds temporary/demo functions to current mutable module.
Adds temporary/demo functions to current mutable module.
Adds temporary/demo functions to current mutable module.
Adds temporary/demo functions to current mutable module.
jit_bake
void jit_bake(JITContext * ctx)
Defined in include/rocky/jit.h:57
Finalizes and submits current module to the JIT.
Finalizes and submits current module to the JIT.
Finalizes and submits current module to the JIT.
Finalizes and submits current module to the JIT.
jit_lookup_function
VoidFunc * jit_lookup_function(JITContext * ctx, char * function_name)
Defined in include/rocky/jit.h:59
Resolves a JIT function by symbol name.
Resolves a JIT function by symbol name.
Resolves a JIT function by symbol name.
Resolves a JIT function by symbol name.
write_err
static
static void write_err(char * errbuf, size_t errbuf_size, const char * message)
Defined in src/cli.c:25
rocky_cli_options_init
void rocky_cli_options_init(RockyCliOptions * options)
Defined in src/cli.c:31
rocky_cli_parser_add_option
int rocky_cli_parser_add_option(RockyCliParser * parser, const struct argparse_option * option)
Defined in src/cli.c:44
Copies a normal argparse option into the parser's option list.
rocky_cli_parse_init
RockyCliParser * rocky_cli_parse_init(RockyCliOptions * options)
Defined in src/cli.c:64
rocky_cli_parser_free
void rocky_cli_parser_free(RockyCliParser * parser)
Defined in src/cli.c:93
rocky_cli_print_usage
void rocky_cli_print_usage(FILE * out, const char * program_name)
Defined in src/cli.c:101
rocky_cli_parse
RockyCliParseStatus rocky_cli_parse(RockyCliParser * parser, int argc, char ** argv, char * errbuf, size_t errbuf_size)
Defined in src/cli.c:107
jit_verify_module_mutable
static
static void jit_verify_module_mutable(JITContext * ctx)
Defined in src/jit.c:15
jit_error_report
void jit_error_report(void * ctx, LLVMErrorRef err)
Defined in src/jit.c:35
ORC error callback used by execution session.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx |
void * |
User callback context (unused). |
err |
LLVMErrorRef |
LLVM error object. |
jit_init
void jit_init(JITContext * ctx)
Defined in src/jit.c:41
Initializes a JIT context and ORC engine.
Initializes a JIT context and ORC engine.
Initializes a JIT context and ORC engine.
Initializes a JIT context and ORC engine.
jit_add_dummy_functions
void jit_add_dummy_functions(JITContext * ctx)
Defined in src/jit.c:71
Adds temporary/demo functions to current mutable module.
Adds temporary/demo functions to current mutable module.
Adds temporary/demo functions to current mutable module.
Adds temporary/demo functions to current mutable module.
jit_bake
void jit_bake(JITContext * ctx)
Defined in src/jit.c:102
Finalizes and submits current module to the JIT.
Finalizes and submits current module to the JIT.
Finalizes and submits current module to the JIT.
Finalizes and submits current module to the JIT.
jit_lookup_function
VoidFunc * jit_lookup_function(JITContext * ctx, char * function_name)
Defined in src/jit.c:108
Resolves a JIT function by symbol name.
Resolves a JIT function by symbol name.
Resolves a JIT function by symbol name.
Resolves a JIT function by symbol name.
jit_free
void jit_free(JITContext * ctx)
Defined in src/jit.c:115
Releases all JIT resources.
Releases all JIT resources.
Releases all JIT resources.
Releases all JIT resources.
main
int main(int argc, char ** argv)
Defined in src/main.c:18
visit_stmt
static
static void visit_stmt(Sema * sema, Stmt * stmt)
Defined in src/sema.c:30
visit_expr
static
static void visit_expr(Sema * sema, Expr * expr)
Defined in src/sema.c:123
visit_declaration
static
static void visit_declaration(Sema * sema, Stmt * stmt)
Defined in src/sema.c:166
init_sema
void init_sema(Sema * sema)
Defined in src/sema.c:13
free_sema
void free_sema(Sema * sema)
Defined in src/sema.c:18
visit_stmt_list
static
static void visit_stmt_list(Sema * sema, Stmt * stmt)
Defined in src/sema.c:22
sema_check
bool sema_check(Sema * sema, Stmt * program)
Defined in src/sema.c:178
arena_alloc
static inline
static inline void * arena_alloc(Arena * a, size_t size)
Defined in include/rocky/arena.h:43
Allocates aligned memory from the arena.
Returns
Pointer to allocated storage inside the arena.
Parameters
| Parameter | Type | Description |
|---|---|---|
a |
Arena * |
Arena to allocate from. |
size |
size_t |
Requested byte size. |
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.
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.
alloc_param
Param * alloc_param(Parser * p, Token name, TypeExpr * type)
Defined in include/rocky/parser/nodes.h:114
alloc_stmt
Stmt * alloc_stmt(Parser * p, StmtKind kind, Token tok)
Defined in include/rocky/parser/nodes.h:115
alloc_type_expr
TypeExpr * alloc_type_expr(Parser * p, TypeExprKind kind)
Defined in include/rocky/parser/nodes.h:116
input_pass_register_cli_flags
void input_pass_register_cli_flags(RockyCliParser * parser, RockyCliOptions * options)
Defined in include/rocky/pass/input.h:15
input_pass
void input_pass(PassManager * pm)
Defined in include/rocky/pass/input.h:16
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
is_at_end
static
static bool is_at_end(Lexer * lexer)
Defined in src/lexer.c:19
lexer_advance
static
static char lexer_advance(Lexer * lexer)
Defined in src/lexer.c:24
peek
static
static char peek(Lexer * lexer)
Defined in src/lexer.c:36
peek_next
static
static char peek_next(Lexer * lexer)
Defined in src/lexer.c:41
skip_whitespace
static
static void skip_whitespace(Lexer * lexer)
Defined in src/lexer.c:48
make_token
static
static Token make_token(Lexer * lexer, TokenKind type)
Defined in src/lexer.c:79
error_token
static
static Token error_token(Lexer * lexer, const char * message)
Defined in src/lexer.c:91
match
static
static bool match(Lexer * lexer, char expected)
Defined in src/lexer.c:101
string
static
static Token string(Lexer * lexer)
Defined in src/lexer.c:111
number
static
static Token number(Lexer * lexer)
Defined in src/lexer.c:126
check_keyword
static
static TokenKind check_keyword(Lexer * lexer, int start, int length, const char * rest, TokenKind type)
Defined in src/lexer.c:143
identifier_type
static
static TokenKind identifier_type(Lexer * lexer)
Defined in src/lexer.c:153
identifier
static
static Token identifier(Lexer * lexer)
Defined in src/lexer.c:214
count_inline_code
static
static int count_inline_code(struct argparse * parser, const struct argparse_option * option)
Defined in src/pass/input.c:11
input_pass_register_cli_flags
void input_pass_register_cli_flags(RockyCliParser * parser, RockyCliOptions * options)
Defined in src/pass/input.c:18
read_file
static
static char * read_file(const char * path)
Defined in src/pass/input.c:25
input_pass
void input_pass(PassManager * pm)
Defined in src/pass/input.c:51
parse_stmt
Stmt * parse_stmt(Parser * p)
Defined in src/parser.c:524
parse_variable_declaration
Stmt * parse_variable_declaration(Parser * p)
Defined in src/parser.c:490
alloc_stmt
Stmt * alloc_stmt(Parser * p, StmtKind kind, Token tok)
Defined in src/parser.c:16
alloc_param
Param * alloc_param(Parser * p, Token name, TypeExpr * type)
Defined in src/parser.c:24
alloc_type_expr
TypeExpr * alloc_type_expr(Parser * p, TypeExprKind kind)
Defined in src/parser.c:33
alloc_expr
static
static Expr * alloc_expr(Parser * p, ExprKind kind, Token tok)
Defined in src/parser.c:40
token_at
static
static Token token_at(const Parser * p, int index)
Defined in src/parser.c:51
peek
static
static Token peek(const Parser * p)
Defined in src/parser.c:61
advance
static
static Token advance(Parser * p)
Defined in src/parser.c:65
expect
static
static Token expect(Parser * p, TokenKind kind)
Defined in src/parser.c:72
error
void error(Token tok)
Defined in src/parser.c:84
infix_bp
static
static BP infix_bp(TokenKind k)
Defined in src/parser.c:99
prefix_bp
static
static int prefix_bp(TokenKind k)
Defined in src/parser.c:134
tok_to_unop
static
static UnaryOp tok_to_unop(TokenKind k)
Defined in src/parser.c:147
tok_to_binop
static
static BinaryOp tok_to_binop(TokenKind k)
Defined in src/parser.c:160
parser_init
void parser_init(Parser * p, LinkedList * tokens, Arena * arena)
Defined in src/parser.c:205
parse_expr
Expr * parse_expr(Parser * p, int min_bp)
Defined in src/parser.c:211
parse_type_expr
TypeExpr * parse_type_expr(Parser * p)
Defined in src/parser.c:287
parse_variable_assignment
Stmt * parse_variable_assignment(Parser * p)
Defined in src/parser.c:315
parse_variable_assignment_without_semicolon
Stmt * parse_variable_assignment_without_semicolon(Parser * p)
Defined in src/parser.c:327
parse_expr_stmt
Stmt * parse_expr_stmt(Parser * p)
Defined in src/parser.c:338
parse_block
Stmt * parse_block(Parser * p)
Defined in src/parser.c:363
parse_params
Param * parse_params(Parser * p)
Defined in src/parser.c:382
parse_while
Stmt * parse_while(Parser * p)
Defined in src/parser.c:414
parse_for
Stmt * parse_for(Parser * p)
Defined in src/parser.c:427
parse_return
Stmt * parse_return(Parser * p)
Defined in src/parser.c:449
parse_if
Stmt * parse_if(Parser * p)
Defined in src/parser.c:458
parse_continue
Stmt * parse_continue(Parser * p)
Defined in src/parser.c:477
parse_break
Stmt * parse_break(Parser * p)
Defined in src/parser.c:484
parse_func
Stmt * parse_func(Parser * p)
Defined in src/parser.c:504
parse_top_level
Stmt * parse_top_level(Parser * p)
Defined in src/parser.c:559
parse_program
Stmt * parse_program(Parser * p)
Defined in src/parser.c:576
create_hashmap
HashMap * create_hashmap(int capacity)
Defined in include/rocky/adt/hashmap.h:19
free_hashmap
void free_hashmap(HashMap * map)
Defined in include/rocky/adt/hashmap.h:23
hashmap_get
void * hashmap_get(HashMap * map, const char * key)
Defined in include/rocky/adt/hashmap.h:28
hashmap_contains
int hashmap_contains(HashMap * map, const char * key)
Defined in include/rocky/adt/hashmap.h:31
hashmap_set
void hashmap_set(HashMap * map, const char * key, void * value)
Defined in include/rocky/adt/hashmap.h:34
hashmap_delete
void * hashmap_delete(HashMap * map, const char * key)
Defined in include/rocky/adt/hashmap.h:37
create_pass_manager
PassManager * create_pass_manager(void)
Defined in include/rocky/pass/manager.h:30
Creates an empty pass manager. Returns NULL when allocation fails.
free_pass_manager
void free_pass_manager(PassManager * pm)
Defined in include/rocky/pass/manager.h:33
Releases manager-owned storage. Context keys and values are not freed.
add_pass
void add_pass(PassManager * pm, Pass pass)
Defined in include/rocky/pass/manager.h:36
Appends a pass to the pipeline.
remove_pass
void remove_pass(PassManager * pm, size_t index)
Defined in include/rocky/pass/manager.h:39
Removes the pass at index. Invalid indices are ignored.
insert_pass
void insert_pass(PassManager * pm, Pass pass, size_t index)
Defined in include/rocky/pass/manager.h:42
Inserts a pass before index. An index equal to pass_count appends it.
run_passes
void run_passes(PassManager * pm)
Defined in include/rocky/pass/manager.h:45
Runs all registered passes in order.
hashmap_hash
static
static unsigned long hashmap_hash(const char * str)
Defined in src/hashmap.c:10
create_hashmap
HashMap * create_hashmap(int capacity)
Defined in src/hashmap.c:19
free_hashmap
void free_hashmap(HashMap * map)
Defined in src/hashmap.c:51
hashmap_get
void * hashmap_get(HashMap * map, const char * key)
Defined in src/hashmap.c:78
hashmap_contains
int hashmap_contains(HashMap * map, const char * key)
Defined in src/hashmap.c:108
hashmap_set
void hashmap_set(HashMap * map, const char * key, void * value)
Defined in src/hashmap.c:136
hashmap_delete
void * hashmap_delete(HashMap * map, const char * key)
Defined in src/hashmap.c:181
reserve_passes
static
static int reserve_passes(PassManager * pm, size_t required)
Defined in src/pass/manager.c:15
create_pass_manager
PassManager * create_pass_manager(void)
Defined in src/pass/manager.c:35
Creates an empty pass manager. Returns NULL when allocation fails.
free_pass_manager
void free_pass_manager(PassManager * pm)
Defined in src/pass/manager.c:57
Releases manager-owned storage. Context keys and values are not freed.
add_pass
void add_pass(PassManager * pm, Pass pass)
Defined in src/pass/manager.c:68
Appends a pass to the pipeline.
remove_pass
void remove_pass(PassManager * pm, size_t index)
Defined in src/pass/manager.c:75
Removes the pass at index. Invalid indices are ignored.
insert_pass
void insert_pass(PassManager * pm, Pass pass, size_t index)
Defined in src/pass/manager.c:87
Inserts a pass before index. An index equal to pass_count appends it.
run_passes
void run_passes(PassManager * pm)
Defined in src/pass/manager.c:100
Runs all registered passes in order.
init_sym_table
void init_sym_table(SymbolTable * table)
Defined in include/rocky/parser/sema/symtable.h:26
free_sym_table
void free_sym_table(SymbolTable * table)
Defined in include/rocky/parser/sema/symtable.h:27
begin_scope
void begin_scope(SymbolTable * table)
Defined in include/rocky/parser/sema/symtable.h:28
end_scope
void end_scope(SymbolTable * table)
Defined in include/rocky/parser/sema/symtable.h:29
declare_symbol
bool declare_symbol(SymbolTable * table, const char * name, int length, TypeExpr * type)
Defined in include/rocky/parser/sema/symtable.h:30
resolve_symbol
Symbol * resolve_symbol(SymbolTable * table, const char * name, int length)
Defined in include/rocky/parser/sema/symtable.h:31
dump_symbol_table
void dump_symbol_table(SymbolTable * table)
Defined in include/rocky/parser/sema/symtable.h:32
hash_string
static
static uint32_t hash_string(const char * name, int length)
Defined in src/symtable.c:10
find_entry
static
static Symbol * find_entry(Symbol * symbols, int capacity, const char * name, int length)
Defined in src/symtable.c:23
init_sym_table
void init_sym_table(SymbolTable * table)
Defined in src/symtable.c:50
free_sym_table
void free_sym_table(SymbolTable * table)
Defined in src/symtable.c:57
begin_scope
void begin_scope(SymbolTable * table)
Defined in src/symtable.c:62
end_scope
void end_scope(SymbolTable * table)
Defined in src/symtable.c:66
adjust_capacity
static
static void adjust_capacity(SymbolTable * table, int capacity)
Defined in src/symtable.c:78
declare_symbol
bool declare_symbol(SymbolTable * table, const char * name, int length, TypeExpr * type)
Defined in src/symtable.c:114
resolve_symbol
Symbol * resolve_symbol(SymbolTable * table, const char * name, int length)
Defined in src/symtable.c:142
dump_symbol_table
void dump_symbol_table(SymbolTable * table)
Defined in src/symtable.c:153
sema_pass_register_cli_flags
void sema_pass_register_cli_flags(RockyCliParser * parser, RockyCliOptions * options)
Defined in include/rocky/pass/sema.h:10
sema_pass
void sema_pass(PassManager * pm)
Defined in include/rocky/pass/sema.h:11
sema_pass_register_cli_flags
void sema_pass_register_cli_flags(RockyCliParser * parser, RockyCliOptions * options)
Defined in src/pass/sema.c:10
sema_pass
void sema_pass(PassManager * pm)
Defined in src/pass/sema.c:17
lexer_pass_register_cli_flags
void lexer_pass_register_cli_flags(RockyCliParser * parser, RockyCliOptions * options)
Defined in include/rocky/pass/lexer.h:16
lexer_pass
void lexer_pass(PassManager * pm)
Defined in include/rocky/pass/lexer.h:17
lexer_pass_register_cli_flags
void lexer_pass_register_cli_flags(RockyCliParser * parser, RockyCliOptions * options)
Defined in src/pass/lexer.c:14
lexer_pass
void lexer_pass(PassManager * pm)
Defined in src/pass/lexer.c:20
create_linked_list
LinkedList * create_linked_list(void)
Defined in include/rocky/adt/linked_list.h:25
free_linked_list
void free_linked_list(LinkedList * ll)
Defined in include/rocky/adt/linked_list.h:26
linked_list_get
void * linked_list_get(LinkedList * ll, int index)
Defined in include/rocky/adt/linked_list.h:27
linked_list_append
void linked_list_append(LinkedList * ll, void * data)
Defined in include/rocky/adt/linked_list.h:28
linked_list_insert
void linked_list_insert(LinkedList * ll, void * data, int index)
Defined in include/rocky/adt/linked_list.h:29
linked_list_pop
void * linked_list_pop(LinkedList * ll)
Defined in include/rocky/adt/linked_list.h:30
linked_list_delete
void * linked_list_delete(LinkedList * ll, int index)
Defined in include/rocky/adt/linked_list.h:31
parser_pass_register_cli_flags
void parser_pass_register_cli_flags(RockyCliParser * parser, RockyCliOptions * options)
Defined in include/rocky/pass/parser.h:9
parser_pass
void parser_pass(PassManager * pm)
Defined in include/rocky/pass/parser.h:10
node_at
static
static LinkedListNode * node_at(LinkedList * ll, int index)
Defined in src/adt/linked_list.c:11
create_linked_list
LinkedList * create_linked_list(void)
Defined in src/adt/linked_list.c:23
free_linked_list
void free_linked_list(LinkedList * ll)
Defined in src/adt/linked_list.c:33
linked_list_get
void * linked_list_get(LinkedList * ll, int index)
Defined in src/adt/linked_list.c:48
linked_list_append
void linked_list_append(LinkedList * ll, void * data)
Defined in src/adt/linked_list.c:56
linked_list_insert
void linked_list_insert(LinkedList * ll, void * data, int index)
Defined in src/adt/linked_list.c:80
linked_list_pop
void * linked_list_pop(LinkedList * ll)
Defined in src/adt/linked_list.c:102
linked_list_delete
void * linked_list_delete(LinkedList * ll, int index)
Defined in src/adt/linked_list.c:109
parser_pass_register_cli_flags
void parser_pass_register_cli_flags(RockyCliParser * cli_parser, RockyCliOptions * options)
Defined in src/pass/parser.c:10
parser_pass
void parser_pass(PassManager * pm)
Defined in src/pass/parser.c:16
parser_init
void parser_init(Parser * p, LinkedList * tokens, Arena * arena)
Defined in include/rocky/parser/parser.h:17
parse_expr
Expr * parse_expr(Parser * p, int min_bp)
Defined in include/rocky/parser/parser.h:18
parse_program
Stmt * parse_program(Parser * p)
Defined in include/rocky/parser/parser.h:19
init_sema
void init_sema(Sema * sema)
Defined in include/rocky/parser/sema/sema.h:14
free_sema
void free_sema(Sema * sema)
Defined in include/rocky/parser/sema/sema.h:15
sema_check
bool sema_check(Sema * sema, Stmt * program)
Defined in include/rocky/parser/sema/sema.h:16
Variables
ROCKY_CLI_USAGES
static
const char *const ROCKY_CLI_USAGES[]
Defined in src/cli.c:19
Class Definitions
BP
struct BP
Defined in src/parser.c:94
Expr
struct Expr
Defined in include/rocky/parser/ast.h:61
Sema
struct Sema
Defined in include/rocky/parser/sema/sema.h:9
Stmt
struct Stmt
Defined in include/rocky/parser/nodes.h:32
Arena
#include <arena.h>
struct Arena
Defined in include/rocky/arena.h:17
Linear allocation arena.
Lexer
#include <lexer.h>
struct Lexer
Defined in include/rocky/lexer/lexer.h:14
Stateful lexer cursor over an input source buffer.
Param
struct Param
Defined in include/rocky/parser/nodes.h:12
Token
struct Token
Defined in include/rocky/lexer/token.h:77
Parser
#include <parser.h>
struct Parser
Defined in include/rocky/parser/parser.h:10
Parser state over a linked list of Token pointers.
Symbol
struct Symbol
Defined in include/rocky/parser/sema/symtable.h:9
HashMap
struct HashMap
Defined in include/rocky/adt/hashmap.h:12
TypeExpr
struct TypeExpr
Defined in include/rocky/parser/nodes.h:98
JITModule
#include <jit.h>
struct JITModule
Defined in include/rocky/jit.h:24
Mutable LLVM module tracked by the JIT context.
JITContext
#include <jit.h>
struct JITContext
Defined in include/rocky/jit.h:33
Global JIT state for one runtime session.
LinkedList
struct LinkedList
Defined in include/rocky/adt/linked_list.h:20
HashMapNode
struct HashMapNode
Defined in include/rocky/adt/hashmap.h:6
PassManager
#include <manager.h>
struct PassManager
Defined in include/rocky/pass/manager.h:21
Owns the ordered pass pipeline and the state shared between its passes.
Values placed in context are owned by their producer. The manager owns neither those values nor their keys; allocations intended to live for the whole pipeline should be made with arena.
SymbolTable
struct SymbolTable
Defined in include/rocky/parser/sema/symtable.h:18
LinkedListNode
struct LinkedListNode
Defined in include/rocky/adt/linked_list.h:15
RockyCliParser
struct RockyCliParser
Defined in src/cli.c:11
InputPassResult
struct InputPassResult
Defined in include/rocky/pass/input.h:7
LexerPassResult
struct LexerPassResult
Defined in include/rocky/pass/lexer.h:8
RockyCliOptions
struct RockyCliOptions
Defined in include/rocky/cli.h:10
Generated by Moxygen