Node: -n;, Next: , Previous: -nAT;, Up: Options



-n;: Supply automatic semicolons [FORTRAN]

(Don't forget that a semicolon has special meaning to UNIX shells, so you'll probably have to quote this command: -n';'.)

This command functions the same as -n@; (see -nAT;, except that actual (visible) semicolons rather than pseudo-semicolons are appended. This is the default mode of operation for FORTRAN-77 (and for that language, it cannot be turned off by negation).

The distinction between -n@; and -n; has to do with what is visible on output. In FORTRAN-77, semicolons are not printed by default since that seemed to annoy many users. However, that causes trouble with FORTRAN-90 code containing multiple statements per line, as in

     a = b; c = d
     

If -np is not used, then the semicolon in the above example is not printed, hindering legibility. Thus, the default mode of operation for free-format FORTRAN-90 is -n@; and -np. This turns the above example into a = b; c = d@; and displays it correctly.

When -n; is used, semicolons will not be printed by default. To force them to be printed, use the -np option (see -np).

Do not insert semicolons by hand in FORTRAN-77; they are always inserted automatically. If you have terminated FORTRAN-90 statements by hand, turn off auto-semis by -n; (and use -np at your discretion).

The following table summarizes the defaults for auto-semi insertion and semicolon printing in FORTRAN, both fixed and free formats (`N/A' means `not applicable'):

Fixed Free
F77 -n; N/A
F90 -n; -n@; -np

Node: -n\, Next: , Previous: -np, Up: Options



-n\: Free-form syntax continued by backslash

In FORTRAN-90, this turns on free-form syntax and sets the continuation character to be the backslash (as it would be in C). For example,

     -n9[-n\]
     @
     @a
     program main
     x = \
      y
     end
     

In the tangled output the backslash is converted into FORTRAN-90's standard continuation character, the ampersand.

See also -n&.

Node: -n&, Next: , Previous: -n\, Up: Options



-n&: Free-form syntax continued by ampersand

In FORTRAN-90, this turns on free-form syntax and sets the continuation character to be the ampersand. For example,

     -n9[-n&]
     @
     @a
     program main
     x = &
      y
     end
     

For FORTRAN-90, free-form syntax continued by the ampersand is FWEB's default, so one probably will not need to use -n& explicitly.

See also -n\.

Node: -n/, Next: , Previous: -n&, Up: Options



-n/: Recognize short comments [FORTRAN]

The standard FWEB notation for a short comment (one terminated by the next newline) is // .... However, in FORTRAN the // denotes concatenation by default. To make it denote a short comment, use the -n/ option. One can do this in the .fweb file (see Customization) or with the language-setting command in limbo, as in @n/.

In FWEB, one may always use \/ for concatenation, so there's no penalty for using -n/.

Node: -n!, Next: , Previous: -n/, Up: Options



-n!: Make ! denote short comment [FORTRAN]

In FORTRAN-90, ! starts a short comment. However, by default FWEB usurps ! for the logical not, as in if(x != y). To force it to recognize ! as a comment, use -n!. However, the recommended style is to use FWEB's standard convention that // denotes the start of a short comment (see -n/). See also -! and -r!.

In FORTRAN-77, to include the exclamation point inside a string, escape it with a backslash, as in

             s = "A \! inside a string"
     

This possibly annoying restriction arises because the unduly complicated FORTRAN input driver does some preprocessing of the FORTRAN source before it feeds it to the cores of the processors.

Node: -n), Next: , Previous: -n!, Up: Options



-n): Reverse array indices [FORTRAN] (FTANGLE)

This somewhat experimental flag permits FORTRAN programmers to use C-style array indices. Conversions such as the following are made (during the output phase of FTANGLE):

     a(k)(i) => a(i,k)
     a(k)(i,j) => a(i,j,k)
     a(k)(j)(i) => a(i,j,k)
     

[No spaces may intervene between ) and (; effectively, )( is treated as one token for the purposes of -n).] This feature permits convenient definitions of macros that deal with multi-dimensional vectors.

Unfortunately, FTANGLE doesn't fully understand the syntax of the source code--and never will, unless it is fully integrated with a compiler. It will therefore be confused by situations like the following FORTRAN example:

     dimension x(0:4)(1:2) // OK
     character*90 ch(4) // OK
     write(6,*) ((x(i)(j),i=1,2), j=3,4) // Will reverse incorrectly.
     c = ch(4)(3:4) // Shouldn't reverse, but will.
     

One solution, due to Charles Karney, is to insert a space to prevent )( from being recognized as a single token. However, since ordinary white space is eaten on input, one must resort to something like the following ($UNQUOTE is a built-in FWEB function; see $UNQUOTE):

     @m SP $UNQUOTE(' ')
     @a
     dimension x(0:4)(1:2)
     character*90 ch(4)
     write(6,*) SP ((x(i)(j),i=1,2), j=3,4)
     c = ch(4)SP(3:4)
     

This option is controlled by the three style-file parameters paren.len, paren.num, and paren.nest. (See Style.) paren.len is the default number of bytes to be allocated for each index; if an index is longer than this number, the current length is increased by this number and storage is automatically reallocated. paren.num is the maximum number of allowed indices; for example, when processing a(i)(j)(k), paren.num is 3. paren.nest is the maximum parenthesis nesting level. In the example x(a(i)(j)(k)), paren.nest is 2. If either of the last two parameters is exceeded, a message will be issued asking you to increase the appropriate value.