|
libxr
Embedded C++ framework for bare-metal, RTOS and Linux
|
共享编译期后端,把前端事件整理成最终字节流和参数表 / Shared compile-time backend that turns frontend events into the final byte stream plus argument table. More...
#include <format_compile.hpp>
Static Public Member Functions | |
| static consteval auto | Compile () |
| 把一个前端编译成最终字节流、参数表和 writer 摘要 / Compiles one frontend into the final byte stream, argument table, and writer profile. | |
共享编译期后端,把前端事件整理成最终字节流和参数表 / Shared compile-time backend that turns frontend events into the final byte stream plus argument table.
前端协议: 前端必须提供如下成员:using ErrorType、static constexpr const char* SourceData()、static constexpr size_t SourceSize()、以及 static consteval ErrorType Walk(visitor)。 Frontend contract: The frontend must provide the members using ErrorType, static constexpr const char* SourceData(), static constexpr size_t SourceSize(), and static consteval ErrorType Walk(visitor).
Walk(visitor) 必须按源串顺序发射两类事件:
这个后端只遍历前端一次。那一遍里会同时收集:
最后再把这些临时缓冲收拢成精确尺寸的最终结果。 The backend only walks the frontend once. During that single walk it collects:
Then it packs those scratch buffers into the final exact-size result.
Definition at line 51 of file format_compile.hpp.
|
inlinestaticnodiscardconsteval |
把一个前端编译成最终字节流、参数表和 writer 摘要 / Compiles one frontend into the final byte stream, argument table, and writer profile.
Definition at line 544 of file format_compile.hpp.