Next: , Previous: , Up: AT commands   [Contents][Index]


5.13.2 ‘@;’: Pseudo-semicolon

@;’ is an invisible semicolon. These are often used in C programming to terminate a module name that expands to a compound statement. Carefully compare the uses of ‘@;’ and ‘;’ in the following example:

@c
@a
if(flag)
        @<Compound statement@>@;
else
        @<Simple statement@>;

@ This compound statement ends with a brace, but is used as an
expression above.
@<Com...@>=

{
x;
y;
}

@ This fragment does not end with a semicolon, so one must be 
supplied above.

@<Sim...@>=
z

Here is a case for which the pseudo-semicolon is not necessary. Consider

@c
@ The code fragment |x = y| ...

If the ‘-1’ is turned on, one might think that FWEAVE would report an “irreducible scrap sequence” because ‘x = y’ is an expression but not a complete statement. (Turning on ‘-2’ demonstrates this.) However, it is not necessary to say ‘|x = y@;|’ because the warning message is not issued if the parsing reduces to just one unresolved scrap.

On the other hand, ‘|goto done|’ does not reduce to just one unresolved scrap, so say ‘|goto done@;|’ in cases such as this. See Pseudo-operators.

In some situations, pseudo-semicolons are inserted automatically. An important case is free-format FORTRAN-90. There the language syntax says that newlines terminate statements (except when there’s a trailing ampersand). However, newlines are thrown away before tokenized text is seen by FWEAVE’s parser (and in any event would just be interpreted as white space). Therefore, by default newlines that terminate statements are replaced by pseudo-semicolons, so the parsing proceeds correctly.

In the FORTRAN-90 case, one could also insert pseudo-semicolons or actual semicolons by hand, and some users prefer that. The possibilities are controlled by the options ‘-n@;’ (see -nAT;) and ‘-n;’ (see -n;).


Next: , Previous: , Up: AT commands   [Contents][Index]