0
$\begingroup$

To my knowledge, in block-structured programming languages, there are 2, maybe 3 main ways of delimiting a block.

  1. Using start and end tokens, this can be brackets or reserved words etc
  2. Using indentation, like python, which uses the offside rule to delimit blocks
  3. Using prefix notation for control structures, like lisp/s-expressions (maybe this is equivalent to 1).

If we consider programs as strings of symbols, then a block-delimiting-scheme is the information in a program for uniquely specifying subprograms.

So for example, we could delimit blocks by using symbol/token/line number indices, e.g if condition 4,7 14,32 (might relate to labels in assembly or basic).

My question is, what are all the ways of delimiting blocks?

$\endgroup$
2
  • $\begingroup$ Would you consider something like SGML or HTML, where end tags are implied by a following start tag that cannot legally be nested inside the current block a separate way or a variant of 1? $\endgroup$ Commented Dec 18, 2022 at 10:54
  • $\begingroup$ See softwareengineering.stackexchange.com/a/116483/1352 for examples. $\endgroup$ Commented Dec 18, 2022 at 11:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.