Project

General

Profile

Feature #141

Updated by Eugen Wissner 7 days ago

## Rationale 

 For Labels begin with a low-level systems programming language it is important to have an escape from the structured flow. The escape route proposed here are named blocks with the support of break statements to exit the block. 

 ## Syntax 

 - The new keyword `block` is period followed by an identifier, its the label name. The body of the block is a `goto` statement list ending with the `end` keyword. 
 - The new statement "break identifier" can be used everywhere in the block jumps to jump to the end of the block with the named identifier. 

 ## Usage 

 - `block` inside a loop represents "continue". 
 - `block` outside of a loop represents a "break". 

 ## Symbol table 

 Theoretically the labels can use its own namespace since their usage doesn't conflict with any other symbols. Labels cannot be exported, their maximal scope is always a single procedure. The lookup is bottom-up as for other symbols. 

 ## GENERIC generation 

 A block opens a new scope, as any other block-statement, since it is required to handle try…finally correctly. At the end of the block an artificial label should be generated, that is used to jump to it if a break-statement breaks that block. previously defined label.

Back