home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / basicaid.zip / BASTOFOR.DOC < prev    next >
Text File  |  1983-06-18  |  5KB  |  139 lines

  1.  
  2.             BASCONV--A FORTRAN-TO-BASIC CONVERSION AID
  3.                            BY JIM GLASS
  4.  
  5.  
  6. BASCONV  is  a  program for converting IBM-PC Basic programs into
  7. Microsoft or IBM Fortran. It will not perform every detail of the
  8. conversion  for  you,  but will perform the bulk of the drudgery.
  9. Careful  inspection  and editing of the resulting output file are
  10. vital if you wish to obtain a working Fortran program.
  11.  
  12. BASCONV  is  easy  to use. It asks you for the name of the source
  13. (Basic)  file, the target (Fortran) file, and if you wish to have
  14. the  source  displayed  as  it is being converted. All file names
  15. must be supplied complete with drive identifier and extension, if
  16. any.  In  addition  to these files, BASCONV also builds a working
  17. file,  called  WORK,  on  the  current default drive. It DOES NOT
  18. delete the WORK file when the conversion is complete.
  19.  
  20. BASCONV is fairly smart.  Among the things it can do are:
  21.  
  22.          Change  FOR/NEXT  loops  into  DO  loops.
  23.          BASCONV  supplies target line numbers for
  24.          the terminating CONTINUE if necessary.
  25.  
  26.          Change WHILE/WEND loops into IF..CONTINUE
  27.          loops.
  28.  
  29.          Change  ON  n  GOTO  statements into GOTO
  30.          (...)  n  type statements. ON...GOSUB and
  31.          GOSUBS in general are NOT converted.
  32.  
  33.          Fully parse IF..THEN..ELSE statements and
  34.          convert  into  equivalent Fortran logical
  35.          IF statements or IF blocks. An IF without
  36.          an ELSE becomes a pure logical IF.
  37.  
  38.          Handle     OPEN..FOR..AS     and     OPEN
  39.          mode,file,... statements, converting them
  40.          into Fortran OPEN statements.
  41.  
  42.          Detect   ALL   implicit  declarations  of
  43.          variables,     and    provide    explicit
  44.          declarations  at  the  beginning  of  the
  45.          Fortran source.
  46.  
  47.          Convert  all  keywords,  such  as ATN, to
  48.          equivalents,  such  as  ATAN.  Also parse
  49.          statements  such  as  x MOD y and convert
  50.          into statements such as AMOD(x,y).
  51.  
  52.          Remove  all  Basic  line  numbers, except
  53.          where  lines  are  explicitly referenced.
  54.          These   line   numbers   become   Fortran
  55.          statement labels.
  56.  
  57.          Break  all  mulit-statement  Basic  lines
  58.          into   single  statements  and  move  all
  59.          source code into column seven as required
  60.          by Fortran.
  61.  
  62.          Convert all double-quotes (") into single
  63.          quotes (').
  64.  
  65.          Convert  Basic  exponentiation  (^)  into
  66.          Fortran exponentiation (**).
  67.  
  68.          Provide  Fortran  statement functions for
  69.          the Basic logical functions IMP, XOR, and
  70.          EQV.
  71.  
  72.          Converts  PRINT  and  LPRINT  as  well as
  73.          PRINT# and WRITE# statements into Fortran
  74.          equivalents.
  75.  
  76.          Inserts  appropriate  code to convert the
  77.          Basic    SWAP    keyword   into   Fortran
  78.          statements.
  79.  
  80.          Converts  all  Basic relational operators
  81.          such  as <,>,=,NOT,AND,OR into equivalent
  82.          Fortran              such              as
  83.          .LE.,.GT.,.EQ.,.NOT.,.AND.,.OR.
  84.  
  85. Some things BASCONV (at least version 1.0) CANNOT do are:
  86.  
  87.          Convert  Basic  graphics commands such as
  88.          LINE, PSET, PRESET.
  89.  
  90.          Convert GOSUBS into CALLS
  91.  
  92.          Convert   PRINT  USING  into  WRITE  with
  93.          FORMAT.
  94.  
  95.          Handle DATA/RESTORE/READ statements.
  96.  
  97.          Handle    CHAIN,    LSET,    MKI$,   CVI,
  98.          statements.
  99.  
  100.          Handle  sceen positioning statements like
  101.          POS(0), CSRLIN.
  102.  
  103.  
  104. Here  is  a list of the Basic keywords which ARE NOT converted by
  105. BASCONV:
  106.  
  107. AUTO     BLOAD   BSAVE   CALL     CHAIN   CIRCLE  CLEAR   CLS
  108. COLOR    COM     COMMON  CONT     CSRLIN  CVD     CVI     DATA
  109. DATE$    DELETE  DRAW    EDIT     ERASE   ERL     ERR     ERROR
  110. FIELD    FILES   FRE     GET      GOSUB   HEX$    INKEY$  INP
  111. INPUT$   INSTR   KEY     KEY$     KILL    LEFT$   LEN     LINE
  112. LIST     LLIST   LOAD    LOC      LOCATE  LOF     LPOS    LSET
  113. MERGE    MID$    MKD$    MKI$     MKS$    MOTOR   NAME    NEW
  114. OCT$     OFF     OPTION  OUT      PAINT   PEEK    PEN     PLAY
  115. POINT    POS     PRESET  PSET     PUT     RANDOMIZE       RENUM
  116. RESTORE  RESUME  RIGHT$  RND      RESET   RUN     SAVE    SCREEN
  117. SOUND    SPACE$  SPC(    STICK    STRIG   STRING$ SYSTEM  TAB(
  118. TIME$    TROFF   TRON    USING    USR     VAL     VARPTR  VARPTR$
  119. WAIT     WIDTH
  120.  
  121. Finally,  here  is a list of the Basic keywords which ARE handled
  122. by BASCONV:
  123.  
  124. ABS      AND     ASC     ATN      CDBL    CHR$    CINT    CLOSE
  125. COS      CSNG    DEF     DEFDBL   DEFINT  DEFSNG  DEFSTR  DIM
  126. ELSE     END     EQV     EXP      FIX     FNxxxx  FOR     GOTO
  127. IF       IMP     INPUT   INPUT#   INT     LET     LOG     LPRINT
  128. MOD      NEXT    NOT     ON..GOTO OPEN    OR      PRINT   PRINT#
  129. REM      RETURN  SGN     SIN      SQR     STEP    STOP    STR$
  130. SWAP     TAN     THEN    TO       WEND    WHILE   WRITE   WRITE#
  131. XOR
  132.  
  133. Although  the  list  of keywords recognized by BASCONV is shorter
  134. than  those not recognized, the most important are there. Many of
  135. the  unrecognized  words  are  those with no Fortran equivalents,
  136. such  as  LINE  or  PAINT.  A  few  are  not  handled  due to the
  137. difficulty    of    programming    the    conversion,   such   as
  138. DATA/READ/RESTORE. Perhaps in Version 1.1...
  139.