Opened 17 years ago

Closed 17 years ago

#44 closed enhancement (fixed)

Add for loop functionality to model

Reported by: Stephen Siegel Owned by: zirkel
Priority: major Milestone:
Component: model Version: 1.0
Keywords: for, loop, model Cc:

Description

Add a ForLoopLocationIF which extends LoopLocationIF. Ditto for the implementing classes.

A for loop has the form

for(initStatement; condition; incrementStatement) S

It is syntactic sugar for

initStatement;
while (condition) {
  S;
  incrementStatement;
}

The ForLoopLocation should provide a way to get the additional information: the initStatement (which actually comes before the ForLoopLocation), and the increment statement (which is part of the loop body). The condition is already accessible as it is a special case of the while loop.

Each statement (init or increment) can actually consist of multiple statements, so perhaps the class should provide methods to get the first and last location in the sequence, or something like that.

You then need to add methods to the ModelIF and Model to create such locations.


Change History (4)

comment:1 by zirkel, 17 years ago

Status: newaccepted

comment:2 by zirkel, 17 years ago

Resolution: fixed
Status: acceptedclosed

For loops have been added

comment:3 by Stephen Siegel, 17 years ago

Resolution: fixed
Status: closedreopened

Is there a ForLoopLocationIF?
There needs to be a way for the verification system to find out this is a for loop and get the initialization statement and increment statement.

comment:4 by zirkel, 17 years ago

Resolution: fixed
Status: reopenedclosed

Added ForLoopLocationIF and supporting changes

Note: See TracTickets for help on using tickets.