fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

ACCEPT D-LINES

Syntax:

[DO NOT] ACCEPT D-LINES [DO NOT] ACCEPT X-LINES [DO NOT] ACCEPT Y-LINES [DO NOT] COMPILE D-LINES [DO NOT] COMPILE X-LINES [DO NOT] COMPILE Y-LINES [DO NOT] PROCESS D-LINES [DO NOT] PROCESS X-LINES [DO NOT] PROCESS Y-LINES D-LINES AS CODE X-LINES AS CODE Y-LINES AS CODE D-LINES AS COMMENTS X-LINES AS COMMENTS Y-LINES AS COMMENTS

Function:

Instructs fpt whether or not to analyse statements introduced by the optional comment delimiters D, X and Y. D line comments are accepted by many compilers. X and Y line optional comments are accepted by Gould-SEL Concept series systems. Where they are accepted, a compilation switch determines whether they are to be processed as code or ignored as comments.

Note that the optional comment delimiters are not case sensitive.

When optional comment lines are not accpted they are simply treated as comments. However, the indentation rules for comments are not applied. Aligning the comments with indented code could move the fixed-format continuation character.

These commands are position-sensitive in the fsp tree. They apply to all files which follow them until an alternative command is encountered. Commands in the command-line are executed before any fsp or Fortran files which follow them, as shown in the example below.

The command CHANGE OPTIONAL COMMENT DELIMITERS TO STANDARD COMMENTS changes the comment delimiter to the current selected standard comment delimiter, typically "!".

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp Yes
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt No
Interactive command files No
Embedded in the Fortran code No

Default

Optional comment delimiters are not accepted by default.

Example

The fixed format test program t.for:

PROGRAM t ! ! Test of declaration when D-Lines are code D INTEGER*4 dl ! ! Test of indentation when D-Lines are comments DO I = 1,2 D WRITE(*,*) D 1 "This is a D-Line" ENDDO ! ! Test of nesting when D-Lines are code D DO i = 1,2 D WRITE(*,*)"Will this be indented?" D ENDDO ! END PROGRAM t

is processed with the fsp file t.fsp:

! t.fsp % lower case symbols % fixed format % no column format declarations % overwrite changed files % primary output file name extension: ".f" % suppress diagnostic 1579 ! Code contains D-Lines t.for % start interact show symbol dl unconditional exit ! End of t.fsp

The command-line command:

fpt "% d-lines as code" t.fsp

generates the output to the screen:

*** NOTE *** The following errors have been suppressed 1579 Code contains optional comment delimiters D, X or Y Name Scope Use/COMMON Address Type Size Value/Bounds ---- ----- ---------- ------- ---- ---- ------------ dl t LOCAL INTEGER *4 1 matching symbol

and the output file, t.f is:

PROGRAM t ! ! Test of declaration when D-Lines are code D INTEGER*4 dl ! ! Test of indentation when D-Lines are comments DO i=1,2 D WRITE (*,*) D 1 "This is a D-Line" ENDDO ! ! Test of nesting when D-Lines are code D DO i=1,2 D WRITE (*,*)"Will this be indented?" D ENDDO ! END PROGRAM t

Note that the variable dl has been recognised by fpt, and that the statement:
D WRITE (*,*)"Will this be indented?"
has been indented.

When this is processed with the command:

fpt "%d-lines as comments" t.for

the screen output is:

*** NOTE *** The following errors have been suppressed 1579 Code contains optional comment delimiters D, X or Y ------------------------------------------------------------------------------- *** ERROR *** Type 1023 FPT> show symbol dl ^ Symbol not found. At/after line 13 in /home/john/projects/WinFPT/fpt/fpttest/t.fsp -------------------------------------------------------------------------------

The variable dl has not been recognised because the delclaration statement is treated as a comment.

The output file is:

PROGRAM t ! ! Test of declaration when D-Lines are code D INTEGER*4 dl ! ! Test of indentation when D-Lines are comments DO i=1,2 D WRITE(*,*) D 1 "This is a D-Line" ENDDO ! ! Test of nesting when D-Lines are code D DO i = 1,2 D WRITE(*,*)"Will this be indented?" D ENDDO ! END PROGRAM t

Note that the D-lines are reproduced without indentation, and the continuation character in a D-line remains in column 5.

Copyright ©1995 to 2024 Software Validation Ltd. All rights reserved.