Vadim Zaytsev aka @grammarware

BabyCobol: NEXT SENTENCE

a statement to branch unconditionally to the beginning of the next sentence

Format

 NEXT SENTENCE

Semantics

The problems of implementing the NEXT SENTENCE statement come from the clash between the hierarchical tree-like structure of the program and its flat textual structure. The official semantics of the NEXT SENTENCE statement is that it transfers control to the first statement of the next sentence (after the dot). If the AST already incorporates the information about sentences in addition to statements, then implementing the NEXT SENTENCE statement should not be too difficult: we need to prepare a possibly useful target label at the beginning of each sentence, and use it when needed. Due to BabyCobol's simplified design, this is the only possible way in the language to essentially GO TO within a paragraph. Watch out for the interaction of NEXT SENTENCE with the other BabyCobol features:

Style

Origins

COBOL   CONTINUE EXIT NEXT SENTENCE
FORTRAN   CONTINUE
PL/I   ;
REXX   NOP

BabyCobol is a project by Dr. Vadim Zaytsev a.k.a. @grammarware. Page last updated in October 2023.
XHTML 1.1 CSS 3