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).
16
typedef
struct
TypeChecker
17
{
18
ParserContext
*
pctx
;
19
Scope
*
current_scope
;
20
ASTNode
*
current_func
;
21
int
error_count
;
22
int
warning_count
;
// Number of recommendations/warnings.
23
}
TypeChecker
;
24
34
int
check_program
(
ParserContext
*ctx,
ASTNode
*root);
35
36
#endif
// TYPECHECK_H
ast.h
parser.h
ASTNode
Definition
ast.h:187
ParserContext
Global compilation state and symbol table.
Definition
parser.h:275
Scope
Represents a lexical scope (block).
Definition
parser.h:68
TypeChecker
Type Checker Context.
Definition
typecheck.h:17
TypeChecker::pctx
ParserContext * pctx
Reference to global parser context (for lookups).
Definition
typecheck.h:18
TypeChecker::current_func
ASTNode * current_func
Current function being checked (for return type checks).
Definition
typecheck.h:20
TypeChecker::warning_count
int warning_count
Definition
typecheck.h:22
TypeChecker::error_count
int error_count
Number of type errors found.
Definition
typecheck.h:21
TypeChecker::current_scope
Scope * current_scope
Current lexical scope during traversal.
Definition
typecheck.h:19
check_program
int check_program(ParserContext *ctx, ASTNode *root)
Main Type Checking Entry Point.
Definition
typecheck.c:400
src
analysis
typecheck.h
Generated by
1.9.8