Navigation
API > API/Runtime > API/Runtime/VerseCompiler > API/Runtime/VerseCompiler/Node
Description
WHY THIS DESIGN ?
(1) Readability. All the pretty printing code is co-located. It is easier to work on and to understand. (2) Design flexibility: Policy Pattern lets pipeline stages live outside of the node class.
e.g. The PrettyPrinter is easier to understand because you can read and step through the code without leaving a single file. The implementation can live in a Toolchain module. You can easily swap out to a different pretty printer implementation without touching the Vst nodes.
If changing this design (perhaps to improve performance), make sure to preserve both properties.NEEDS IMPROVEMENT
When implementing a VisitPolicy, a programmer must implement every method for every type. This is not necessarily desirable. Especially true for certain semantic compiler passes.
| Name | VisitWith |
| Type | function |
| Header File | /Engine/Source/Runtime/VerseCompiler/Public/uLang/Syntax/VstNode.h |
| Include Path | #include "uLang/Syntax/VstNode.h" |
template<class VisitPolicy, typename ReturnType>
static void VisitWith
(
const TSRef< Vst::Node > & node,
VisitPolicy & visit_policy
)