Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
IRBuilder Class Reference

Builds IR (Intermediate Representation) from QDoc's Node tree. More...

#include <irbuilder.h>

Collaboration diagram for IRBuilder:

Public Member Functions

 IRBuilder ()=default
DocumentIR buildPageIR (const PageNode *pn) const

Detailed Description

Builds IR (Intermediate Representation) from QDoc's Node tree.

IRBuilder is the "compiler" in QDoc's compile/link/render pipeline. It transforms Node objects into format-agnostic IR structures that can be:

\list

  • Rendered to output formats (HTML, Markdown, DocBook) by generators.
  • Written to .index files for cross-module linking.
  • Consumed by other IR processors. \endlist

IRBuilder handles all interaction with Node classes and Atom chains. Generators receive pre-built IR and focus purely on formatting output. This separation enables:

\list

  • Testing IR building independently from rendering.
  • Multiple output formats from the same IR.
  • Clear architectural boundaries. \endlist

During IR building, {local links} (within the same module) are resolved immediately. {Cross-module links} are marked as external with an empty href, to be resolved during the link phase when dependency .index files are available.

See also
DocumentIR, TemplateGenerator

Definition at line 13 of file irbuilder.h.

Constructor & Destructor Documentation

◆ IRBuilder()

IRBuilder::IRBuilder ( )
default

Member Function Documentation

◆ buildPageIR()

DocumentIR IRBuilder::buildPageIR ( const PageNode * pn) const
nodiscard

Build IR for a PageNode.

This method extracts documentation content from the node's atom chain. The brief is stored separately via Doc::briefText(), while body content is extracted by walking the atom chain and collecting text atoms that are not within the brief section.

Note
Currently handles basic text atoms (String, AutoLink, C) and paragraph breaks. More complex atom types (lists, code blocks, images) will be added as the IR layer matures.

Definition at line 64 of file irbuilder.cpp.

References Atom::AutoLink, Atom::BriefLeft, Atom::BriefRight, Atom::C, Node< _Tp >::doc(), Text::firstAtom(), Atom::next(), Atom::String, and Atom::type().

Referenced by TemplateGenerator::generatePageNode().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: