blob: 878365c97dd46f1cd608f81f0d5c37990c805a5b [file] [log] [blame]
/**
## Control structures
See [Control structures](control-flow.html)
*/
controlStructureBody
: block
: blockLevelExpression
;
if
: "if" "(" expression ")" controlStructureBody SEMI? ("else" controlStructureBody)?
;
try
: "try" block catchBlock* finallyBlock?
;
catchBlock
: "catch" "(" annotations SimpleName ":" userType ")" block
;
finallyBlock
: "finally" block
;
loop
: for
: while
: doWhile
;
for
: "for" "(" annotations (multipleVariableDeclarations | variableDeclarationEntry) "in" expression ")" controlStructureBody
;
while
: "while" "(" expression ")" controlStructureBody
;
doWhile
: "do" controlStructureBody "while" "(" expression ")"
;