1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

support for do ..while

This commit is contained in:
Kevin Glynn 2011-03-02 19:25:41 +01:00
parent 90a3461a27
commit 69315e9b54
2 changed files with 8 additions and 1 deletions

View File

@ -1278,7 +1278,7 @@ iteration_statement:
-> foreach(type = { $local_variable_type.st }, loopid = { $identifier.st }, fromexp = { $expression.st },
block = { $embedded_statement.st }, blockindent = { $embedded_statement.indent });
do_statement:
'do' embedded_statement 'while' '(' boolean_expression ')' ';' ;
'do' embedded_statement 'while' '(' boolean_expression ')' ';' -> do(cond = { $boolean_expression.st }, block = { $embedded_statement.st }, blockindent = { $embedded_statement.indent });
for_initializer:
(local_variable_declaration) => local_variable_declaration -> { $local_variable_declaration.st }
| statement_expression_list -> { $statement_expression_list.st }

View File

@ -172,6 +172,13 @@ while (<cond>)
<block(statements = block)>
>>
do(comments,cond,block) ::= <<
<comments; separator="\n">
do
<block(statements = block)>
while (<cond>);
>>
for(comments,init,cond,iter,block,blockindent) ::= <<
<comments; separator="\n">
for (<init>;<cond>;<iter>)