66 CParserFacade(std::filesystem::path file_path, gsl::not_null<const TextFormatter *> format);
143 parse_functions(
const std::optional<std::string> &name_prefix = std::nullopt);
255 [[nodiscard]]
const std::vector<std::string> &
file_lines()
const;
260 std::filesystem::path file_path_;
262 std::vector<std::string> file_lines_;
263 std::string content_;
264 std::unique_ptr<CParserContext> context_;
266 bool load_failed_{
false};
268 std::optional<std::vector<DefineStatement>> cached_defines_;
High-level facade for parsing C/C++ source files.
const std::vector< std::string > & file_lines() const
Returns the cached file lines.
ChainableResult< std::vector< IncbinDeclaration > > parse_incbin_arrays(const std::optional< std::string > &name_prefix=std::nullopt)
Parses INCBIN array declarations from the file.
ChainableResult< std::vector< EnumDeclaration > > parse_enums()
Parses all enum declarations from the file.
ChainableResult< std::vector< StructVariableDeclaration > > parse_struct_variables(const std::optional< std::string > &name_prefix=std::nullopt)
Parses struct variable declarations from the file.
ChainableResult< std::vector< DefineStatement > > parse_defines()
Parses all #define statements from the file.
ChainableResult< std::optional< DefineStatement > > find_define(const std::string &define_name)
Finds a specific #define statement by name.
ChainableResult< std::vector< FunctionDefinition > > parse_functions(const std::optional< std::string > &name_prefix=std::nullopt)
Parses function definitions from the file.
ChainableResult< std::vector< StructInitializerDeclaration > > parse_struct_initializers(const std::optional< std::string > &name_prefix=std::nullopt)
Parses struct variable declarations with their designated initializer fields.
ChainableResult< std::vector< ArrayDeclaration > > parse_pointer_arrays(const std::optional< std::string > &name_prefix=std::nullopt)
Parses all pointer array declarations from the file.
A result type that maintains a chainable sequence of errors for debugging and error reporting.
Abstract base class for applying text styling with context-aware formatting.