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
IR::Builder Class Reference

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

#include <builder.h>

Collaboration diagram for IR::Builder:

Public Member Functions

 Builder ()=default
Document buildPageIR (const PageNode *pn) const

Detailed Description

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

Builder 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

Builder 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
IR::Document, TemplateGenerator

Definition at line 15 of file builder.h.

Constructor & Destructor Documentation

◆ Builder()

IR::Builder::Builder ( )
default

Member Function Documentation

◆ buildPageIR()

Document IR::Builder::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 66 of file builder.cpp.

References IR::Document::access, Node< _Tp >::access(), Atom::AutoLink, Atom::BriefLeft, Atom::BriefRight, Atom::C, Node< _Tp >::doc(), Text::firstAtom(), IR::Document::genus, Node< _Tp >::genus(), Atom::next(), IR::Document::nodeType, Node< _Tp >::nodeType(), IR::Document::status, Node< _Tp >::status(), 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: