imperative / Java
Representation
Collected by Matthias Hauswirth — Compilers (control-flow graphs) and flow charts
Understand concept of repetition from structured programming (loops like while, do-while, or for), where a given statement can be executed multiple times, by simply following the arrows through the cycle.
PL | NM |
---|---|
... | ... |
back edge | arrow pointing to a node that came prior in the flow (introducing a cycle) |
while-, do-while-, for-loop | cycle in the graph |
The idea of a 'repetition' in structured programming, where control-flow leads to statements getting executed multiple times
When introducing while-, do-while-, and for-loops
Requires prior introduction of 'Selection'.
This is the last in a sequence of "Control Flow as Graph" notional machines:
The following video Matthias Hauswirth uses the "Control Flow as Graph"
notional machine in his "Programming Fundamentals 2" Bachelor course
to explain for
-loops in Java:
This notional machine is implemented by the Informa Clicker tool. This tool allows students in a classroom to construct control flow graphs in in-class clicker exercises.
Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.
For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".