|
Zen-C
|
#include "../codegen/codegen.h"#include "../zen/zen_facts.h"#include "parser.h"#include <ctype.h>#include <libgen.h>#include <stdio.h>#include <stdlib.h>#include <string.h>
Functions | |
| int | check_opaque_alias_compat (ParserContext *ctx, Type *a, Type *b) |
| Checks compatibility of opaque aliases (allows access within defining file). | |
| char * | resolve_struct_name_from_type (ParserContext *ctx, Type *t, int *is_ptr_out, char **allocated_out) |
| int | is_struct_type (ParserContext *ctx, const char *type_name) |
| Type * | get_field_type (ParserContext *ctx, Type *struct_type, const char *field_name) |
| char * | infer_type (ParserContext *ctx, ASTNode *node) |
| int | is_type_copy (ParserContext *ctx, Type *t) |
| Checks if a type is copyable. | |
| void | check_move_usage (ParserContext *ctx, ASTNode *node, Token t) |
| Checks if a type is copyable. | |
| ASTNode * | parse_expression (ParserContext *ctx, Lexer *l) |
| Parses an expression. | |
| Precedence | get_token_precedence (Token t) |
| void | analyze_lambda_captures (ParserContext *ctx, ASTNode *lambda) |
| Analyzes lambda captures. | |
| ASTNode * | parse_lambda (ParserContext *ctx, Lexer *l) |
| Parses a lambda. | |
| ASTNode * | parse_primary (ParserContext *ctx, Lexer *l) |
| Parses a primary expression (literal, variable, grouping). | |
| int | is_comparison_op (const char *op) |
| const char * | get_operator_method (const char *op) |
| ASTNode * | parse_expr_prec (ParserContext *ctx, Lexer *l, Precedence min_prec) |
| Parses an expression with minimum precedence. | |
| ASTNode * | parse_arrow_lambda_single (ParserContext *ctx, Lexer *l, char *param_name) |
| Parses a single parameter arrow lambda. | |
| ASTNode * | parse_arrow_lambda_multi (ParserContext *ctx, Lexer *l, char **param_names, int num_params) |
| Parses a multi-parameter arrow lambda. | |
Variables | |
| ASTNode * | global_user_structs |
| List of user defined structs. | |
| void analyze_lambda_captures | ( | ParserContext * | ctx, |
| ASTNode * | lambda | ||
| ) |
Analyzes lambda captures.


| void check_move_usage | ( | ParserContext * | ctx, |
| ASTNode * | node, | ||
| Token | t | ||
| ) |
Checks if a type is copyable.


| int check_opaque_alias_compat | ( | ParserContext * | ctx, |
| Type * | a, | ||
| Type * | b | ||
| ) |
Checks compatibility of opaque aliases (allows access within defining file).


| Type * get_field_type | ( | ParserContext * | ctx, |
| Type * | struct_type, | ||
| const char * | field_name | ||
| ) |


| const char * get_operator_method | ( | const char * | op | ) |

| Precedence get_token_precedence | ( | Token | t | ) |


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

| int is_comparison_op | ( | const char * | op | ) |

| int is_struct_type | ( | ParserContext * | ctx, |
| const char * | type_name | ||
| ) |

| int is_type_copy | ( | ParserContext * | ctx, |
| Type * | t | ||
| ) |
Checks if a type is copyable.


| ASTNode * parse_arrow_lambda_multi | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| char ** | param_names, | ||
| int | num_params | ||
| ) |
Parses a multi-parameter arrow lambda.


| ASTNode * parse_arrow_lambda_single | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| char * | param_name | ||
| ) |
Parses a single parameter arrow lambda.


| ASTNode * parse_expr_prec | ( | ParserContext * | ctx, |
| Lexer * | l, | ||
| Precedence | min_prec | ||
| ) |
Parses an expression with minimum precedence.


| ASTNode * parse_expression | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses an expression.


| ASTNode * parse_lambda | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a lambda.


| ASTNode * parse_primary | ( | ParserContext * | ctx, |
| Lexer * | l | ||
| ) |
Parses a primary expression (literal, variable, grouping).

| char * resolve_struct_name_from_type | ( | ParserContext * | ctx, |
| Type * | t, | ||
| int * | is_ptr_out, | ||
| char ** | allocated_out | ||
| ) |


|
extern |
List of user defined structs.