home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume20 / fpc / part01 next >
Encoding:
Internet Message Format  |  1989-10-23  |  32.7 KB

  1. Subject:  v20i050:  Portable compiler of the FP language, Part01/06
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Edoardo Biagioni <biagioni@cs.unc.edu>
  7. Posting-number: Volume 20, Issue 50
  8. Archive-name: fpc/part01
  9.  
  10. [ This does NOT include an FP language reference manual; they abound,
  11.   including BSD documentation and Backus's Turing award lecture.  /r$ ]
  12.  
  13. This is FPC, a portable implementation of Backus's FP language. FPC
  14. translates FP programs to C source code which you can compile normally.
  15.  
  16. FPC includes a short README file that tells you how to install it, and a
  17. 'man' page that tells you how to use it. It has been in use here at UNC
  18. for the last 2 years and has no known bugs. If you want more information,
  19. you can get a paper describing FPC by requesting the technical report
  20. TR88-027: "FPC: a translator for FP", by E. Biagioni, from:
  21.  
  22.     Department of Computer Science
  23.     University of North Carolina at Chapel Hill
  24.     Chapel Hill, North Carolina, 27514
  25.     U.S.A.
  26.  
  27. Make sure you include a legible return address.
  28.  
  29. Ed Biagioni    biagioni@cs.unc.edu         Department of Computer Science
  30.         seismo!mcnc!unc!biagioni    Chapel Hill, N.C. 27514, USA
  31.  
  32. Disclaimer: this software is in the public domain. It is provided "as
  33. is", with no warranty; neither the author nor UNC have any
  34. responsibility or liability for any problems that may be caused by use
  35. or abuse of this software.
  36.  
  37. #    This is a shell archive.
  38. #    Remove everything above and including the cut line.
  39. #    Then run the rest of the file through sh.
  40. -----cut here-----cut here-----cut here-----cut here-----
  41. #!/bin/sh
  42. # shar:    Shell Archiver
  43. #    Run the following text with /bin/sh to create:
  44. #    README
  45. #    makefile
  46. #    fpc.1
  47. #    fpc.c
  48. #    fpc.h
  49. #    stdfp.h
  50. #    fp.h
  51. #    fpg.l
  52. #    fpg.y
  53. echo shar: extracting README '(621 characters)'
  54. sed 's/^XX//' << \SHAR_EOF > README
  55. XXTo install fpc, run 'make' in this directory. Once you are satisfied
  56. XXthat fpc works correctly, you can update update the makefiles so that
  57. XXthe BIN and LIB variables contain the names of the directories where
  58. XXthe executables and the object libraries should reside. This must
  59. XXbe done to both 'makefile' and 'lib/makefile'. You can then run
  60. XX'make release'.
  61. XX
  62. XXI can be reached at the following address:
  63. XX
  64. XXEd Biagioni    biagioni@cs.unc.edu         Department of Computer Science
  65. XX        seismo!mcnc!unc!biagioni    Chapel Hill, N.C. 27514, USA
  66. XX
  67. XXbut the response time might be a few weeks since I'll be travelling quite
  68. XXa bit in the near future.
  69. SHAR_EOF
  70. if test 621 -ne "`wc -c README`"
  71. then
  72. echo shar: error transmitting README '(should have been 621 characters)'
  73. fi
  74. echo shar: extracting makefile '(2924 characters)'
  75. sed 's/^XX//' << \SHAR_EOF > makefile
  76. XXMAIN = /usr/local
  77. XXBIN = ${MAIN}/bin
  78. XXLIB = ${MAIN}/lib
  79. XXBINS = ${BIN}/fpc
  80. XXLIBS = ${LIB}/libfp.a ${LIB}/libdfp.a ${LIB}/libnfp.a
  81. XXSRC = fpg.l fpg.y fp.c fp.h stdfp.h fpc.c fpc.h parse.c parse.h code.c \
  82. XX    code.h expr.c mkffp.c mkprol.c makefile prims.fp
  83. XXCFLAGS = 
  84. XX
  85. XXall: fpc fp.o debugfp.o nocheckfp.o lint
  86. XX    cd lib; make ; cd ..
  87. XX
  88. XXclean:
  89. XX    rm -f *.o y.tab.c lex.yy.c fpc mkffp lint
  90. XX
  91. XX.SUFFIXES:
  92. XX
  93. XX.SUFFIXES: .fp
  94. XX
  95. XX${BIN}/fpc: fpc
  96. XX    rm -f ${BIN}/fpc
  97. XX    cp fpc ${BIN}/fpc
  98. XX
  99. XX${LIB}/libfp.a: fp.o
  100. XX    ar r ${LIB}/libfp.a fp.o
  101. XX    ranlib ${LIB}/libfp.a
  102. XX
  103. XX${LIB}/libdfp.a: debugfp.o
  104. XX    ar r ${LIB}/libdfp.a debugfp.o
  105. XX    ranlib ${LIB}/libdfp.a
  106. XX
  107. XX${LIB}/libnfp.a: nocheckfp.o
  108. XX    ar r ${LIB}/libnfp.a nocheckfp.o
  109. XX    ranlib ${LIB}/libnfp.a
  110. XX
  111. XX${BIN}/mkffp: mkffp
  112. XX    rm -f ${BIN}/mkffp
  113. XX    cp mkffp ${BIN}/mkffp
  114. XX
  115. XX${BIN}/mkprol: mkprol
  116. XX    rm -f ${BIN}/mkprol
  117. XX    cp mkprol ${BIN}/mkprol
  118. XX
  119. XXfpc.o: fpc.c
  120. XX    cc ${CFLAGS} -c fpc.c
  121. XX
  122. XXparse.o: parse.c
  123. XX    cc ${CFLAGS} -c parse.c
  124. XX
  125. XXcode.o: code.c
  126. XX    cc ${CFLAGS} -c code.c
  127. XX
  128. XXexpr.o: expr.c
  129. XX    cc ${CFLAGS} -c expr.c
  130. XX
  131. XXfpc: y.tab.o fpc.o parse.o code.o expr.o
  132. XX    rm -f fpc
  133. XX    cc ${CFLAGS} -o fpc y.tab.o parse.o code.o expr.o fpc.o -ll
  134. XX
  135. XXlint: y.tab.c lex.yy.c fpc.c parse.c code.c expr.c fp.c
  136. XX    lint -achx y.tab.c fpc.c parse.c code.c expr.c | grep -v yy | \
  137. XX        grep -v "^str" | grep -v "^_flsbuf" | \
  138. XX        grep -v "long assignment may lose accuracy" | \
  139. XX        grep -v "exit value declared inconsistently" > lint
  140. XX    lint -abchux fp.c | grep -v yy | grep -v "^str" | \
  141. XX        grep -v "^_flsbuf" | \
  142. XX        grep -v "long assignment may lose accuracy" | \
  143. XX        grep -v "illegal structure pointer combination" | \
  144. XX        grep -v "exit value declared inconsistently" >> lint
  145. XX
  146. XXmkprol.o: mkprol.c
  147. XX    cc ${CFLAGS} -c mkprol.c
  148. XX
  149. XXmkffp.o: mkffp.c
  150. XX    cc ${CFLAGS} -c mkffp.c
  151. XX
  152. XXmkffp: y.tab.o fpc.o parse.o mkffp.o
  153. XX    cc ${CFLAGS} -o mkffp y.tab.o parse.o mkffp.o fpc.o -ll
  154. XX
  155. XXmkprol: y.tab.o fpc.o parse.o mkprol.o
  156. XX    cc ${CFLAGS} -o mkprol y.tab.o parse.o mkprol.o fpc.o -ll
  157. XX
  158. XXlex.yy.c: fpg.l
  159. XX    lex -v fpg.l
  160. XX    sed "s/fprintf/(void) fprintf/" lex.yy.c | \
  161. XX        sed "s/putc/(void) putc/" > /tmp/lex.yy.c
  162. XX    mv /tmp/lex.yy.c lex.yy.c
  163. XX
  164. XXxlator.o: xlator.c
  165. XX    cc ${CFLAGS} -c -O xlator.c
  166. XX
  167. XXy.tab.c: fpg.y
  168. XX    yacc fpg.y
  169. XX    echo "should have given 1 shift/reduce conflict (bu fn o ...)"
  170. XX
  171. XXy.tab.o: y.tab.c lex.yy.c
  172. XX    cc ${CFLAGS} -c -O y.tab.c
  173. XX
  174. XXparse.c: parse.h fpc.h
  175. XX    touch parse.c
  176. XX
  177. XXfp.c: fp.c.part1 fp.c.part2
  178. XX    cat fp.c.part1 fp.c.part2 > fp.c
  179. XX
  180. XXfp.o: fp.c fp.h stdfp.h
  181. XX    cc ${CFLAGS} -c -O fp.c
  182. XX
  183. XXdebugfp.o: fp.c fp.h
  184. XX    cp fp.c debugfp.c
  185. XX    cc ${CFLAGS} -c -DDEBUG debugfp.c
  186. XX    rm -f debugfp.c
  187. XX
  188. XXnocheckfp.o: fp.c fp.h
  189. XX    cp fp.c nocheckfp.c
  190. XX    cc ${CFLAGS} -c -O -DNOCHECK nocheckfp.c
  191. XX    rm -f nocheckfp.c
  192. XX
  193. XXcode.c: parse.h code.h fpc.h fp.h stdfp.h
  194. XX    touch code.c
  195. XX
  196. XXexpr.c: parse.h code.h fp.h stdfp.h
  197. XX    touch expr.c
  198. XX
  199. XXfpc.c: fpc.h
  200. XX    touch fpc.c
  201. XX
  202. XXrelease: all ${BINS} ${LIBS}
  203. XX    cd lib ; make release ; cd ..
  204. XX    echo release done
  205. XX
  206. XXprimslist: fp.c
  207. XX    grep "^fp_data" fp.c | grep "(data)" | sed "s/^fp_data //" | \
  208. XX        sed "s/ (data)//" | sort > primslist
  209. SHAR_EOF
  210. if test 2924 -ne "`wc -c makefile`"
  211. then
  212. echo shar: error transmitting makefile '(should have been 2924 characters)'
  213. fi
  214. echo shar: extracting fpc.1 '(9433 characters)'
  215. sed 's/^XX//' << \SHAR_EOF > fpc.1
  216. XX.TH FPC 1 "29 May 1986"
  217. XX.UC 4
  218. XX.SH NAME
  219. XXfpc \- fp to C compiler
  220. XX.SH SYNOPSIS
  221. XX.B fpc
  222. XX[
  223. XX.I options
  224. XX] ...
  225. XX.I file
  226. XX...
  227. XX.SH DESCRIPTION
  228. XX.I FPC
  229. XXis an fp compiler. It produces as output C source files
  230. XXrather than object files.
  231. XX.I FPC
  232. XXaccepts as arguments the names of the files to be
  233. XXcompiled. Arguments of the form
  234. XX.IR name.fp
  235. XXare taken to be fp source programs; each
  236. XXis compiled into the C source file
  237. XX.IR name.c.
  238. XXPrograms can be compiled as normal C source files; they must
  239. XXbe loaded using one of the switches
  240. XX.IR -lfp,
  241. XX.IR -lnfp,
  242. XX.IR -ldfp.
  243. XX.SH EXAMPLE
  244. XX.PP
  245. XXAs an example, we compile mmult.fp and ip.fp. Assume the
  246. XXfile mmult declares functions noop and matrixmult.
  247. XXThe resulting program will execute the function matrixmult.
  248. XXIt is assumed that ip.fp contains auxiliary functions
  249. XXneeded by noop or matrixmult or both.
  250. XXTo compile, do the following:
  251. XX.sp 1
  252. XX    fpc -mmatrixmult mmult.fp ip.fp
  253. XX.br
  254. XX    cc -o mmult mmult.c ip.c -lfp
  255. XX.sp 1
  256. XXThis will produce the file mmult which
  257. XX.br
  258. XX    accepts input from the user, and
  259. XX.br
  260. XX    applies matrixmult to it, and
  261. XX.br
  262. XX    outputs the result.
  263. XX.sp 1
  264. XXThe first command above could have been entered as two separate
  265. XXcommands:
  266. XX.sp 1
  267. XX    fpc -mmatrixmult mmult.fp
  268. XX.br
  269. XX    fpc ip.fp
  270. XX.sp 1
  271. XXThe two commands could have been given in either order.
  272. XX.SH OPTIONS
  273. XXThe following options are recognized by
  274. XX.IR FPC.
  275. XXNotice that options only apply to the first file name following
  276. XXthe option.
  277. XX.TP 8
  278. XX.B \-v
  279. XX(verbose) prints on the standard output
  280. XXthe version number of the compiler and the names of
  281. XXthe functions being compiled.
  282. XX.TP
  283. XX.B \-d
  284. XX(debug) produces code to trace all function entries and
  285. XXexits and the arguments passed to them as well as the
  286. XXdata they return. The trace is printed on the standard
  287. XXerror output (stderr).
  288. XX.TP
  289. XX.B \-e
  290. XX(entry/exit) same as -d, except that it does not print
  291. XXthe arguments or the results of the functions.
  292. XX.TP
  293. XX.BI \-t fun
  294. XX(trace) like debug, but only for function
  295. XX.I fun.
  296. XX.TP
  297. XX.B \-n
  298. XX(no check) the arguments to functional forms are not
  299. XXchecked for correctness, and other optimizations are
  300. XXdone which should speed up execution but make error
  301. XXdetection and localization harder. It is expected that
  302. XXprograms compiled with -n will be loaded with the
  303. XXlibrary nfp.
  304. XX.TP
  305. XX.B \-m
  306. XX.br
  307. XX.ns
  308. XX.TP
  309. XX.BI \-m fun
  310. XXThe compiler assumes that the first file
  311. XXname following the -m switch (call it
  312. XX.I file.fp
  313. XX) requires a
  314. XX.I main
  315. XXprocedure. The
  316. XX.I main
  317. XXprocedure
  318. XX.sp 1
  319. XX.ti 16
  320. XXreads data from the standard input;
  321. XX.ti 16
  322. XXcalls the `main' function on that data;
  323. XX.ti 16
  324. XXprints the result of the call.
  325. XX.sp 1
  326. XXIf the second form is used, the `main' function is
  327. XX.I fun;
  328. XXfor the first form, it is
  329. XX.I file.
  330. XX.TP
  331. XX.BI \-s
  332. XX(space) produces code to print out the maximum amount
  333. XXof space used by the program, as well as the number of
  334. XXcell allocations and de-allocations. Can only be used
  335. XXin conjunction with -m.
  336. XX.TP
  337. XX.B \-i
  338. XX(string input) can only be used with -m. Specifies that
  339. XXthe data obtained from the standard input be
  340. XXpassed to the main function as a string (a vector
  341. XXof characters), rather than
  342. XXas an ffp object. In other words, 
  343. XX.IR abc
  344. XXwould be given
  345. XXto the `main' function as 
  346. XX.IR \<'a,
  347. XX.IR 'b,
  348. XX.IR 'c\>
  349. XXrather than as the atom
  350. XX.IR abc.
  351. XX.TP
  352. XX.B \-o
  353. XX(string output) can only be used with -m. Specifies that
  354. XXthe data returned by the `main' function be output in
  355. XXraw form. The data may be a string or
  356. XXa vector of pairs \<
  357. XX.IR filename,
  358. XXstring\>, (e.g. \<\<file1, "yes, I am
  359. XXhere"\>, \<file2, "no, I am not here"\>\>). In
  360. XXboth cases,
  361. XXthe string or strings are printed without surrounding
  362. XXquotes. In the first case the string is printed on the
  363. XXstandard output; in the second case each of
  364. XXthe strings is printed to the file specified by
  365. XX.IR filename,
  366. XXwhich must be an fp atom. The file name
  367. XX.IR output
  368. XXspecifies the standard output. It is an error for the `main'
  369. XXfunction to return more than one instance of a given
  370. XX.IR filename.
  371. XX.TP
  372. XX.B \-p
  373. XX(parameters and options) specifies that if any command line
  374. XXoptions or parameters are present, the program should run
  375. XXimmediately, with \<\> as input, instead of waiting
  376. XXfor input from stdin. The arguments can then be obtained
  377. XXby calling the procedure arguments, (see later). If no command
  378. XXline arguments are given, input proceeds normally.
  379. XX.TP
  380. XX.B \-a
  381. XX(AST system) can only be used with -m, and ignores -p. An
  382. XXAST system is an
  383. XXapplicative state transition system. This option causes the
  384. XXprocedure
  385. XX.IR main
  386. XXto:
  387. XX.sp 1
  388. XX.ti 16
  389. XX(1) apply the `main' function to \<\<\>, \<\>\>
  390. XX.ti 16
  391. XX(2) `main' must return \<output, state\>
  392. XX.ti 16
  393. XX(3) print the output part of the result
  394. XX.ti 16
  395. XX(4) read the standard input
  396. XX.ti 16
  397. XX(5) create a pair \<data-read, state\>
  398. XX.ti 16
  399. XX(6) call the `main' function on the pair
  400. XX.ti 16
  401. XX(7) `main' must return \<output, new-state\>
  402. XX.ti 16
  403. XX(8) print the output part of the result
  404. XX.ti 16
  405. XX(9) set state to the second part of the result
  406. XX.ti 16
  407. XX(10) if state is not nil, return to step (4)
  408. XX.sp 1
  409. XXInput and output are done as specified by any of
  410. XXthe -i and -o options. If -i is specified, each input
  411. XXwill be a string of exactly one character, returned as soon
  412. XXas the character is available.
  413. XX.SH FILES
  414. XX.ta \w'/usr/c/occom  'u
  415. XXfile.fp        input file
  416. XX.br
  417. XXfile.c        output file
  418. XX.br
  419. XXfpc        compiler
  420. XX.br
  421. XXlibfp.a        run-time library
  422. XX.br
  423. XXlibdfp.a    run-time library to test implementation of the primitives
  424. XX.br
  425. XXlibnfp.a    run-time library for non-checking primitives
  426. XX.br
  427. XX.SH "SEE ALSO"
  428. XXJohn Backus,
  429. XX.I
  430. XXCan Programming Be Liberated from the von Neumann Style?
  431. XX.I
  432. XXA Functional Style and Its Algebra of Programs
  433. XX.br
  434. XXTuring Award lecture, Communications of the ACM,
  435. XXVolume 21, Number 8, August 1978
  436. XX.SH MODIFICATIONS
  437. XXThe major syntactic differences between the language
  438. XXaccepted by FPC and the language described
  439. XXin the Backus paper are in the treatment of non-ascii
  440. XXcharacters. More specifically, the
  441. XX.IR define
  442. XXcharacter (three parallel strokes) disappears, the if
  443. XXcharacter (arrow to the right) is entered as ->, the
  444. XXapply-to-all symbol (alpha) is entered as
  445. XX.IR aa ,
  446. XXthe compose symbol is entered as
  447. XX.IR o
  448. XX(lowercase O),
  449. XXand constants are preceded by
  450. XXan underscore instead of being overstruck.
  451. XXAlso, bottom will be generated by a call to
  452. XXthe primitive function
  453. XX.IR error,
  454. XXcharacters are entered as 'c or '\\c, and
  455. XXstrings (vectors of characters) are entered
  456. XXas "string".
  457. XXIn addition to the normal (left) insert functional
  458. XXform /,
  459. XXFPC provides tree insert \\/ and right insert \\.
  460. XXTree insert is used where the order of application
  461. XXis unimportant and may be expected to be more efficient
  462. XXon some systems or in some applications.
  463. XXUnary negation is given by
  464. XX.IR neg
  465. XXand - (minus) only accepts pairs of numbers.
  466. XX.PP
  467. XXSince there is a one-to-one
  468. XXmapping between fp functions and C procedures, characters
  469. XXnot allowed in C procedure names are not permitted in fp
  470. XXfunction names.
  471. XX.PP
  472. XXAs an example, the function !
  473. XX(factorial) defined in
  474. XXthe paper would be written as
  475. XX.br
  476. XX.br
  477. XXDef sub1 - o [id, _1]
  478. XX.br
  479. XXDef eq0 eq o [id, _0]
  480. XX.br
  481. XXDef fac eq0 -> _1 ; * o [id, fac o sub1]
  482. XX.SH NEW FUNCTIONS
  483. XXFPC provides several functions that do not appear in the
  484. XXBackus paper, and several more are planned.
  485. XXThe description of the currently available ones follows.
  486. XX.PP
  487. XX.IR append
  488. XXmerges any number of vectors into a single vector. Any
  489. XXtop-level nils disappear.
  490. XX.IR trunc
  491. XXis the floor function, it converts a real to the nearest
  492. XXinteger that is less than or equal to it.
  493. XX.IR newline
  494. XXis a constant-valued function which returns the string
  495. XXthat signals a new line on the local system. The value
  496. XXreturned is a string instead of a character since the
  497. XXsystem may require several characters (e.g., <CR, LF>) to
  498. XXsignal an end of line.
  499. XX.IR implode
  500. XXaccepts an input string and returns a symbol the name of
  501. XXwhich is the same as the input string.
  502. XX.IR explode
  503. XXis the corresponding function which accepts a symbol and
  504. XXreturns the string corresponding
  505. XXto the symbol's name.
  506. XX.PP
  507. XXThe function
  508. XX.IR arguments
  509. XXreturns the command line arguments, if any, in the order given;
  510. XXnormal arguments are returned as strings, options are returned
  511. XXas the pair \<option-char, string\>, where string is the
  512. XXvalue of the option, if any, or nil otherwise.
  513. XX.PP
  514. XX.IR trace
  515. XXis an output function: it is functionally identical to id,
  516. XXexcept that it only accepts strings as input. As a side effect,
  517. XXthe string is printed on the standard output with no
  518. XXquotes around it. The program cannot redirect the output to
  519. XXa file.
  520. XX.PP
  521. XXThe following functions all take as input a string representing
  522. XXa file name.
  523. XX.IR filetype
  524. XXreturns a symbol from the set \{none, empty, data, text,
  525. XXbinary\} if the file does not exist, has no data, contains
  526. XXa valid FP object, contains text, or contains non-textual
  527. XXcharacters, respectively. All data files could be read as
  528. XXtext files.
  529. XX.PP
  530. XX.IR readfile
  531. XXreturns the FP object read from the given file.
  532. XX.IR inputfile
  533. XXreturns a string holding the text that was read from the
  534. XXgiven file.
  535. XX
  536. XX.SH DIAGNOSTICS
  537. XXUnless -lnfp is used, programs check that the number
  538. XXof storage cells they allocated and returned was the same,
  539. XXand complain
  540. XXif that is not the case, i.e. if there was an error in the
  541. XXreference counting.
  542. XX.PP
  543. XXWhenever bottom is encountered, the stack is dumped to
  544. XXstderr (if -n and -lnfp were not used),
  545. XXtogether with the inputs to each of the functions on the
  546. XXstack. This can be a large amount of data.
  547. XX.PP
  548. XXThe function
  549. XX.IR checkpoint
  550. XXis functionally identical to the primitive
  551. XX.IR id
  552. XXbut outputs its argument to the output stream. This is helpful
  553. XXfor tracing data flow in functions.
  554. XX.PP
  555. XX.SH BUGS
  556. XX.PP
  557. XXPlease report any bugs to the author.
  558. XX.SH AUTHOR
  559. XXEd Biagioni
  560. SHAR_EOF
  561. if test 9433 -ne "`wc -c fpc.1`"
  562. then
  563. echo shar: error transmitting fpc.1 '(should have been 9433 characters)'
  564. fi
  565. echo shar: extracting fpc.c '(6698 characters)'
  566. sed 's/^XX//' << \SHAR_EOF > fpc.c
  567. XX/* fpc: fp to c translator
  568. XX */
  569. XX
  570. XX#include <stdio.h>
  571. XX#include <strings.h>
  572. XX#include "fpc.h"
  573. XXextern FILE * fopen ();
  574. XXextern char * sprintf ();
  575. XXextern int errno;
  576. XXextern char * sys_errlist [];
  577. XXextern int sys_nerr;
  578. XX
  579. XX/* here comes all the "exported" stuff, mostly flags showing which
  580. XX   switches were given on the command line */
  581. XXFILE * outf;
  582. XXint makemain;        /* this and the following used for flag settings: -m */
  583. XXchar mainfn [MAXIDLEN];    /* -mfname: the main function, if any */
  584. XXint verbose;        /* -v: print fpc version, functions being done */
  585. XXint useparms;        /* -p: if program has parms, input is <> */
  586. XXint rstring;        /* -i: read input as string, not fp object */
  587. XXint wstring;        /* -o: write output as string, not fp object */
  588. XXint redirout;        /* -c: output is of form: <<device op data>*> */
  589. XX/* Typical system-independent devices are graphic, turtle, bitmap.
  590. XX   For graphic, ops such as circle and line (with corresponding data
  591. XX   cx cy r, or x1 y1 x2 y2), are available. Similarly for turtle we
  592. XX   have <turtle move 2> and <turtle turnto west>. Not implemented. */
  593. XXint makeast;        /* -a: The main function is used in an AST system */
  594. XXint makedeb;        /* -d: trace all functions during execution */
  595. XXint makeee;        /* -e: trace function entry/exit (no params,res) */
  596. XXint check;        /* -n: do not check for illegal inputs */
  597. XXint printspace;        /* -s: print how much space was used and returned */
  598. XXchar tracefns [MAXIDS] [MAXIDLEN];    /* the functions to be traced (-t) */
  599. XXint traceptr;        /* the first free slot */
  600. XX/* end of the exported variables */
  601. XX
  602. XXstatic int dostdio = 1;    /* only if no file name is given */
  603. XX
  604. XXstatic int badexit = 0;    /* if syntax error was found, return (1) at end */
  605. XX
  606. XXstatic void resetglobals ()
  607. XX{
  608. XX  outf = stdout;
  609. XX  makemain = 0;
  610. XX  mainfn [0] = '\0';
  611. XX  rstring = 0;
  612. XX  wstring = 0;
  613. XX  redirout = 0;
  614. XX  makeast = 0;
  615. XX  makedeb = 0;
  616. XX  printspace = 0;
  617. XX  makeee = 0;
  618. XX  check = 1;
  619. XX  traceptr = 0;
  620. XX  verbose = 0;
  621. XX  useparms = 0;
  622. XX}
  623. XX
  624. XXstatic void clrmains ()
  625. XX{
  626. XX  rstring = 0;
  627. XX  wstring = 0;
  628. XX  redirout = 0;
  629. XX  makeast = 0;
  630. XX  useparms = 0;
  631. XX  printspace = 0;
  632. XX}
  633. XX
  634. XXstatic char * fname = 0;
  635. XX
  636. XXint main (argc, argv)
  637. XXint argc;
  638. XXchar *argv[];
  639. XX{
  640. XX  FILE *dataIn;
  641. XX  int argind, len;
  642. XX  char outname [256];
  643. XX  int swind;
  644. XX  char errbuf [256];            /* used for sprintf's */
  645. XX  extern void newfname ();
  646. XX  void closerror ();
  647. XX  char * syserror ();
  648. XX
  649. XX  resetglobals ();
  650. XX  for (argind = 1; argind < argc; argind++)
  651. XX  {
  652. XX    if (argv [argind] [0] != '-')
  653. XX    {
  654. XX      dostdio = 0;    /* at least one file was given */
  655. XX      if (! makemain)
  656. XX    clrmains ();
  657. XX      fname = argv [argind];
  658. XX      len = strlen (fname);
  659. XX      if ((fname [len - 3] != '.') ||
  660. XX      (fname [len - 2] != 'f') ||
  661. XX      (fname [len - 1] != 'p'))    /* wrong extension */
  662. XX      {
  663. XX    (void) sprintf (errbuf,
  664. XX                 "error in source file name (%s): should end in .fp\n",
  665. XX                fname);
  666. XX        yyerror (errbuf);
  667. XX    continue;
  668. XX      }
  669. XX      newfname (fname, outname);
  670. XX/* use newfname so whatever code generator is attached can decide how
  671. XX   to call the file, if any */
  672. XX      dataIn = fopen (argv [argind], "r");
  673. XX      if (*outname != '\0')
  674. XX        outf = fopen (outname, "w");
  675. XX      else
  676. XX        outf = stdout;
  677. XX      if ((dataIn == 0) || (outf == 0))
  678. XX      {
  679. XX    (void) sprintf (errbuf, "error opening file %s: %s\n",
  680. XX                (dataIn == 0) ? fname : outname, syserror ());
  681. XX    yyerror (errbuf);
  682. XX    continue;
  683. XX      }
  684. XX      if (makemain && (mainfn [0] == '\0'))
  685. XX      {
  686. XX    (void) strcpy (mainfn, fname);
  687. XX    mainfn [len - 3] = '\0';
  688. XX      }
  689. XX      fpcFile (dataIn, fname, outname);
  690. XX      if ((outf != stdout) && (fclose (outf) != 0))
  691. XX    closerror (outname);
  692. XX      else if (fclose (dataIn) != 0)
  693. XX    closerror (outname);
  694. XX      resetglobals ();
  695. XX    }
  696. XX    else    /* we are parsing a switch */
  697. XX      for (swind = 1; (argv [argind] [swind] != '\0'); swind++)
  698. XX      {
  699. XX    switch (argv [argind] [swind])
  700. XX        {
  701. XX      case 'v':
  702. XX        verbose = 1;
  703. XX        (void) printf ("fpc 1.0\n");
  704. XX        break;
  705. XX      case 'm':
  706. XX        makemain = 1;
  707. XX        if (argv [argind] [swind + 1] != '\0')
  708. XX/* function name is also given */
  709. XX          (void) strcpy (mainfn, (argv [argind]) + swind + 1);
  710. XX        argv [argind] [swind + 1] = '\0';   /* to break out of the loop */
  711. XX        break;
  712. XX      case 'a':
  713. XX        makeast = 1;
  714. XX        break;
  715. XX      case 'p':
  716. XX        useparms = 1;
  717. XX        break;
  718. XX      case 'i':
  719. XX        rstring = 1;
  720. XX        break;
  721. XX      case 'o':
  722. XX        wstring = 1;
  723. XX        break;
  724. XX      case 'c':
  725. XX        redirout = 1;
  726. XX        break;
  727. XX      case 'd':
  728. XX        makedeb = 1;
  729. XX        if (! check)
  730. XX          (void) fprintf (stderr,
  731. XX                  "option -n conflicts with -d, ignored\n");
  732. XX        check = 1;
  733. XX        break;
  734. XX      case 'e':
  735. XX        makeee = 1;
  736. XX        if (! check)
  737. XX          (void) fprintf (stderr,
  738. XX                  "option -n conflicts with -e, ignored\n");
  739. XX        check = 1;
  740. XX        break;
  741. XX      case 'n':
  742. XX        check = (makedeb || makeee);
  743. XX        if (check)
  744. XX          (void) fprintf (stderr,
  745. XX                  "option -n conflicts with -%c, ignored\n",
  746. XX               ((makedeb) ? 'd' : 'e'));
  747. XX        break;
  748. XX      case 's':
  749. XX        printspace = 1;
  750. XX        break;
  751. XX      case 't':
  752. XX        (void) strcpy (tracefns [traceptr++], (argv [argind]) + swind + 1);
  753. XX        argv [argind] [swind + 1] = '\0';   /* to break out of the loop */
  754. XX        break;
  755. XX      default:
  756. XX        (void) sprintf (errbuf, "unknown option -%c",
  757. XX                argv [argind] [swind]);
  758. XX        yyerror (errbuf);
  759. XX    }
  760. XX      }
  761. XX  }
  762. XX  if (dostdio)
  763. XX    fpcFile (stdin, "user input", "screen output");
  764. XX  return (badexit);    /* makefile will abort if something didn't compile */
  765. XX}
  766. XX
  767. XXstatic char * syserror ()
  768. XX{
  769. XX  char syserr [256];
  770. XX
  771. XX  if (errno < sys_nerr)
  772. XX    strcpy (syserr, sys_errlist [errno]);
  773. XX  else
  774. XX    (void) sprintf (syserr, "undocumented error number %d", errno);
  775. XX  return (syserr);
  776. XX}
  777. XX
  778. XXstatic void closerror (filename)
  779. XXchar * filename;
  780. XX{
  781. XX  char errbuf [256];
  782. XX
  783. XX  (void) sprintf (errbuf, "error closing file \"%s\": %s\n",
  784. XX          filename, syserror ());
  785. XX  yyerror (errbuf);
  786. XX}
  787. XX
  788. XXfpcFile (fptr, inname, outname)
  789. XXFILE *fptr;
  790. XXchar * inname, * outname;
  791. XX{
  792. XX  extern FILE * yyin;
  793. XX  void putfileheader ();
  794. XX  void putfiletail ();
  795. XX
  796. XX  putfileheader (inname, outname);
  797. XX  yyin = fptr;
  798. XX  yyparse ();
  799. XX  putfiletail ();
  800. XX}
  801. XX
  802. XXint current_line = 1;
  803. XX
  804. XXset_line (s)
  805. XXchar * s;
  806. XX{
  807. XX  while (((*s > '9') || (*s < '0')) && (*s != '\0'))
  808. XX    s++;
  809. XX  if (*s == '\0')
  810. XX    return;
  811. XX  (void) sscanf (s, "%d", ¤t_line);
  812. XX}
  813. XX
  814. XXinc_line ()
  815. XX{
  816. XX  current_line++;
  817. XX}
  818. XX
  819. XXyyerror (s)
  820. XXchar * s;
  821. XX{
  822. XX  extern char yytext [];
  823. XX
  824. XX  puterror (s, yytext);
  825. XX}
  826. XX
  827. XXputerror (s, t)
  828. XXchar * s;
  829. XXchar * t;
  830. XX{
  831. XX  extern char funname [];
  832. XX  extern int inerror;
  833. XX
  834. XX  if (! inerror)
  835. XX  {
  836. XX    if (fname != 0)
  837. XX      (void) fprintf (stderr, "\"%s\", ", fname);
  838. XX    (void) fprintf (stderr, "line %d: ", current_line);
  839. XX    (void) fprintf (stderr, "%s in function %s", s, funname);
  840. XX    if (*t != '\0')
  841. XX      (void) fprintf (stderr, ", token is %s", t);
  842. XX    (void) fprintf (stderr, "\n");
  843. XX  }
  844. XX  inerror = 1;
  845. XX  badexit = 1;
  846. XX}
  847. SHAR_EOF
  848. if test 6698 -ne "`wc -c fpc.c`"
  849. then
  850. echo shar: error transmitting fpc.c '(should have been 6698 characters)'
  851. fi
  852. echo shar: extracting fpc.h '(1357 characters)'
  853. sed 's/^XX//' << \SHAR_EOF > fpc.h
  854. XX/* fpc.h: defines some constants for array declarations */
  855. XX
  856. XX#ifndef MAXIDS
  857. XX#define MAXIDS    256    /* the maximum number of identifiers in a table */
  858. XX#endif
  859. XX
  860. XX#ifndef MAXIDLEN
  861. XX#define MAXIDLEN 64    /* max. number of characters in an identifier */
  862. XX#endif
  863. XX
  864. XX/* here comes all the "exported" stuff, mostly flags showing which
  865. XX   switches were given on the command line */
  866. XXextern FILE * outf;
  867. XX
  868. XXextern int makemain;    /* -m: make main calling the file name */
  869. XXextern char mainfn [MAXIDLEN];    /* -mfname: the main function, if any */
  870. XX
  871. XXextern int verbose;    /* -v: print fpc version, functions being done */
  872. XX
  873. XXextern int rstring;    /* -i: read input as string, not fp object */
  874. XXextern int wstring;    /* -o: write output as string, not fp object */
  875. XXextern int redirout;    /* -c: output is of form: <<file data>*> */
  876. XXextern int makeast;    /* -a: The main function is used in an AST system */
  877. XXextern int useparms;    /* -p: if program has parms, input is <> */
  878. XX
  879. XXextern int makedeb;    /* -d: trace all functions during execution */
  880. XXextern int makeee;    /* -e: print functions being called/returned */
  881. XXextern int check;    /* -n: check for illegal arguments */
  882. XXextern int printspace;    /* -s: print how much space was used and returned */
  883. XX
  884. XXextern char tracefns [MAXIDS] [MAXIDLEN]; /* the functions to be traced (-t) */
  885. XXextern int traceptr;    /* the first free slot */
  886. XX
  887. XX/* end of the exported variables */
  888. SHAR_EOF
  889. if test 1357 -ne "`wc -c fpc.h`"
  890. then
  891. echo shar: error transmitting fpc.h '(should have been 1357 characters)'
  892. fi
  893. echo shar: extracting stdfp.h '(1038 characters)'
  894. sed 's/^XX//' << \SHAR_EOF > stdfp.h
  895. XX/* stdfp.h: target file generated partly by fpc from source tmp.fp */
  896. XX
  897. XX#define FALSEOBJ      0
  898. XX#define TRUEOBJ       1
  899. XX#define INTCONST      2
  900. XX#define FLOATCONST    3
  901. XX#define ATOMCONST     4
  902. XX#define CHARCONST     5
  903. XX#define NILOBJ        6
  904. XX#define VECTOR        7
  905. XX
  906. XXtypedef struct fp_object * fp_data;
  907. XX
  908. XXstruct fp_object
  909. XX{
  910. XX  short fp_type;
  911. XX  short fp_ref;
  912. XX  union
  913. XX  {
  914. XX    long fp_int;
  915. XX    int fp_char; /* long for reasons of alignment in constant definitions */
  916. XX    char * fp_atom;
  917. XX    float fp_float;
  918. XX    fp_data fp_next;
  919. XX  } fp_header;
  920. XX  fp_data fp_entry;
  921. XX};
  922. XX
  923. XXstruct fp_constant
  924. XX{
  925. XX  short fp_type;
  926. XX  short fp_ref;
  927. XX  long fp_value;
  928. XX  fp_data fp_entry;
  929. XX};
  930. XX
  931. XXstruct fp_floatc
  932. XX{
  933. XX  short fp_type;
  934. XX  short fp_ref;
  935. XX  float fp_value;
  936. XX};
  937. XX
  938. XXstruct fp_charc
  939. XX{
  940. XX  short fp_type;
  941. XX  short fp_ref;
  942. XX  int fp_value;
  943. XX};
  944. XX
  945. XXstruct stackframe
  946. XX{
  947. XX  char * st_name;
  948. XX  fp_data st_data;
  949. XX  struct stackframe * st_prev;
  950. XX};
  951. XX
  952. XX#define inc_ref(d)    ((d)->fp_ref++)
  953. XX#define dec_ref(d)    if (((d)->fp_type == VECTOR) && \
  954. XX                (--((d)->fp_ref) <= 0)) returnvect (d)
  955. XX#define abs(n)    ((n) < 0 ? - (n) : (n))
  956. XX
  957. SHAR_EOF
  958. if test 1038 -ne "`wc -c stdfp.h`"
  959. then
  960. echo shar: error transmitting stdfp.h '(should have been 1038 characters)'
  961. fi
  962. echo shar: extracting fp.h '(997 characters)'
  963. sed 's/^XX//' << \SHAR_EOF > fp.h
  964. XX/* fp.h: header file for all fp programs translated to C using fpc.
  965. XX *    declares types, defines, some externs
  966. XX */
  967. XX
  968. XX#include "stdfp.h"
  969. XX
  970. XX/* #define MAXINT    0x7FFF        /* for 16-bit fp_ints */
  971. XX#define MAXINT        0x7FFFFFFF    /* for 32-bit fp_ints */
  972. XX/* #define MAXINT    0x7FFFFFFFFFFFFFFF    /* for 64-bit fp_ints */
  973. XX
  974. XX#define FNAMELEN    256    /* on UNIX, file names are under 256 chars */
  975. XX
  976. XX/* this type is just for determining the size of a constant object */
  977. XXstruct fp_const_size
  978. XX  {
  979. XX    short fp_const_type;
  980. XX    short fp_const_ref;
  981. XX    union {int fp_const_constant;
  982. XX           char * fp_const_atom; }
  983. XX        fp_const_header;
  984. XX  };
  985. XX
  986. XXstruct fp_atom
  987. XX{
  988. XX  short fp_type;
  989. XX  short fp_ref;
  990. XX  char * fp_atom;
  991. XX};
  992. XX
  993. XX/* these values are used by the storage manager */
  994. XX#define CONSTSIZE    (sizeof (struct fp_const_size))
  995. XX#define VECTSIZE    (sizeof (struct fp_object))
  996. XX
  997. XX#define fp_nil        (& nilobj)
  998. XX#define fp_true        (& tobj)
  999. XX#define fp_false    (& fobj)
  1000. XX
  1001. XXextern struct fp_object nilobj;
  1002. XXextern struct fp_object tobj;
  1003. XXextern struct fp_object fobj;
  1004. SHAR_EOF
  1005. if test 997 -ne "`wc -c fp.h`"
  1006. then
  1007. echo shar: error transmitting fp.h '(should have been 997 characters)'
  1008. fi
  1009. echo shar: extracting fpg.l '(1085 characters)'
  1010. sed 's/^XX//' << \SHAR_EOF > fpg.l
  1011. XX%%
  1012. XXDef        { return (Def); }
  1013. XX"->"        { return (Then); }
  1014. XX";"        { return (Else); }
  1015. XXo        { return (Compose); }
  1016. XXaa        { return (Alpha); }
  1017. XX"\\/"        { return (Tree); }
  1018. XX"/"        { return (Insert); }
  1019. XX"\\"        { return (Rinsert); }
  1020. XX","        { return (','); }
  1021. XX"["        { return ('['); }
  1022. XX"]"        { return (']'); }
  1023. XX"("        { return ('('); }
  1024. XX")"        { return (')'); }
  1025. XX"<"        { return ('<'); }
  1026. XX">"        { return ('>'); }
  1027. XX"_"        { return ('_'); }
  1028. XXbu        { return (Bu); }
  1029. XXbur        { return (Bur); }
  1030. XXwhile        { return (While); }
  1031. XX"+"        { return ('+'); }
  1032. XX"*"        { return ('*'); }
  1033. XX"div"        { return (Div); }
  1034. XX"="        { return ('='); }
  1035. XX"<="        { return (Leq); }
  1036. XX">="        { return (Geq); }
  1037. XX"!="        { return (Noteq); }
  1038. XXT        { return (TrueConst); }
  1039. XXF        { return (FalseConst); }
  1040. XX[a-zA-Z][a-zA-Z0-9]*    { return (Symbol); }
  1041. XX[0-9]+r        { return (Rsel); }
  1042. XX"-"[0-9]+\.[0-9]*    { return (Float); }
  1043. XX[0-9]+\.[0-9]*    { return (Float); }
  1044. XX"-"[0-9]+    { return (Sel); }
  1045. XX[0-9]+        { return (Sel); }
  1046. XX"-"        { return ('-'); }
  1047. XX\"[^"]*\"    { return (String); }
  1048. XX\'\\.        { return (CharConst); }
  1049. XX\'.        { return (CharConst); }
  1050. XX^#\ [0-9]+\ \".*\"    { set_line (yytext); }
  1051. XX#.*\n        { inc_line (); }
  1052. XX\n        { inc_line (); }
  1053. XX.        ;
  1054. SHAR_EOF
  1055. if test 1085 -ne "`wc -c fpg.l`"
  1056. then
  1057. echo shar: error transmitting fpg.l '(should have been 1085 characters)'
  1058. fi
  1059. echo shar: extracting fpg.y '(3413 characters)'
  1060. sed 's/^XX//' << \SHAR_EOF > fpg.y
  1061. XX%start FPProgram
  1062. XX%token Def Symbol Sel Rsel Then Else Compose Alpha Insert Rinsert Tree
  1063. XX%token Bu Bur While
  1064. XX%token ',' '[' ']' '(' ')' '<' '>' '_' '+' '-' '*' '='
  1065. XX%token Div Geq Leq Noteq TrueConst FalseConst String CharConst Float
  1066. XX%%
  1067. XX
  1068. XXFPProgram: FPDef
  1069. XX         | FPProgram FPDef
  1070. XX     ;
  1071. XX
  1072. XXFPDef: Def
  1073. XX       Symbol { parsefnstart (yytext); }
  1074. XX       Toplev { parsefnend (); }
  1075. XX     ;
  1076. XX
  1077. XXToplev: Comp
  1078. XX    Then
  1079. XX    { parsethen (); }
  1080. XX    Toplev
  1081. XX    Else
  1082. XX    { parseelse (); }
  1083. XX    Toplev
  1084. XX    { parseendif (); }
  1085. XX      | Bu
  1086. XX    { parsebustart (0); }
  1087. XX    Toplev
  1088. XX    { parsebufun (); }
  1089. XX    Object
  1090. XX    { parsebuobj (); }
  1091. XX      | Bur
  1092. XX    { parsebustart (1); }
  1093. XX    Toplev
  1094. XX    { parsebufun (); }
  1095. XX    Object
  1096. XX    { parsebuobj (); }
  1097. XX      | While
  1098. XX    { whilestart (); }
  1099. XX    Toplev
  1100. XX    { whilepred (); }
  1101. XX    Toplev
  1102. XX    { whilefun (); }
  1103. XX      | Comp
  1104. XX      ;
  1105. XX
  1106. XXComp: Expr
  1107. XX    | Expr
  1108. XX      Compose
  1109. XX      { parsecomp (); }
  1110. XX      Comp
  1111. XX    ;
  1112. XX
  1113. XXExpr: '('
  1114. XX      { startcomp (); }
  1115. XX      Toplev
  1116. XX      { endcomp (); }
  1117. XX      ')'
  1118. XX    | Alpha
  1119. XX      Expr
  1120. XX      { parseaa (); }
  1121. XX    | '[' ']'
  1122. XX      { parsenil (); }
  1123. XX    | '['
  1124. XX      { parseconstr (); }
  1125. XX      ToplevList
  1126. XX      ']'
  1127. XX      { constrnext (); endconstr (); }
  1128. XX    | Insert
  1129. XX      { parseinsert (0); }
  1130. XX      Expr
  1131. XX      { endinsert (); }
  1132. XX    | Rinsert
  1133. XX      { parseinsert (1); }
  1134. XX      Expr
  1135. XX      { endinsert (); }
  1136. XX    | Tree
  1137. XX      { parseinsert (2); }
  1138. XX      Expr
  1139. XX      { endinsert (); }
  1140. XX    | '_' Object
  1141. XX    | Sel
  1142. XX      { parsesel (yytext, 0); }
  1143. XX    | Rsel
  1144. XX      { parsesel (yytext, 1); }
  1145. XX    | Symbol
  1146. XX      { parsefncall (yytext); }
  1147. XX    | '+'
  1148. XX      { parsefncall ("plus"); }
  1149. XX    | '-'
  1150. XX      { parsefncall ("minus"); }
  1151. XX    | '*'
  1152. XX      { parsefncall ("times"); }
  1153. XX    | Div
  1154. XX      { parsefncall ("div"); }
  1155. XX    | '='
  1156. XX      { parsefncall ("eq"); }
  1157. XX    | '<'
  1158. XX      { parsefncall ("less"); }
  1159. XX    | '>'
  1160. XX      { parsefncall ("greater"); }
  1161. XX    | Geq
  1162. XX      { parsefncall ("gequal"); }
  1163. XX    | Leq
  1164. XX      { parsefncall ("lequal"); }
  1165. XX    | Noteq
  1166. XX      { parsefncall ("notequal"); }
  1167. XX    ;
  1168. XX
  1169. XXToplevList: Toplev
  1170. XX      | ToplevList ','
  1171. XX        { constrnext (); }
  1172. XX        Toplev
  1173. XX
  1174. XXObject: TrueConst
  1175. XX    { consttrue (); }
  1176. XX      | FalseConst
  1177. XX    { constfalse (); }
  1178. XX      | Sel
  1179. XX    { constnum (yytext); }
  1180. XX      | Symbol
  1181. XX    { constsym (yytext); }
  1182. XX      | String
  1183. XX    { conststr (yytext); }
  1184. XX      | CharConst
  1185. XX    { constchr (yytext); }
  1186. XX      | Float
  1187. XX    { constreal (yytext); }
  1188. XX      | '<' '>'
  1189. XX        { parsenil (); }
  1190. XX      | '<'
  1191. XX    { liststart (); }
  1192. XX    ObjList
  1193. XX    '>'
  1194. XX    { listend (); }
  1195. XX      | Def
  1196. XX    { constsym ("Def"); }
  1197. XX      | Alpha
  1198. XX    { constsym ("aa"); }
  1199. XX      | Compose
  1200. XX    { constsym ("o"); }
  1201. XX      | Div
  1202. XX    { constsym ("div"); }
  1203. XX      | Bu
  1204. XX    { constsym ("bu"); }
  1205. XX      | Bur
  1206. XX    { constsym ("bur"); }
  1207. XX      | While
  1208. XX    { constsym ("while"); }
  1209. XX      ;
  1210. XX
  1211. XXObjList: Object
  1212. XX     { listnext (); }
  1213. XX       | ObjList ','
  1214. XX     Object
  1215. XX     { listnext (); }
  1216. XX
  1217. XX%%
  1218. XX
  1219. XX#include "lex.yy.c"
  1220. XX
  1221. XX#undef YYMAXDEPTH
  1222. XX#define YYMAXDEPTH 2048
  1223. XX
  1224. XXvoid parsefnstart ();
  1225. XXvoid parsefnend ();
  1226. XXvoid parsethen ();
  1227. XXvoid parseelse ();
  1228. XXvoid parseendif ();
  1229. XXvoid parsebustart ();
  1230. XXvoid parsebufun ();
  1231. XXvoid parsebuobj ();
  1232. XXvoid whilestart ();
  1233. XXvoid whilepred ();
  1234. XXvoid whilefun ();
  1235. XXvoid parsecomp ();
  1236. XXvoid startcomp ();
  1237. XXvoid endcomp ();
  1238. XXvoid parseaa ();
  1239. XXvoid parseconstr ();
  1240. XXvoid constrnext ();
  1241. XXvoid endconstr ();
  1242. XXvoid parseinsert ();
  1243. XXvoid endinsert ();
  1244. XXvoid parsesel ();
  1245. XXvoid parsefncall ();
  1246. XXvoid parsenil ();
  1247. XXvoid consttrue ();
  1248. XXvoid constfalse ();
  1249. XXvoid constnum ();
  1250. XXvoid constsym ();
  1251. XXvoid conststr ();
  1252. XXvoid constchr ();
  1253. XXvoid constreal ();
  1254. XXvoid liststart ();
  1255. XXvoid listnext ();
  1256. XXvoid listend ();
  1257. XX
  1258. SHAR_EOF
  1259. if test 3413 -ne "`wc -c fpg.y`"
  1260. then
  1261. echo shar: error transmitting fpg.y '(should have been 3413 characters)'
  1262. fi
  1263. #    End of shell archive
  1264. exit 0
  1265.  
  1266.