Zen-C
Loading...
Searching...
No Matches
typecheck.h File Reference
#include "ast.h"
#include "parser.h"
Include dependency graph for typecheck.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TypeChecker
 Type Checker Context. More...
 

Typedefs

typedef struct TypeChecker TypeChecker
 Type Checker Context.
 

Functions

int check_program (ParserContext *ctx, ASTNode *root)
 Main Type Checking Entry Point.
 

Typedef Documentation

◆ TypeChecker

typedef struct TypeChecker TypeChecker

Type Checker Context.

Holds the state during the semantic analysis pass. Unlike the parser, this focuses on semantic validity (types, definitions, correctness).

Function Documentation

◆ check_program()

int check_program ( ParserContext ctx,
ASTNode root 
)

Main Type Checking Entry Point.

Performs semantic analysis on the entire AST.

Parameters
ctxGlobal parser context.
rootRoot AST node of the program.
Returns
0 on success (no errors), non-zero if errors occurred.