home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / toolpack.000 / toolpack / toolpack1.2 / scriptsource / pol.s < prev    next >
Encoding:
Text File  |  1993-10-04  |  2.5 KB  |  86 lines

  1. #! /bin/csh
  2. #  pol is a csh script to format a Fortran program using ISTPL.
  3. #    (via the combined tool fragment ISTLP = ISTLX/ISTPL)
  4. #
  5. #
  6. #  Invocation:
  7. #
  8. #  pol Polish_option_file Fortran_source_file
  9. #
  10. #  Polish_option_file is the name of a file containing Polish options used in
  11. #  reconstructing the transformed Fortran.  If Polish_option_file is "-"
  12. #  then default Polish options will be used.
  13. #
  14. #  Check command line validity.
  15. if ( $#argv < 2 ) then
  16. TOOLPACKPATH/toolpack1.2/util/echoerr \
  17. Invocation:
  18. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  19. TOOLPACKPATH/toolpack1.2/util/echoerr \
  20. pol Polish_option_file Fortran_source_file
  21. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  22. TOOLPACKPATH/toolpack1.2/util/echoerr \
  23. 'Polish_option_file is created by using script "polx".'
  24. TOOLPACKPATH/toolpack1.2/util/echoerr \
  25. 'Note: "-" as Polish_option_file gives default options.'
  26. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  27. TOOLPACKPATH/toolpack1.2/util/echoerr \
  28. Transformed code is sent to standard output and may be redirected to a file.
  29. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  30.    exit
  31. endif
  32. #  "-" as Polish_option_file gives default options.
  33. if ( $1 != - ) then
  34. #  Check that Polish_option_file exists.
  35.    if ( -e $1 == 0 ) then
  36. TOOLPACKPATH/toolpack1.2/util/echoerr \
  37. "'$1' does not exist. '-' as the first argument gives default Polish options."
  38.       exit
  39.    endif
  40. endif
  41. #  Check that Fortran_source_file exists.
  42. if ( -e $2 == 0 ) then
  43. TOOLPACKPATH/toolpack1.2/util/echoerr \
  44. "'$2' does not exist."
  45.    exit
  46. endif
  47. #
  48. #  Create PFS.  If PFS already exists, exit with an advisory message.
  49. #
  50. if ( -e _.TOOLPACK == 0 ) then
  51.    mkdir _.TOOLPACK
  52. else
  53. TOOLPACKPATH/toolpack1.2/util/echoerr \
  54. Toolpack-created directory '"_.TOOLPACK"' exists. \
  55. Remove with script '"discard"'.
  56.    exit
  57. endif
  58. #  Make a tab-free copy of the Fortran source and use it as source.
  59. set src = lp.src$$
  60. expand $2 > _.TOOLPACK/$src
  61. #  Create the interprocess file IST.CMD and append parameters for ISTLP.
  62. if ( $1 == - ) then
  63. TOOLPACKPATH/toolpack1.2/util/mkipf \
  64. $src \#1 -
  65. else
  66. TOOLPACKPATH/toolpack1.2/util/mkipf \
  67. $src \#1 \#$1
  68. endif
  69. #
  70. #  Invoke ISTLP.
  71. #
  72. TOOLPACKPATH/toolpack1.2/exec/istlp.u
  73. #
  74. #  If tool terminated with errors, advise user to obtain listing.
  75. if ( `cat _.TOOLPACK/_.info` == -1 ) then
  76. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  77. TOOLPACKPATH/toolpack1.2/util/echoerr \
  78. 'Errors detected.  Invoke script "getlst" to obtain a listing showing'
  79. TOOLPACKPATH/toolpack1.2/util/echoerr \
  80. statement and token numbers.
  81. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  82. endif
  83. #
  84. /bin/rm -r _.TOOLPACK
  85. #
  86.