ch3-If else
2019-10-24
if-else
unique-if, unique0-if
unique-if
evaluates conditions in any order and does the following :
- report an error when none of the
if
conditions match unless there is an explicitelse
. - report an erorr when there is more than 1 match found in the
if else
conditions
Unlike unique-if, unique0-if does not report a violation if none of the conditions match
unique-if:有且只有一个分支匹配。
unique0-if:有一个或者零个分支被匹配。
No else block for unique-if
1 |
|
Simulation Log
1 |
|
priority-if
priority-if
evaluates all conditions in sequential order and a violation is reported when:
- None of the conditions are true or if there’s no
else
clause to the finalif
construct
第一次匹配成功立即退出if-else。
No else clause in priority-if
1 |
|
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!