|
Zen-C
|
Global compilation state and symbol table. More...
#include <parser.h>

Data Fields | |
| Scope * | current_scope |
| Current lexical scope for variable lookup. | |
| FuncSig * | func_registry |
| Registry of declared function signatures. | |
| LambdaRef * | global_lambdas |
| List of all lambdas generated during parsing. | |
| int | lambda_counter |
| Counter for generating unique lambda IDs. | |
| char * | known_generics [MAX_KNOWN_GENERICS] |
| Stack of currently active generic type parameters. | |
| int | known_generics_count |
| Count of active generic parameters. | |
| GenericTemplate * | templates |
| Struct generic templates. | |
| GenericFuncTemplate * | func_templates |
| Function generic templates. | |
| GenericImplTemplate * | impl_templates |
| Implementation block templates. | |
| Instantiation * | instantiations |
| Cache of instantiated generic types. | |
| ASTNode * | instantiated_structs |
| List of AST nodes for instantiated structs. | |
| ASTNode * | instantiated_funcs |
| List of AST nodes for instantiated functions. | |
| StructRef * | parsed_structs_list |
| List of all parsed struct nodes. | |
| StructRef * | parsed_enums_list |
| List of all parsed enum nodes. | |
| StructRef * | parsed_funcs_list |
| List of all parsed function nodes. | |
| StructRef * | parsed_impls_list |
| List of all parsed impl blocks. | |
| StructRef * | parsed_globals_list |
| List of all parsed global variables. | |
| StructDef * | struct_defs |
| Registry of struct definitions (map name -> node). | |
| EnumVariantReg * | enum_variants |
| Registry of enum variants for global lookup. | |
| ImplReg * | registered_impls |
| Cache of type/trait implementations. | |
| SliceType * | used_slices |
| Cache of generated slice types. | |
| TupleType * | used_tuples |
| Cache of generated tuple types. | |
| TypeAlias * | type_aliases |
| Defined type aliases. | |
| Module * | modules |
| List of registered modules. | |
| SelectiveImport * | selective_imports |
Symbols imported via import { ... }. | |
| char * | current_module_prefix |
| Prefix for current module (namespacing). | |
| ImportedFile * | imported_files |
| List of files already included/imported. | |
| ImportedPlugin * | imported_plugins |
| List of active plugins. | |
| char * | current_impl_struct |
| Name of struct currently being implemented (in impl block). | |
| ASTNode * | current_impl_methods |
| Head of method list for current impl block. | |
| DeprecatedFunc * | deprecated_funcs |
| Registry of deprecated functions. | |
| int | is_fault_tolerant |
| 1 if parser should recover from errors (LSP mode). | |
| void * | error_callback_data |
| User data for error callback. | |
| void(* | on_error )(void *data, Token t, const char *msg) |
| Callback for reporting errors. | |
| ZenSymbol * | all_symbols |
| comprehensive list of all symbols seen. | |
| int | has_external_includes |
Set when #include <...> is used. | |
| char ** | extern_symbols |
| Explicitly declared extern symbols. | |
| int | extern_symbol_count |
| Count of external symbols. | |
| FILE * | hoist_out |
| File stream for hoisting code (e.g. from plugins). | |
| int | skip_preamble |
| If 1, codegen won't emit standard preamble (includes etc). | |
| int | is_repl |
| 1 if running in REPL mode. | |
| int | has_async |
| 1 if async/await features are used in the program. | |
| int | in_defer_block |
| 1 if currently parsing inside a defer block. | |
| struct TypeUsage * | pending_type_validations |
| List of types to validate after parsing. | |
| int | is_speculative |
| Flag to suppress side effects during speculative parsing. | |
| int | silent_warnings |
| Suppress warnings (e.g., during codegen interpolation). | |
Global compilation state and symbol table.
ParserContext maintains the state of the compiler during parsing and analysis. It holds symbol tables, type definitions, function registries, and configuration.
| ZenSymbol* ParserContext::all_symbols |
comprehensive list of all symbols seen.
| ASTNode* ParserContext::current_impl_methods |
Head of method list for current impl block.
| char* ParserContext::current_impl_struct |
Name of struct currently being implemented (in impl block).
| char* ParserContext::current_module_prefix |
Prefix for current module (namespacing).
| Scope* ParserContext::current_scope |
Current lexical scope for variable lookup.
| DeprecatedFunc* ParserContext::deprecated_funcs |
Registry of deprecated functions.
| EnumVariantReg* ParserContext::enum_variants |
Registry of enum variants for global lookup.
| void* ParserContext::error_callback_data |
User data for error callback.
| int ParserContext::extern_symbol_count |
Count of external symbols.
| char** ParserContext::extern_symbols |
Explicitly declared extern symbols.
| FuncSig* ParserContext::func_registry |
Registry of declared function signatures.
| GenericFuncTemplate* ParserContext::func_templates |
Function generic templates.
| LambdaRef* ParserContext::global_lambdas |
List of all lambdas generated during parsing.
| int ParserContext::has_async |
1 if async/await features are used in the program.
| int ParserContext::has_external_includes |
Set when #include <...> is used.
| FILE* ParserContext::hoist_out |
File stream for hoisting code (e.g. from plugins).
| GenericImplTemplate* ParserContext::impl_templates |
Implementation block templates.
| ImportedFile* ParserContext::imported_files |
List of files already included/imported.
| ImportedPlugin* ParserContext::imported_plugins |
List of active plugins.
| int ParserContext::in_defer_block |
1 if currently parsing inside a defer block.
| ASTNode* ParserContext::instantiated_funcs |
List of AST nodes for instantiated functions.
| ASTNode* ParserContext::instantiated_structs |
List of AST nodes for instantiated structs.
| Instantiation* ParserContext::instantiations |
Cache of instantiated generic types.
| int ParserContext::is_fault_tolerant |
1 if parser should recover from errors (LSP mode).
| int ParserContext::is_repl |
1 if running in REPL mode.
| int ParserContext::is_speculative |
Flag to suppress side effects during speculative parsing.
| char* ParserContext::known_generics[MAX_KNOWN_GENERICS] |
Stack of currently active generic type parameters.
| int ParserContext::known_generics_count |
Count of active generic parameters.
| int ParserContext::lambda_counter |
Counter for generating unique lambda IDs.
| Module* ParserContext::modules |
List of registered modules.
| void(* ParserContext::on_error) (void *data, Token t, const char *msg) |
Callback for reporting errors.
| StructRef* ParserContext::parsed_enums_list |
List of all parsed enum nodes.
| StructRef* ParserContext::parsed_funcs_list |
List of all parsed function nodes.
| StructRef* ParserContext::parsed_globals_list |
List of all parsed global variables.
| StructRef* ParserContext::parsed_impls_list |
List of all parsed impl blocks.
| StructRef* ParserContext::parsed_structs_list |
List of all parsed struct nodes.
| struct TypeUsage* ParserContext::pending_type_validations |
List of types to validate after parsing.
| ImplReg* ParserContext::registered_impls |
Cache of type/trait implementations.
| SelectiveImport* ParserContext::selective_imports |
Symbols imported via import { ... }.
| int ParserContext::silent_warnings |
Suppress warnings (e.g., during codegen interpolation).
| int ParserContext::skip_preamble |
If 1, codegen won't emit standard preamble (includes etc).
| StructDef* ParserContext::struct_defs |
Registry of struct definitions (map name -> node).
| GenericTemplate* ParserContext::templates |
Struct generic templates.
| TypeAlias* ParserContext::type_aliases |
Defined type aliases.
| SliceType* ParserContext::used_slices |
Cache of generated slice types.
| TupleType* ParserContext::used_tuples |
Cache of generated tuple types.