blob: e1d285f885d9595125e67994a248d2c5c2a8f850 [file] [log] [blame] [edit]
/**
h2. Control structures
bq. See [Control structures]
*/
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 ")"
;