The C Parser System
Page Status
This page is a placeholder. Content coming soon.
A standalone subsystem that deserves dedicated documentation since it is non-trivial and critical for the import pipeline.
Purpose: parse pokeemerald C/C++ header files to discover enum declarations,
#defineconstants,INCBINpaths, function definitions, struct declarations, designated initializer listsLocation:
utilities/c_parser/– lives in utilities because it has zero project-specific dependenciesArchitecture: lexer (
lexer.hpp) -> token stream (token.hpp) -> parser (parser.hpp) -> AST node typesAST node types and what each represents:
EnumDeclaration/EnumMember,DefineStatement,IncbinDeclarationFunctionDefinition/FunctionCallInfo,StructVariableDeclaration/DesignatedInitializerFieldArrayDeclaration
CParserFacade: high-level entry point that wraps the lexer+parserHow the import pipeline uses it:
HeaderBehaviorMapProviderreadsmetatile_behaviors.h,HeaderDefineProviderreadsfieldmap.h, import use case readsgraphics.handtileset_anims.cTesting the parser: unit tests with string inputs, no file I/O needed
Cross-references: Data Flow and Compilation Pipelines for how import uses the parser, Layered Architecture and DDD for why it lives in utilities