File:
[gforth] /
gforth /
prims2x.fs
Revision
1.49:
download - view:
text,
annotated -
select for diffs
Fri Nov 10 10:04:20 2000 UTC (23 years, 4 months ago) by
anton
Branches:
MAIN
CVS tags:
HEAD
rewrote large parts of prims2x.fs to become more flexible (not restricted to
2 stacks, factored out common code for the stacks, etc.).
Changes in other files to go with the prims2x.fs changes
1: \ converts primitives to, e.g., C code
2:
3: \ Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc.
4:
5: \ This file is part of Gforth.
6:
7: \ Gforth is free software; you can redistribute it and/or
8: \ modify it under the terms of the GNU General Public License
9: \ as published by the Free Software Foundation; either version 2
10: \ of the License, or (at your option) any later version.
11:
12: \ This program is distributed in the hope that it will be useful,
13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: \ GNU General Public License for more details.
16:
17: \ You should have received a copy of the GNU General Public License
18: \ along with this program; if not, write to the Free Software
19: \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
20:
21:
22: \ This is not very nice (hard limits, no checking, assumes 1 chars = 1)
23:
24: \ Optimizations:
25: \ superfluous stores are removed. GCC removes the superfluous loads by itself
26: \ TOS and FTOS can be kept in register( variable)s.
27: \
28: \ Problems:
29: \ The TOS optimization is somewhat hairy. The problems by example:
30: \ 1) dup ( w -- w w ): w=TOS; sp-=1; sp[1]=w; TOS=w;
31: \ The store is not superfluous although the earlier opt. would think so
32: \ Alternatively: sp[0]=TOS; w=TOS; sp-=1; TOS=w;
33: \ 2) ( -- .. ): sp[0] = TOS; ... /* This additional store is necessary */
34: \ 3) ( .. -- ): ... TOS = sp[0]; /* as well as this load */
35: \ 4) ( -- ): /* but here they are unnecessary */
36: \ 5) Words that call NEXT themselves have to be done very carefully.
37: \
38: \ To do:
39: \ add the store optimization for doubles
40: \ regarding problem 1 above: It would be better (for over) to implement
41: \ the alternative
42:
43: warnings off
44:
45: [IFUNDEF] vocabulary \ we are executed just with kernel image
46: \ load the rest that is needed
47: \ (require fails because this file is needed from a
48: \ different directory with the wordlibraries)
49: include ./search.fs
50: include ./extend.fs
51: [THEN]
52:
53: [IFUNDEF] environment?
54: include ./environ.fs
55: [THEN]
56:
57: : struct% struct ; \ struct is redefined in gray
58:
59: include ./gray.fs
60:
61: 100 constant max-effect \ number of things on one side of a stack effect
62: 255 constant maxchar
63: maxchar 1+ constant eof-char
64: #tab constant tab-char
65: #lf constant nl-char
66:
67: variable rawinput \ pointer to next character to be scanned
68: variable endrawinput \ pointer to the end of the input (the char after the last)
69: variable cookedinput \ pointer to the next char to be parsed
70: variable line \ line number of char pointed to by input
71: 1 line !
72: 2variable filename \ filename of original input file
73: 0 0 filename 2!
74: 2variable f-comment
75: 0 0 f-comment 2!
76: variable skipsynclines \ are sync lines ("#line ...") invisible to the parser?
77: skipsynclines on
78:
79: : start ( -- addr )
80: cookedinput @ ;
81:
82: : end ( addr -- addr u )
83: cookedinput @ over - ;
84:
85: variable output \ xt ( -- ) of output word
86:
87: : printprim ( -- )
88: output @ execute ;
89:
90: \ stack types
91:
92: struct%
93: cell% 2* field stack-pointer \ stackpointer name
94: cell% 2* field stack-cast \ cast string for assignments to stack elements
95: cell% field stack-in \ number of stack items in effect in
96: cell% field stack-out \ number of stack items in effect out
97: end-struct stack%
98:
99: : make-stack ( addr-ptr u1 addr-cast u2 "stack-name" -- )
100: create stack% %allot >r
101: save-mem r@ stack-cast 2!
102: save-mem r> stack-pointer 2! ;
103:
104: s" sp" save-mem s" (Cell)" make-stack data-stack
105: s" fp" save-mem s" " make-stack fp-stack
106: \ !! initialize stack-in and stack-out
107:
108: \ stack items
109:
110: struct%
111: cell% 2* field item-name \ name, excluding stack prefixes
112: cell% field item-stack \ descriptor for the stack used, 0 is default
113: cell% field item-type \ descriptor for the item type
114: cell% field item-offset \ offset in stack items, 0 for the deepest element
115: end-struct item%
116:
117: : init-item ( addr u addr1 -- )
118: \ initialize item at addr1 with name addr u
119: \ !! remove stack prefix
120: dup item% %size erase
121: item-name 2! ;
122:
123: \ various variables for storing stuff of one primitive
124:
125: 2variable forth-name
126: 2variable wordset
127: 2variable c-name
128: 2variable doc
129: 2variable c-code
130: 2variable forth-code
131: 2variable stack-string
132: create effect-in max-effect item% %size * allot
133: create effect-out max-effect item% %size * allot
134: variable effect-in-end ( pointer )
135: variable effect-out-end ( pointer )
136: variable c-line
137: 2variable c-filename
138: variable name-line
139: 2variable name-filename
140: 2variable last-name-filename
141:
142: variable primitive-number -10 primitive-number !
143: Variable function-number 0 function-number !
144:
145: \ for several reasons stack items of a word are stored in a wordlist
146: \ since neither forget nor marker are implemented yet, we make a new
147: \ wordlist for every word and store it in the variable items
148: variable items
149:
150: \ a few more set ops
151:
152: : bit-equivalent ( w1 w2 -- w3 )
153: xor invert ;
154:
155: : complement ( set1 -- set2 )
156: empty ['] bit-equivalent binary-set-operation ;
157:
158: \ the parser
159:
160: eof-char max-member \ the whole character set + EOF
161:
162: : getinput ( -- n )
163: rawinput @ endrawinput @ =
164: if
165: eof-char
166: else
167: cookedinput @ c@
168: endif ;
169:
170: :noname ( n -- )
171: dup bl > if
172: emit space
173: else
174: .
175: endif ;
176: print-token !
177:
178: : testchar? ( set -- f )
179: getinput member? ;
180: ' testchar? test-vector !
181:
182: : checksyncline ( -- )
183: \ when input points to a newline, check if the next line is a
184: \ sync line. If it is, perform the appropriate actions.
185: rawinput @ >r
186: s" #line " r@ over compare 0<> if
187: rdrop 1 line +! EXIT
188: endif
189: 0. r> 6 chars + 20 >number drop >r drop line ! r> ( c-addr )
190: dup c@ bl = if
191: char+ dup c@ [char] " <> abort" sync line syntax"
192: char+ dup 100 [char] " scan drop swap 2dup - save-mem filename 2!
193: char+
194: endif
195: dup c@ nl-char <> abort" sync line syntax"
196: skipsynclines @ if
197: dup char+ rawinput !
198: rawinput @ c@ cookedinput @ c!
199: endif
200: drop ;
201:
202: : ?nextchar ( f -- )
203: ?not? if
204: filename 2@ type ." :" line @ 0 .r ." : syntax error, wrong char:"
205: getinput . cr
206: rawinput @ endrawinput @ over - 100 min type cr
207: abort
208: endif
209: rawinput @ endrawinput @ <> if
210: rawinput @ c@
211: 1 chars rawinput +!
212: 1 chars cookedinput +!
213: nl-char = if
214: checksyncline
215: endif
216: rawinput @ c@ cookedinput @ c!
217: endif ;
218:
219: : charclass ( set "name" -- )
220: ['] ?nextchar terminal ;
221:
222: : .. ( c1 c2 -- set )
223: ( creates a set that includes the characters c, c1<=c<=c2 )
224: empty copy-set
225: swap 1+ rot do
226: i over add-member
227: loop ;
228:
229: : ` ( -- terminal ) ( use: ` c )
230: ( creates anonymous terminal for the character c )
231: char singleton ['] ?nextchar make-terminal ;
232:
233: char a char z .. char A char Z .. union char _ singleton union charclass letter
234: char 0 char 9 .. charclass digit
235: bl singleton tab-char over add-member charclass white
236: nl-char singleton eof-char over add-member complement charclass nonl
237: nl-char singleton eof-char over add-member
238: char : over add-member complement charclass nocolonnl
239: bl 1+ maxchar .. char \ singleton complement intersection
240: charclass nowhitebq
241: bl 1+ maxchar .. charclass nowhite
242: char " singleton eof-char over add-member complement charclass noquote
243: nl-char singleton charclass nl
244: eof-char singleton charclass eof
245:
246:
247: (( letter (( letter || digit )) **
248: )) <- c-name ( -- )
249:
250: (( nowhitebq nowhite ** ))
251: <- name ( -- )
252:
253: Variable forth-flag
254: Variable c-flag
255:
256: (( (( ` f || ` F )) {{ start }} nonl **
257: {{ end forth-flag @ IF type cr ELSE 2drop THEN }}
258: )) <- forth-comment ( -- )
259:
260: (( (( ` c || ` C )) {{ start }} nonl **
261: {{ end c-flag @ IF type cr ELSE 2drop THEN }}
262: )) <- c-comment ( -- )
263:
264: (( ` - nonl ** {{
265: forth-flag @ IF ." [ELSE]" cr THEN
266: c-flag @ IF ." #else" cr THEN }}
267: )) <- else-comment
268:
269: (( ` + {{ start }} nonl ** {{ end
270: dup
271: IF c-flag @
272: IF ." #ifdef HAS_" bounds ?DO I c@ toupper emit LOOP cr
273: THEN
274: forth-flag @
275: IF ." has? " type ." [IF]" cr THEN
276: ELSE 2drop
277: c-flag @ IF ." #endif" cr THEN
278: forth-flag @ IF ." [THEN]" cr THEN
279: THEN }}
280: )) <- if-comment
281:
282: (( (( forth-comment || c-comment || else-comment || if-comment )) ?? nonl ** )) <- comment-body
283:
284: (( ` \ comment-body nl )) <- comment ( -- )
285:
286: (( {{ effect-in }} (( {{ start }} c-name {{ end 2 pick init-item item% %size + }} white ** )) ** {{ effect-in-end ! }}
287: ` - ` - white **
288: {{ effect-out }} (( {{ start }} c-name {{ end 2 pick init-item item% %size + }} white ** )) ** {{ effect-out-end ! }}
289: )) <- stack-effect ( -- )
290:
291: (( {{ s" " doc 2! s" " forth-code 2! }}
292: (( {{ line @ name-line ! filename 2@ name-filename 2! }}
293: {{ start }} name {{ end 2dup forth-name 2! c-name 2! }} white ++
294: ` ( white ** {{ start }} stack-effect {{ end stack-string 2! }} ` ) white **
295: {{ start }} name {{ end wordset 2! }} white **
296: (( {{ start }} c-name {{ end c-name 2! }} )) ?? nl
297: ))
298: (( ` " ` " {{ start }} (( noquote ++ ` " )) ++ {{ end 1- doc 2! }} ` " nl )) ??
299: {{ skipsynclines off line @ c-line ! filename 2@ c-filename 2! start }} (( nocolonnl nonl ** nl )) ** {{ end c-code 2! skipsynclines on }}
300: (( ` : nl
301: {{ start }} (( nonl ++ nl )) ++ {{ end forth-code 2! }}
302: )) ?? {{ printprim }}
303: (( nl || eof ))
304: )) <- primitive ( -- )
305:
306: (( (( comment || primitive || nl )) ** eof ))
307: parser primitives2something
308: warnings @ [IF]
309: .( parser generated ok ) cr
310: [THEN]
311:
312: : primfilter ( file-id xt -- )
313: \ fileid is for the input file, xt ( -- ) is for the output word
314: output !
315: here dup rawinput ! cookedinput !
316: here unused rot read-file throw
317: dup here + endrawinput !
318: allot
319: align
320: checksyncline
321: \ begin
322: \ getinput dup eof-char = ?EXIT emit true ?nextchar
323: \ again ;
324: primitives2something ;
325:
326: \ types
327:
328: struct%
329: cell% 2* field type-c-name
330: cell% field type-stack \ default stack
331: cell% field type-size \ size of type in stack items
332: cell% field type-fetch \ xt of fetch code generator ( item -- )
333: cell% field type-store \ xt of store code generator ( item -- )
334: end-struct type%
335:
336: : stack-access ( n stack -- )
337: \ print a stack access at index n of stack
338: stack-pointer 2@ type
339: dup
340: if
341: ." [" 0 .r ." ]"
342: else
343: drop ." TOS"
344: endif ;
345:
346: : item-in-index ( item -- n )
347: \ n is the index of item (in the in-effect)
348: >r r@ item-stack @ stack-in @ r> item-offset @ - 1- ;
349:
350: : fetch-single ( item -- )
351: \ fetch a single stack item from its stack
352: >r
353: r@ item-name 2@ type
354: ." = ("
355: r@ item-type @ type-c-name 2@ type ." ) "
356: r@ item-in-index r@ item-stack @ stack-access
357: ." ;" cr
358: rdrop ;
359:
360: : fetch-double ( item -- )
361: \ fetch a double stack item from its stack
362: >r
363: ." FETCH_DCELL("
364: r@ item-name 2@ type ." , "
365: r@ item-in-index r@ item-stack @ 2dup stack-access
366: ." , " -1 under+ stack-access
367: ." );" cr
368: rdrop ;
369:
370: : same-as-in? ( item -- f )
371: \ f is true iff the offset and stack of item is the same as on input
372: >r
373: r@ item-name 2@ items @ search-wordlist 0=
374: abort" bug"
375: execute @
376: dup r@ =
377: if \ item first appeared in output
378: drop false
379: else
380: dup item-stack @ r@ item-stack @ =
381: swap item-offset @ r@ item-offset @ = and
382: endif
383: rdrop ;
384:
385: : item-out-index ( item -- n )
386: \ n is the index of item (in the in-effect)
387: >r r@ item-stack @ stack-out @ r> item-offset @ - 1- ;
388:
389: : really-store-single ( item -- )
390: >r
391: r@ item-out-index r@ item-stack @ stack-access ." = "
392: r@ item-stack @ stack-cast 2@ type
393: r@ item-name 2@ type ." ;"
394: rdrop ;
395:
396: : store-single ( item -- )
397: >r
398: r@ same-as-in?
399: if
400: r@ item-in-index 0= r@ item-out-index 0= xor
401: if
402: ." IF_" r@ item-stack @ stack-pointer 2@ type
403: ." TOS(" r@ really-store-single ." );" cr
404: endif
405: else
406: r@ really-store-single cr
407: endif
408: rdrop ;
409:
410: : store-double ( item -- )
411: \ !! store optimization is not performed, because it is not yet needed
412: >r
413: ." STORE_DCELL(" r@ item-name 2@ type ." , "
414: r@ item-out-index r@ item-stack @ 2dup stack-access
415: ." , " -1 under+ stack-access
416: ." );" cr
417: rdrop ;
418:
419:
420: : single-type ( -- xt1 xt2 n stack )
421: ['] fetch-single ['] store-single 1 data-stack ;
422:
423: : double-type ( -- xt1 xt2 n stack )
424: ['] fetch-double ['] store-double 2 data-stack ;
425:
426: : float-type ( -- xt1 xt2 n stack )
427: ['] fetch-single ['] store-single 1 fp-stack ;
428:
429: : s, ( addr u -- )
430: \ allocate a string
431: here swap dup allot move ;
432:
433: : starts-with { addr u xt1 xt2 n stack -- } ( "prefix" -- )
434: \ describes a type
435: \ addr u specifies the C type name
436: \ stack effect entries of the type start with prefix
437: create type% %allot >r
438: addr u save-mem r@ type-c-name 2!
439: xt1 r@ type-fetch !
440: xt2 r@ type-store !
441: n r@ type-size !
442: stack r@ type-stack !
443: rdrop ;
444:
445: wordlist constant types
446: get-current
447: types set-current
448:
449: s" Bool" single-type starts-with f
450: s" Char" single-type starts-with c
451: s" Cell" single-type starts-with n
452: s" Cell" single-type starts-with w
453: s" UCell" single-type starts-with u
454: s" DCell" double-type starts-with d
455: s" UDCell" double-type starts-with ud
456: s" Float" float-type starts-with r
457: s" Cell *" single-type starts-with a_
458: s" Char *" single-type starts-with c_
459: s" Float *" single-type starts-with f_
460: s" DFloat *" single-type starts-with df_
461: s" SFloat *" single-type starts-with sf_
462: s" Xt" single-type starts-with xt
463: s" WID" single-type starts-with wid
464: s" struct F83Name *" single-type starts-with f83name
465:
466: set-current
467:
468: : get-type ( addr1 u1 -- type-descr )
469: \ get the type of the name in addr1 u1
470: \ type-descr is a pointer to a type-descriptor
471: 0 swap ?do
472: dup i types search-wordlist
473: if \ ok, we have the type ( addr1 xt )
474: execute nip
475: UNLOOP EXIT
476: endif
477: -1 s+loop
478: \ we did not find a type, abort
479: true abort" unknown type prefix" ;
480:
481: : declare ( addr "name" -- )
482: \ remember that there is a stack item at addr called name
483: create , ;
484:
485: : declaration ( item -- )
486: dup item-name 2@ items @ search-wordlist
487: if \ already declared ( item xt )
488: execute @ 2dup item-type @ swap item-type !
489: item-stack @ swap item-stack ! \ !! does not generalize to stack prefixes
490: else ( addr )
491: dup item-name 2@ nextname dup declare ( addr )
492: dup >r item-name 2@ 2dup get-type ( addr1 u type-descr )
493: dup type-stack @ r@ item-stack ! \ !! only if item-stack @ 0=
494: dup r> item-type ! ( addr1 u type-descr )
495: type-c-name 2@ type space type ." ;" cr
496: endif ;
497:
498: : declaration-list ( addr1 addr2 -- )
499: swap ?do
500: i declaration
501: item% %size +loop ;
502:
503: : declarations ( -- )
504: wordlist dup items ! set-current
505: effect-in effect-in-end @ declaration-list
506: effect-out effect-out-end @ declaration-list ;
507:
508: \ offset computation
509: \ the leftmost (i.e. deepest) item has offset 0
510: \ the rightmost item has the highest offset
511:
512: : compute-offset { item xt -- }
513: \ xt specifies in/out; update stack-in/out and set item-offset
514: item item-type @ type-size @
515: item item-stack @ xt execute dup @ >r +!
516: r> item item-offset ! ;
517:
518: : compute-list ( addr1 addr2 xt -- )
519: { xt }
520: swap u+do
521: i xt compute-offset
522: item% %size +loop ;
523:
524: : clear-stack { -- }
525: dup stack-in off stack-out off ;
526:
527:
528: : compute-offsets ( -- )
529: data-stack clear-stack fp-stack clear-stack
530: effect-in effect-in-end @ ['] stack-in compute-list
531: effect-out effect-out-end @ ['] stack-out compute-list ;
532:
533: : flush-a-tos { stack -- }
534: stack stack-out @ 0<> stack stack-in @ 0= and
535: if
536: ." IF_" stack stack-pointer 2@ 2dup type ." TOS("
537: 2dup type ." [0] = " type ." TOS);" cr
538: endif ;
539:
540: : flush-tos ( -- )
541: data-stack flush-a-tos
542: fp-stack flush-a-tos ;
543:
544: : fill-a-tos { stack -- }
545: stack stack-out @ 0= stack stack-in @ 0<> and
546: if
547: ." IF_" stack stack-pointer 2@ 2dup type ." TOS("
548: 2dup type ." TOS = " type ." [0]);" cr
549: endif ;
550:
551: : fill-tos ( -- )
552: fp-stack fill-a-tos
553: data-stack fill-a-tos ;
554:
555: : fetch ( addr -- )
556: dup item-type @ type-fetch @ execute ;
557:
558: : fetches ( -- )
559: effect-in-end @ effect-in ?do
560: i fetch
561: item% %size +loop ;
562:
563: : stack-pointer-update { stack -- }
564: \ stack grow downwards
565: stack stack-in @ stack stack-out @ -
566: ?dup-if \ this check is not necessary, gcc would do this for us
567: stack stack-pointer 2@ type ." += " 0 .r ." ;" cr
568: endif ;
569:
570: : stack-pointer-updates ( -- )
571: data-stack stack-pointer-update
572: fp-stack stack-pointer-update ;
573:
574: : store ( item -- )
575: \ f is true if the item should be stored
576: \ f is false if the store is probably not necessary
577: dup item-type @ type-store @ execute ;
578:
579: : stores ( -- )
580: effect-out-end @ effect-out ?do
581: i store
582: item% %size +loop ;
583:
584: : output-c ( -- )
585: ." I_" c-name 2@ type ." : /* " forth-name 2@ type ." ( " stack-string 2@ type ." ) */" cr
586: ." /* " doc 2@ type ." */" cr
587: ." NAME(" [char] " emit forth-name 2@ type [char] " emit ." )" cr \ debugging
588: ." {" cr
589: ." DEF_CA" cr
590: declarations
591: compute-offsets \ for everything else
592: ." NEXT_P0;" cr
593: flush-tos
594: fetches
595: stack-pointer-updates
596: ." {" cr
597: ." #line " c-line @ . [char] " emit c-filename 2@ type [char] " emit cr
598: c-code 2@ type
599: ." }" cr
600: ." NEXT_P1;" cr
601: stores
602: fill-tos
603: ." NEXT_P2;" cr
604: ." }" cr
605: cr
606: ;
607:
608: : stack-used? { stack -- f }
609: stack stack-in @ stack stack-out @ or 0<> ;
610:
611: : output-funclabel ( -- )
612: 1 function-number +!
613: ." &I_" c-name 2@ type ." ," cr ;
614:
615: : output-forthname ( -- )
616: 1 function-number +!
617: '" emit forth-name 2@ type '" emit ." ," cr ;
618:
619: : output-c-func ( -- )
620: \ used for word libraries
621: 1 function-number +!
622: ." Cell * I_" c-name 2@ type ." (Cell *SP, Cell **FP) /* " forth-name 2@ type
623: ." ( " stack-string 2@ type ." ) */" cr
624: ." /* " doc 2@ type ." */" cr
625: ." NAME(" [char] " emit forth-name 2@ type [char] " emit ." )" cr
626: \ debugging
627: ." {" cr
628: declarations
629: compute-offsets \ for everything else
630: data-stack stack-used? IF ." Cell *sp=SP;" cr THEN
631: fp-stack stack-used? IF ." Cell *fp=*FP;" cr THEN
632: flush-tos
633: fetches
634: stack-pointer-updates
635: fp-stack stack-used? IF ." *FP=fp;" cr THEN
636: ." {" cr
637: ." #line " c-line @ . [char] " emit c-filename 2@ type [char] " emit cr
638: c-code 2@ type
639: ." }" cr
640: stores
641: fill-tos
642: ." return (sp);" cr
643: ." }" cr
644: cr ;
645:
646: : output-label ( -- )
647: ." (Label)&&I_" c-name 2@ type ." ," cr
648: -1 primitive-number +! ;
649:
650: : output-alias ( -- )
651: ( primitive-number @ . ." alias " ) ." Primitive " forth-name 2@ type cr
652: -1 primitive-number +! ;
653:
654: : output-forth ( -- )
655: forth-code @ 0=
656: IF \ output-alias
657: \ this is bad for ec: an alias is compiled if tho word does not exist!
658: \ JAW
659: ELSE ." : " forth-name 2@ type ." ( "
660: stack-string 2@ type ." )" cr
661: forth-code 2@ type cr
662: -1 primitive-number +!
663: THEN ;
664:
665: : output-tag-file ( -- )
666: name-filename 2@ last-name-filename 2@ compare if
667: name-filename 2@ last-name-filename 2!
668: #ff emit cr
669: name-filename 2@ type
670: ." ,0" cr
671: endif ;
672:
673: : output-tag ( -- )
674: output-tag-file
675: forth-name 2@ 1+ type
676: 127 emit
677: space forth-name 2@ type space
678: 1 emit
679: name-line @ 0 .r
680: ." ,0" cr ;
681:
682: [IFDEF] documentation
683: : register-doc ( -- )
684: get-current documentation set-current
685: forth-name 2@ nextname create
686: forth-name 2@ 2,
687: stack-string 2@ condition-stack-effect 2,
688: wordset 2@ 2,
689: c-name 2@ condition-pronounciation 2,
690: doc 2@ 2,
691: set-current ;
692: [THEN]
693:
694: : process-file ( addr u xt -- )
695: >r
696: 2dup filename 2!
697: 0 function-number !
698: r/o open-file abort" cannot open file"
699: warnings @ if
700: ." ------------ CUT HERE -------------" cr endif
701: r> primfilter ;
702:
703: : process ( xt -- )
704: bl word count rot
705: process-file ;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>