public ConditionalBranch build(RuleBuildContext context, BaseDescr descr) {
return build( context, descr, null );
}
public ConditionalBranch build(RuleBuildContext context, BaseDescr descr, Pattern prefixPattern) {
ConditionalBranchDescr conditionalBranch = (ConditionalBranchDescr) descr;
RuleConditionBuilder evalBuilder = (RuleConditionBuilder) context.getDialect().getBuilder( EvalDescr.class );
EvalCondition condition = (EvalCondition) evalBuilder.build(context, conditionalBranch.getCondition(), getLastPattern(context));
NamedConsequenceBuilder namedConsequenceBuilder = (NamedConsequenceBuilder) context.getDialect().getBuilder( NamedConsequenceDescr.class );
NamedConsequence consequence = namedConsequenceBuilder.build(context, conditionalBranch.getConsequence());
ConditionalBranchDescr elseBranchDescr = conditionalBranch.getElseBranch();
return new ConditionalBranch( condition, consequence, elseBranchDescr != null ? build(context, elseBranchDescr, prefixPattern) : null );
}