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