List of functions in the ude.parsers.native_cpp_syntactic_backend namespace.

Entity NameDescription
_has_naked_top_level_entitySelf-containment check for a *.inl.hpp impl-only header, adopted after directly confirming two real corpus examples (mat.inl.hpp, matx.inl.hpp) each wrap their entire content in their own namespace cv { ... } – but NOT assuming every such file everywhere does the same. #included mid-parent-header content relying on an already-open namespace it never reopens itself is completely legal C++ (the preprocessor is purely textual substitution; nothing requires a included file to be self-contained) – parsing that kind of file standalone would silently misattribute its entities to the global namespace instead of just omitting them, which is worse than the already-accepted “some entities in impl-only headers are missing” gap. So: parse the file’s own text, and only trust it (attribute its entities as found) if EVERY entity-shaped node is nested inside at least one namespace_definition – any entity sitting directly at file scope is treated as a signal this file assumes external context, and the whole file is skipped, matching the previous unconditional- exclusion behavior for exactly that file.
_visible
_split_macro_nameSplits a native-style macro config entry (e.g. “CV_EXPORTS”, “_WIN32=1”, “CV_EXPORTS_AS(x)=”) into (bare_name, is_function_like).
_to_pcpp_defineConverts a native-style macro config entry into a pcpp #define body (the part after #define), e.g. “CV_EXPORTS_W=” -> “CV_EXPORTS_W”, “_WIN32=1” -> “_WIN32 1”, “CV_EXPORTS_AS(x)=” -> “CV_EXPORTS_AS(x)”.
_blank_annotation_macrosReplaces known macro names with equal-length whitespace, in place.
_expand_function_like_macrosSplices a real, already-computed macro expansion into its own invocation’s exact byte span, in place – the sibling of _blank_annotation_macros above, same per-line/skip-directive-line/NAME\\s*\\([^()]*\\) matching shape, but substituting real expansion text instead of blanking to whitespace (DEL-B33, 2026-09-27).

Generated with Flude

Copyright © 2026

Directory & Entity Index

Entity NameSummary / Description
_blank_annotation_macros function

Replaces known macro names with equal-length whitespace, in place.

Object-like macros (CV_EXPORTS) and their attribute-macro cousins (__declspec/attribute) sit where tree-sitter’s grammar expects a real identifier/qualifier – unrecognized, they don’t just vanish (the way a real preprocessor would remove them); they derail the grammar into a structurally wrong tree (e.g. class CV_EXPORTS Foo { ... }; parses as a bogus top-level function named Foo, swallowing the whole class body). Blanking to whitespace of the same byte length keeps every other byte offset/line number identical to the original file, so comment-adjacency (prev_sibling) and all other position-based logic need no changes.

_expand_function_like_macros function

Splices a real, already-computed macro expansion into its own invocation’s exact byte span, in place – the sibling of _blank_annotation_macros above, same per-line/skip-directive-line/NAME\\s*\\([^()]*\\) matching shape, but substituting real expansion text instead of blanking to whitespace (DEL-B33, 2026-09-27).

expansions and function_like_macro_names come from _run_preprocessor_pass’s single real pcpp pass – expansions maps a 1-indexed line number to that line’s OWN already-expanded text (correctly positioned there because pcpp’s expanded tokens carry the invocation’s own line number, not the macro definition’s – confirmed directly, see _run_preprocessor_pass’s docstring), and function_like_macro_names is every macro pcpp resolved to be function-like by the end of that same pass (predefined, manually configured, or discovered via a real #include) – driving which names this function’s own regex looks for, the same role self.macros plays for _blank_annotation_macros’s regex.

_has_naked_top_level_entity function

Self-containment check for a *.inl.hpp impl-only header, adopted after directly confirming two real corpus examples (mat.inl.hpp, matx.inl.hpp) each wrap their entire content in their own namespace cv { ... } – but NOT assuming every such file everywhere does the same. #included mid-parent-header content relying on an already-open namespace it never reopens itself is completely legal C++ (the preprocessor is purely textual substitution; nothing requires a included file to be self-contained) – parsing that kind of file standalone would silently misattribute its entities to the global namespace instead of just omitting them, which is worse than the already-accepted “some entities in impl-only headers are missing” gap. So: parse the file’s own text, and only trust it (attribute its entities as found) if EVERY entity-shaped node is nested inside at least one namespace_definition – any entity sitting directly at file scope is treated as a signal this file assumes external context, and the whole file is skipped, matching the previous unconditional- exclusion behavior for exactly that file.

_split_macro_name function

Splits a native-style macro config entry (e.g. “CV_EXPORTS”, “_WIN32=1”, “CV_EXPORTS_AS(x)=”) into (bare_name, is_function_like).

Methods

_split_macro_name

_split_macro_name(macro: str) -> Tuple[str, bool]

Splits a native-style macro config entry (e.g. “CV_EXPORTS”, “_WIN32=1”, “CV_EXPORTS_AS(x)=”) into (bare_name, is_function_like).

ParameterTypeDescription
macrostr

Generated with Flude

Copyright © 2026

_to_pcpp_define function

Converts a native-style macro config entry into a pcpp #define body (the part after #define), e.g. “CV_EXPORTS_W=” -> “CV_EXPORTS_W”, “_WIN32=1” -> “_WIN32 1”, “CV_EXPORTS_AS(x)=” -> “CV_EXPORTS_AS(x)”.

Methods

_to_pcpp_define

_to_pcpp_define(macro: str) -> str

Converts a native-style macro config entry into a pcpp #define body (the part after #define), e.g. “CV_EXPORTS_W=” -> “CV_EXPORTS_W”, “_WIN32=1” -> “_WIN32 1”, “CV_EXPORTS_AS(x)=” -> “CV_EXPORTS_AS(x)”.

ParameterTypeDescription
macrostr

Generated with Flude

_visible function

Methods

_visible

_visible(member_visibility: str, min_visibility: str) -> bool

ParameterTypeDescription
member_visibilitystr
min_visibilitystr

Generated with Flude

Copyright © 2026