parsers.cpp
C/C++ regex-based parser. Extracts functions, classes, and structs from C/C++ source and header files.
Contents
Classes
class
class CppParser(BaseParser)
Regex-based parser for C/C++ source and header files.
Methods
def
def parse_file(self, filepath: str | Path) -> ModuleDoc | None
Parse a C/C++ source file and return a ModuleDoc.
def
def _extract_methods(self, source: str, body_start: int, parent_doc_map: dict[int, str]) -> list[FunctionDoc]
Extract methods from a class body.
Functions
def
def _extract_brace_body(source: str, start: int) -> str
Extract text inside braces starting at position.
def
def _build_doc_map(source: str) -> dict[int, str]
Map positions to preceding doc comments (block or line style).
def
def _clean_doxygen_block(raw: str) -> str
Clean a Doxygen block comment.
def
def _clean_doxygen_lines(raw: str) -> str
Clean Doxygen line comments (/// or //!).
def
def _parse_cpp_params(raw: str) -> list[ArgInfo]
Parse C/C++ function parameters.