4.3.9. If Rule

[Tip]Description

An if ruleis a conditional rule that defines a binary branch in the flow of execution similar to the conditional instructions of programming languages.

[Important]Syntax
IfRuleAST ::= if ( LogicalTermAST ) AsmRuleAST 
            | if ( LogicalTermAST ) AsmRuleAST else AsmRuleAST

The if rule has a condition, which is a logical term and it contains a mandatory and an optional ASM rule.

[Note]Semantics

During the interpretation of the if rule, the logical term is evaluated and if it is true then the first ASM rule is executed otherwise the second ASM rule is executed (if the else branch exists).

The execution of the if rule fails, when the execution of the selected branch fails.

Defined In:  compound rule

See Also:  try rule