Zen-C
Loading...
Searching...
No Matches
typecheck.h
Go to the documentation of this file.
1#ifndef TYPECHECK_H
2#define TYPECHECK_H
3
4#include "ast.h"
5#include "parser.h"
6
7// Type Checker Context
8// Holds the state during the semantic analysis pass.
9// Unlike the parser, this focuses on semantic validity (types, definitions).
16typedef struct TypeChecker
17{
22 int warning_count; // Number of recommendations/warnings.
24
34int check_program(ParserContext *ctx, ASTNode *root);
35
36#endif // TYPECHECK_H
Definition ast.h:187
Global compilation state and symbol table.
Definition parser.h:275
Represents a lexical scope (block).
Definition parser.h:68
Type Checker Context.
Definition typecheck.h:17
ParserContext * pctx
Reference to global parser context (for lookups).
Definition typecheck.h:18
ASTNode * current_func
Current function being checked (for return type checks).
Definition typecheck.h:20
int warning_count
Definition typecheck.h:22
int error_count
Number of type errors found.
Definition typecheck.h:21
Scope * current_scope
Current lexical scope during traversal.
Definition typecheck.h:19
int check_program(ParserContext *ctx, ASTNode *root)
Main Type Checking Entry Point.
Definition typecheck.c:400