Logiweb(TM)

7.1.2.3 Definitions: ""D

Prev Up Next Page 118 of 800 Search internet


An lgs source can include zero, one, or more definition sections. A definition section starts with a ""D escape sequence and continues to the next ""P, ""R, ""D, or ""B escape sequence or to the end of the lgs source file.

A definition section consists of a charge followed by zero, one, or more constructs. The charge starts after the ""D escape sequence and continues to the end of the line. Instead of ending the charge by a newline, one may end it by a newline escape sequence ""n. The constructs come after after the charge, each on a line by itself. Instead of separating constructs by newline characters, one may separate them using newline escape sequences ""n. A blank charge is taken to be a charge of zero. Blank lines after the charge are ignored.

A definition section like

   ""D 7.9.13
   " while "
   ", and if not then "
   avoid "

defines three constructs and assigns charge 7.9.13 to all of them. In constructs, double quote characters serve as placeholders. The constructs above make it syntactically legal to write things like

   2 while 3, and if not then avoid 4

in the body of the lgs source. Whether or not such an utterance makes sense depends on what definitions are included on the page.

Space characters are treated a bit different from other characters in that an arbitrary sequence of space and newline characters count as a single space. Apart from that, space characters are treated like any other character. Thus, the utterance above could also be written

   2 while 3,
   and   if   not   then   avoid   4

But the utterance cannot be written

   2 while 3 , and if not then avoid 4

because of the space character before the comma. Neither can it be written

   2 while 3, and ifnot then avoid 4

because of the missing space character between 'if' and 'not'.

Later, charges and handling of spaces are treated in more detail.

Prev Up Next Page 118 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05