Class CfgBuilder
java.lang.Object
software.amazon.smithy.rulesengine.logic.cfg.CfgBuilder
Builder for constructing Control Flow Graphs with node deduplication.
This builder performs hash-consing during construction to share identical subtrees and prevent exponential growth.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuild the CFG with the given root node.createCondition
(Condition condition, CfgNode trueBranch, CfgNode falseBranch) Creates a condition node, reusing existing nodes when possible.createCondition
(ConditionReference condRef, CfgNode trueBranch, CfgNode falseBranch) Creates a condition node, reusing existing nodes when possible.createConditionReference
(Condition condition) Creates a canonical condition reference, handling negation and deduplication.createResult
(Rule rule) Creates a result node representing a terminal rule evaluation.
-
Constructor Details
-
CfgBuilder
-
-
Method Details
-
build
Build the CFG with the given root node.- Parameters:
root
- Root node to use for the built CFG.- Returns:
- the built CFG.
-
createCondition
Creates a condition node, reusing existing nodes when possible. -
createCondition
Creates a condition node, reusing existing nodes when possible. -
createResult
Creates a result node representing a terminal rule evaluation. -
createConditionReference
Creates a canonical condition reference, handling negation and deduplication.
-