Zen-C
Loading...
Searching...
No Matches
parser_expr.c File Reference
#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>
Include dependency graph for parser_expr.c:

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)
 
Typeget_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.
 
ASTNodeparse_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.
 
ASTNodeparse_lambda (ParserContext *ctx, Lexer *l)
 Parses a lambda.
 
ASTNodeparse_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)
 
ASTNodeparse_expr_prec (ParserContext *ctx, Lexer *l, Precedence min_prec)
 Parses an expression with minimum precedence.
 
ASTNodeparse_arrow_lambda_single (ParserContext *ctx, Lexer *l, char *param_name)
 Parses a single parameter arrow lambda.
 
ASTNodeparse_arrow_lambda_multi (ParserContext *ctx, Lexer *l, char **param_names, int num_params)
 Parses a multi-parameter arrow lambda.
 

Variables

ASTNodeglobal_user_structs
 List of user defined structs.
 

Function Documentation

◆ analyze_lambda_captures()

void analyze_lambda_captures ( ParserContext ctx,
ASTNode lambda 
)

Analyzes lambda captures.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_move_usage()

void check_move_usage ( ParserContext ctx,
ASTNode node,
Token  t 
)

Checks if a type is copyable.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_opaque_alias_compat()

int check_opaque_alias_compat ( ParserContext ctx,
Type a,
Type b 
)

Checks compatibility of opaque aliases (allows access within defining file).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_field_type()

Type * get_field_type ( ParserContext ctx,
Type struct_type,
const char *  field_name 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_operator_method()

const char * get_operator_method ( const char *  op)
Here is the caller graph for this function:

◆ get_token_precedence()

Precedence get_token_precedence ( Token  t)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ infer_type()

char * infer_type ( ParserContext ctx,
ASTNode node 
)
Here is the caller graph for this function:

◆ is_comparison_op()

int is_comparison_op ( const char *  op)
Here is the caller graph for this function:

◆ is_struct_type()

int is_struct_type ( ParserContext ctx,
const char *  type_name 
)
Here is the call graph for this function:

◆ is_type_copy()

int is_type_copy ( ParserContext ctx,
Type t 
)

Checks if a type is copyable.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_arrow_lambda_multi()

ASTNode * parse_arrow_lambda_multi ( ParserContext ctx,
Lexer l,
char **  param_names,
int  num_params 
)

Parses a multi-parameter arrow lambda.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_arrow_lambda_single()

ASTNode * parse_arrow_lambda_single ( ParserContext ctx,
Lexer l,
char *  param_name 
)

Parses a single parameter arrow lambda.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_expr_prec()

ASTNode * parse_expr_prec ( ParserContext ctx,
Lexer l,
Precedence  min_prec 
)

Parses an expression with minimum precedence.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_expression()

ASTNode * parse_expression ( ParserContext ctx,
Lexer l 
)

Parses an expression.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_lambda()

ASTNode * parse_lambda ( ParserContext ctx,
Lexer l 
)

Parses a lambda.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_primary()

ASTNode * parse_primary ( ParserContext ctx,
Lexer l 
)

Parses a primary expression (literal, variable, grouping).

Here is the caller graph for this function:

◆ resolve_struct_name_from_type()

char * resolve_struct_name_from_type ( ParserContext ctx,
Type t,
int *  is_ptr_out,
char **  allocated_out 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ global_user_structs

ASTNode* global_user_structs
extern

List of user defined structs.