CS 3304: Comparative Languages
Control Structures
[
Course Documents
] : [
Control Structures
]
Previous
Contents
Next
Keyword Index
Restrictions on Pascal's Gotos
A statement group is either a compound statement or the body of a repeat-until
The target of a goto cannot be a statement in a statement group that is not active
Means the target can never be in a statement group that is at the same level or is nested more deeply than the one with the goto
An important remaining problem: the target can be in any enclosing subprogram scope, as long as the statement is not in a statement group
This means that a goto can terminate any number of subprograms