|
statement : iteration_statement | branching_statement | block_statement | expression_statement | empty_statement
iteration_statement : for_statement | while_statement | do_statement | foreach_statement | foreachstr_statement
foreach_statement : 'foreach' '(' variable 'in' expression ')' statement
The foreach
statement iterates over all objects contained in a SimSet.
foreach( %obj in RootGroup ) echo( %obj.getName() );
foreachstr_statement : 'foreach$' '(' variable 'in' expression ')' statement
The foreach$
statement iterates over all words in a string. Words are separated by newlines, spaces, and/or tabs.
foreach$( %str in "a b c d" ) echo( %str );
if_statement : 'if' '(' expression ')' statement | 'if' '(' expression ')' statement 'else' statement