parsers.cpp

C/C++ regex-based parser. Extracts functions, classes, and structs from C/C++ source and header files.

📄 /home/runner/work/autoredocs/autoredocs/src/autoredocs/parsers/cpp.py

Classes

class
class CppParser(BaseParser)
Regex-based parser for C/C++ source and header files.
📍 Line 69

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.
📍 Line 179
def
def _build_doc_map(source: str) -> dict[int, str]
Map positions to preceding doc comments (block or line style).
📍 Line 192
def
def _clean_doxygen_block(raw: str) -> str
Clean a Doxygen block comment.
📍 Line 209
def
def _clean_doxygen_lines(raw: str) -> str
Clean Doxygen line comments (/// or //!).
📍 Line 226
def
def _parse_cpp_params(raw: str) -> list[ArgInfo]
Parse C/C++ function parameters.
📍 Line 244