|
Zen-C
|
#include "../ast/ast.h"#include "../parser/parser.h"#include "../zprep.h"#include "codegen.h"#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>
Functions | |
| char * | strip_template_suffix (const char *name) |
| void | emit_c_decl (ParserContext *ctx, FILE *out, const char *type_str, const char *name) |
| void | emit_var_decl_type (ParserContext *ctx, FILE *out, const char *type_str, const char *var_name) |
| ASTNode * | find_struct_def_codegen (ParserContext *ctx, const char *name) |
| char * | get_field_type_str (ParserContext *ctx, const char *struct_name, const char *field_name) |
| char * | infer_type (ParserContext *ctx, ASTNode *node) |
| char * | extract_call_args (const char *args) |
| const char * | parse_original_method_name (const char *mangled) |
| char * | replace_string_type (const char *args) |
| void | emit_auto_type (ParserContext *ctx, ASTNode *init_expr, Token t, FILE *out) |
| char * | codegen_type_to_string (Type *t) |
| void | emit_func_signature (ParserContext *ctx, FILE *out, ASTNode *func, const char *name_override) |
| int | emit_move_invalidation (ParserContext *ctx, ASTNode *node, FILE *out) |
| void | codegen_expression_with_move (ParserContext *ctx, ASTNode *node, FILE *out) |
Variables | |
| ASTNode * | global_user_structs = NULL |
| List of user defined structs. | |
| char * | g_current_impl_type = NULL |
| Type currently being implemented (in impl block). | |
| int | tmp_counter = 0 |
| Counter for temporary variables. | |
| ASTNode * | defer_stack [MAX_DEFER] |
| Stack of deferred nodes. | |
| int | defer_count = 0 |
| Counter for defer statements in current scope. | |
| ASTNode * | g_current_lambda = NULL |
| Current lambda being generated. | |
| int | loop_defer_boundary [MAX_LOOP_DEPTH] |
| Defer stack index at start of each loop. | |
| int | loop_depth = 0 |
| Current loop nesting depth. | |
| int | func_defer_boundary = 0 |
| Defer stack index at function entry. | |
| void codegen_expression_with_move | ( | ParserContext * | ctx, |
| ASTNode * | node, | ||
| FILE * | out | ||
| ) |


| char * codegen_type_to_string | ( | Type * | t | ) |


| void emit_auto_type | ( | ParserContext * | ctx, |
| ASTNode * | init_expr, | ||
| Token | t, | ||
| FILE * | out | ||
| ) |


| void emit_c_decl | ( | ParserContext * | ctx, |
| FILE * | out, | ||
| const char * | type_str, | ||
| const char * | name | ||
| ) |


| void emit_func_signature | ( | ParserContext * | ctx, |
| FILE * | out, | ||
| ASTNode * | func, | ||
| const char * | name_override | ||
| ) |


| int emit_move_invalidation | ( | ParserContext * | ctx, |
| ASTNode * | node, | ||
| FILE * | out | ||
| ) |


| void emit_var_decl_type | ( | ParserContext * | ctx, |
| FILE * | out, | ||
| const char * | type_str, | ||
| const char * | var_name | ||
| ) |


| char * extract_call_args | ( | const char * | args | ) |


| ASTNode * find_struct_def_codegen | ( | ParserContext * | ctx, |
| const char * | name | ||
| ) |

| char * get_field_type_str | ( | ParserContext * | ctx, |
| const char * | struct_name, | ||
| const char * | field_name | ||
| ) |


| char * infer_type | ( | ParserContext * | ctx, |
| ASTNode * | node | ||
| ) |


| const char * parse_original_method_name | ( | const char * | mangled | ) |

| char * replace_string_type | ( | const char * | args | ) |


| char * strip_template_suffix | ( | const char * | name | ) |


| int defer_count = 0 |
Counter for defer statements in current scope.
| int func_defer_boundary = 0 |
Defer stack index at function entry.
| char* g_current_impl_type = NULL |
Type currently being implemented (in impl block).
| ASTNode* g_current_lambda = NULL |
Current lambda being generated.
| ASTNode* global_user_structs = NULL |
List of user defined structs.
| int loop_defer_boundary[MAX_LOOP_DEPTH] |
Defer stack index at start of each loop.
| int loop_depth = 0 |
Current loop nesting depth.
| int tmp_counter = 0 |
Counter for temporary variables.