Logiweb(TM) Complex charge inversion

Prev Up Next Page 131 of 800 Search internet

Consider the following lgs source text:

   ""P my page
   ""D 0 ""n a ""n b ""n c ""n d ""n e
   ""D 2
   " * "
   ""D 6
   " + "
   ""D 8
   if " then " else "
   a * if b then c else d + e

In this case, the body reads:

a * [if b then c else [d + e]]

Logiweb parenthesizes the body as follows: First, it locates the operator with highest charge (the 'if-then-else' in our case). Then it puts brackets around the 'if-then-else', including as much as possible. Thus, the left bracket is put before the 'i' in 'if' and the right bracket is put to the far right. In this way, d + e becomes the third argument of the if-then-else whereas the multiplication stays outside. In this way, the operator with the lowest charge (the multiplication) ends out being the principal operator even though there is a binary operator (the plus) which has higher charge and which could have ended up as principal operator, had it not been captured by the if-then-else construct which has even higher charge.

Prev Up Next Page 131 of 800 Search logiweb.eu

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