WHILE...END

Top  Previous  Next

Scripts > Productions > WHILE...END

 

Similar to the IF structure in a WHILE...END structure the decision whether a branch is executed is done by a boolean expression.

 

This structure has more exactly the form:

 

WHILE( boolean expression )

while branch

END

 

The while-branch is a concatenation or grouping of tokens and semantic actions.

 

The boolean expression always is interpretable and exportable.

 

Example

 

 

NUMBER

{{

int i = 0, iCount = xState.itg();

}}

WHILE(i < iCount)

ReadData  {{ i++; }}

END

 

At first the number of following data records is read and then by ReadData the data records are read themselves.

 

 

Example:

 

EmptyBracket ::= "[" "]"

NonEmptyBracket ::= "[" IDENT "]"

 

WHILE ( EmptyBracket() )

  EmptyBracket {{ iEmptyBracketsCount++; }}

END

NonEmptyBracket

 

The production EmptyBracket is used as well for parsing as for looking ahead. The empty brackets are counted until the first not empty bracket appears.

 

 

 

 



This page belongs to the TextTransformer Documentation

Home  Content  German