Navigation
API > API/Runtime > API/Runtime/VerseCompiler
Conditional flow control with failure context in test condition.
Children are Clause block nodes in the following order:
- if_identifier ]
- condition |- Repeating
- [then_body] ]
- [else_body] Optional last node
If Identifier blocks - must be present and is simply an empty Clause meant to hold information about comments surrounding the 'if' identifier in the original source code Condition blocks - must be present (they cannot be omitted - there must be at least 1) and they must have 1 or more expressions where 1 or more of the expressions can fail. Any local variables within it's top scope are made available to any immediately following then block. Then blocks - are optional (they can be omitted) and when present must follow a conditional block and may have zero (can be empty) or more expressions. Else block - is optional (it can be omitted) and when present must follow a conditional or then block (it cannot be the only block), must be the last block and it may have zero (can be empty) or more expressions.
Chained `else if_ are automatically flattened into a single FlowIf node with multiple condition/[then] block pairs followed by an optional else block.
An `if_ may be used as an expression with a result if all the control flow paths have a common result - i.e. it will have a result if every condition is paired with a then block and there is an ending else block and all the then blocks and else block have a most common result type.
| Name | FlowIf |
| Type | struct |
| Header File | /Engine/Source/Runtime/VerseCompiler/Public/uLang/Syntax/VstNode.h |
| Include Path | #include "uLang/Syntax/VstNode.h" |
Syntax
struct FlowIf : public Verse::Vst::Node
Inheritance Hierarchy
- CSharedMix → Node → FlowIf
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FlowIf
(
const SLocus& Whence |
uLang/Syntax/VstNode.h |
Enums
Public
| Name | Remarks |
|---|---|
| ClauseTag | Tags for different kinds of clause block children. |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| StaticType | const Vst::NodeType | uLang/Syntax/VstNode.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddBody
(
const TSRef< Node >& Child |
uLang/Syntax/VstNode.h | ||
void AddCondition
(
const TSRef< Node >& Child |
uLang/Syntax/VstNode.h | ||
void AddElseBody
(
const TSRef< Node >& Child |
uLang/Syntax/VstNode.h | ||
void AddIfIdentifier
(
const TSRef< Node >& Child |
uLang/Syntax/VstNode.h |
Overridden from Node
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSRef< Node > CloneNode() |
uLang/Syntax/VstNode.h |