[gforth] / gforth / kernel / int.fs  

gforth: gforth/kernel/int.fs


1 : pazsan 1.1 \ definitions needed for interpreter only
2 :    
3 : anton 1.90 \ Copyright (C) 1995-2000 Free Software Foundation, Inc.
4 : anton 1.11
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 : anton 1.63 \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
20 : anton 1.11
21 : pazsan 1.1 \ \ Revision-Log
22 :    
23 :     \ put in seperate file 14sep97jaw
24 :    
25 :     \ \ input stream primitives 23feb93py
26 :    
27 : jwilke 1.33 require ./basics.fs \ bounds decimal hex ...
28 :     require ./io.fs \ type ...
29 :     require ./nio.fs \ . <# ...
30 :     require ./errore.fs \ .error ...
31 : anton 1.50 require kernel/version.fs \ version-string
32 : jwilke 1.33 require ./../chains.fs
33 :    
34 : pazsan 1.64 has? new-input 0= [IF]
35 : crook 1.43 : tib ( -- c-addr ) \ core-ext t-i-b
36 : crook 1.40 \G @i{c-addr} is the address of the Terminal Input Buffer.
37 : crook 1.29 \G OBSOLESCENT: @code{source} superceeds the function of this word.
38 : pazsan 1.1 >tib @ ;
39 :    
40 : crook 1.29 Defer source ( -- c-addr u ) \ core
41 : pazsan 1.1 \ used by dodefer:, must be defer
42 : crook 1.40 \G @i{c-addr} is the address of the input buffer and @i{u} is the
43 : crook 1.29 \G number of characters in it.
44 : pazsan 1.1
45 : crook 1.29 : (source) ( -- c-addr u )
46 : pazsan 1.1 tib #tib @ ;
47 :     ' (source) IS source
48 : pazsan 1.64 [THEN]
49 : pazsan 1.1
50 :     : (word) ( addr1 n1 char -- addr2 n2 )
51 :     dup >r skip 2dup r> scan nip - ;
52 :    
53 :     \ (word) should fold white spaces
54 :     \ this is what (parse-white) does
55 :    
56 :     \ word parse 23feb93py
57 :    
58 : crook 1.29 : sword ( char -- addr len ) \ gforth s-word
59 : crook 1.40 \G Parses like @code{word}, but the output is like @code{parse} output.
60 : anton 1.47 \G @xref{core-idef}.
61 : anton 1.3 \ this word was called PARSE-WORD until 0.3.0, but Open Firmware and
62 :     \ dpANS6 A.6.2.2008 have a word with that name that behaves
63 :     \ differently (like NAME).
64 : pazsan 1.1 source 2dup >r >r >in @ over min /string
65 :     rot dup bl = IF drop (parse-white) ELSE (word) THEN
66 :     2dup + r> - 1+ r> min >in ! ;
67 :    
68 : crook 1.29 : word ( char "<chars>ccc<char>-- c-addr ) \ core
69 : crook 1.40 \G Skip leading delimiters. Parse @i{ccc}, delimited by
70 :     \G @i{char}, in the parse area. @i{c-addr} is the address of a
71 : crook 1.29 \G transient region containing the parsed string in
72 : crook 1.40 \G counted-string format. If the parse area was empty or
73 : crook 1.29 \G contained no characters other than delimiters, the resulting
74 :     \G string has zero length. A program may replace characters within
75 :     \G the counted string. OBSOLESCENT: the counted string has a
76 :     \G trailing space that is not included in its length.
77 :     sword here place bl here count + c! here ;
78 :    
79 :     : parse ( char "ccc<char>" -- c-addr u ) \ core-ext
80 : anton 1.80 \G Parse @i{ccc}, delimited by @i{char}, in the parse
81 :     \G area. @i{c-addr u} specifies the parsed string within the
82 :     \G parse area. If the parse area was empty, @i{u} is 0.
83 : crook 1.29 >r source >in @ over min /string over swap r> scan >r
84 : anton 1.80 over - dup r> IF 1+ THEN >in +! ;
85 : pazsan 1.1
86 :     \ name 13feb93py
87 :    
88 :     [IFUNDEF] (name) \ name might be a primitive
89 :    
90 : crook 1.40 : (name) ( -- c-addr count ) \ gforth
91 : pazsan 1.1 source 2dup >r >r >in @ /string (parse-white)
92 :     2dup + r> - 1+ r> min >in ! ;
93 :     \ name count ;
94 :     [THEN]
95 :    
96 :     : name-too-short? ( c-addr u -- c-addr u )
97 :     dup 0= -&16 and throw ;
98 :    
99 :     : name-too-long? ( c-addr u -- c-addr u )
100 : anton 1.67 dup lcount-mask u> -&19 and throw ;
101 : pazsan 1.1
102 :     \ \ Number parsing 23feb93py
103 :    
104 :     \ number? number 23feb93py
105 :    
106 :     hex
107 : anton 1.110 const Create bases 0A , 10 , 2 , 0A ,
108 : anton 1.109 \ 10 16 2 10
109 : pazsan 1.1
110 : anton 1.18 \ !! protect BASE saving wrapper against exceptions
111 : pazsan 1.1 : getbase ( addr u -- addr' u' )
112 : anton 1.108 2dup s" 0x" string-prefix? >r
113 :     2dup s" 0X" string-prefix? r> or
114 : anton 1.110 base @ #34 < and if
115 : anton 1.108 hex 2 /string
116 :     endif
117 : anton 1.109 over c@ [char] # - dup 4 u<
118 : pazsan 1.1 IF
119 :     cells bases + @ base ! 1 /string
120 :     ELSE
121 :     drop
122 :     THEN ;
123 :    
124 : pazsan 1.20 : sign? ( addr u -- addr u flag )
125 : jwilke 1.33 over c@ [char] - = dup >r
126 : pazsan 1.1 IF
127 :     1 /string
128 :     THEN
129 : pazsan 1.20 r> ;
130 :    
131 : anton 1.109 : s'>unumber? ( addr u -- ud flag )
132 :     \ convert string "C" or "C'" to character code
133 :     dup 0= if
134 :     false exit
135 :     endif
136 :     over c@ >r
137 :     1 /string s" '" 2swap string-prefix?
138 :     r> 0 rot ;
139 :    
140 : pazsan 1.20 : s>unumber? ( addr u -- ud flag )
141 : anton 1.109 over c@ '' = if
142 :     1 /string s'>unumber? exit
143 :     endif
144 : pazsan 1.21 base @ >r dpl on getbase
145 : pazsan 1.20 0. 2swap
146 : anton 1.18 BEGIN ( d addr len )
147 : pazsan 1.1 dup >r >number dup
148 : anton 1.18 WHILE \ there are characters left
149 : pazsan 1.1 dup r> -
150 : anton 1.18 WHILE \ the last >number parsed something
151 :     dup 1- dpl ! over c@ [char] . =
152 :     WHILE \ the current char is '.'
153 : pazsan 1.1 1 /string
154 : anton 1.18 REPEAT THEN \ there are unparseable characters left
155 : pazsan 1.21 2drop false
156 : pazsan 1.20 ELSE
157 :     rdrop 2drop true
158 : pazsan 1.21 THEN
159 :     r> base ! ;
160 : pazsan 1.20
161 :     \ ouch, this is complicated; there must be a simpler way - anton
162 :     : s>number? ( addr len -- d f )
163 :     \ converts string addr len into d, flag indicates success
164 : pazsan 1.21 sign? >r
165 : pazsan 1.20 s>unumber?
166 :     0= IF
167 : pazsan 1.21 rdrop false
168 : anton 1.18 ELSE \ no characters left, all ok
169 : pazsan 1.20 r>
170 : pazsan 1.1 IF
171 :     dnegate
172 :     THEN
173 : anton 1.18 true
174 : pazsan 1.21 THEN ;
175 : pazsan 1.1
176 : anton 1.18 : s>number ( addr len -- d )
177 :     \ don't use this, there is no way to tell success
178 :     s>number? drop ;
179 :    
180 : pazsan 1.1 : snumber? ( c-addr u -- 0 / n -1 / d 0> )
181 : anton 1.18 s>number? 0=
182 : pazsan 1.1 IF
183 :     2drop false EXIT
184 :     THEN
185 : anton 1.18 dpl @ dup 0< IF
186 : pazsan 1.1 nip
187 : anton 1.18 ELSE
188 :     1+
189 : pazsan 1.1 THEN ;
190 :    
191 :     : number? ( string -- string 0 / n -1 / d 0> )
192 :     dup >r count snumber? dup if
193 :     rdrop
194 :     else
195 :     r> swap
196 :     then ;
197 :    
198 :     : number ( string -- d )
199 :     number? ?dup 0= abort" ?" 0<
200 :     IF
201 :     s>d
202 :     THEN ;
203 :    
204 :     \ \ Comments ( \ \G
205 :    
206 : crook 1.29 : ( ( compilation 'ccc<close-paren>' -- ; run-time -- ) \ thisone- core,file paren
207 : crook 1.17 \G ** this will not get annotated. The alias in glocals.fs will instead **
208 : crook 1.29 \G It does not work to use "wordset-" prefix since this file is glossed
209 :     \G by cross.fs which doesn't have the same functionalty as makedoc.fs
210 : pazsan 1.1 [char] ) parse 2drop ; immediate
211 :    
212 : anton 1.51 : \ ( compilation 'ccc<newline>' -- ; run-time -- ) \ thisone- core-ext,block-ext backslash
213 : crook 1.29 \G ** this will not get annotated. The alias in glocals.fs will instead **
214 :     \G It does not work to use "wordset-" prefix since this file is glossed
215 :     \G by cross.fs which doesn't have the same functionalty as makedoc.fs
216 : pazsan 1.12 [ has? file [IF] ]
217 : pazsan 1.1 blk @
218 :     IF
219 :     >in @ c/l / 1+ c/l * >in !
220 :     EXIT
221 :     THEN
222 : pazsan 1.12 [ [THEN] ]
223 : pazsan 1.1 source >in ! drop ; immediate
224 :    
225 : anton 1.51 : \G ( compilation 'ccc<newline>' -- ; run-time -- ) \ gforth backslash-gee
226 : crook 1.19 \G Equivalent to @code{\} but used as a tag to annotate definition
227 :     \G comments into documentation.
228 : pazsan 1.1 POSTPONE \ ; immediate
229 :    
230 :     \ \ object oriented search list 17mar93py
231 :    
232 :     \ word list structure:
233 :    
234 :     struct
235 :     cell% field find-method \ xt: ( c_addr u wid -- nt )
236 :     cell% field reveal-method \ xt: ( nt wid -- ) \ used by dofield:, must be field
237 :     cell% field rehash-method \ xt: ( wid -- ) \ re-initializes a "search-data" (hashtables)
238 :     cell% field hash-method \ xt: ( wid -- ) \ initializes ""
239 :     \ \ !! what else
240 :     end-struct wordlist-map-struct
241 :    
242 :     struct
243 : pazsan 1.6 cell% field wordlist-map \ pointer to a wordlist-map-struct
244 : anton 1.13 cell% field wordlist-id \ linked list of words (for WORDS etc.)
245 : pazsan 1.1 cell% field wordlist-link \ link field to other wordlists
246 : anton 1.13 cell% field wordlist-extend \ wordlist extensions (eg bucket offset)
247 : pazsan 1.1 end-struct wordlist-struct
248 :    
249 : pazsan 1.103 has? f83headerstring [IF]
250 :     : f83find ( addr len wordlist -- nt / false )
251 :     wordlist-id @ (f83find) ;
252 :     [ELSE]
253 : pazsan 1.1 : f83find ( addr len wordlist -- nt / false )
254 : anton 1.67 wordlist-id @ (listlfind) ;
255 : pazsan 1.103 [THEN]
256 : pazsan 1.1
257 :     : initvoc ( wid -- )
258 :     dup wordlist-map @ hash-method perform ;
259 :    
260 :     \ Search list table: find reveal
261 :     Create f83search ( -- wordlist-map )
262 :     ' f83find A, ' drop A, ' drop A, ' drop A,
263 :    
264 : pazsan 1.6 here G f83search T A, NIL A, NIL A, NIL A,
265 : pazsan 1.1 AValue forth-wordlist \ variable, will be redefined by search.fs
266 :    
267 :     AVariable lookup forth-wordlist lookup !
268 :     \ !! last is user and lookup?! jaw
269 :     AVariable current ( -- addr ) \ gforth
270 : crook 1.43 \G @code{Variable} -- holds the @i{wid} of the compilation word list.
271 : pazsan 1.1 AVariable voclink forth-wordlist wordlist-link voclink !
272 : anton 1.38 \ lookup AValue context ( -- addr ) \ gforth
273 :     Defer context ( -- addr ) \ gforth
274 : crook 1.43 \G @code{context} @code{@@} is the @i{wid} of the word list at the
275 :     \G top of the search order.
276 : pazsan 1.1
277 : anton 1.38 ' lookup is context
278 : pazsan 1.1 forth-wordlist current !
279 :    
280 :     \ \ header, finding, ticks 17dec92py
281 :    
282 : pazsan 1.69 \ The constants are defined as 32 bits, but then erased
283 :     \ and overwritten by the right ones
284 : anton 1.67
285 : pazsan 1.103 has? f83headerstring [IF]
286 :     \ to save space, Gforth EC limits words to 31 characters
287 :     $80 constant alias-mask
288 :     $40 constant immediate-mask
289 :     $20 constant restrict-mask
290 :     $1f constant lcount-mask
291 :     [ELSE]
292 : anton 1.67 $80000000 constant alias-mask
293 : pazsan 1.69 1 bits/char 1 - lshift
294 :     -1 cells allot bigendian [IF] c, 0 1 cells 1- times
295 :     [ELSE] 0 1 cells 1- times c, [THEN]
296 : anton 1.67 $40000000 constant immediate-mask
297 : pazsan 1.69 1 bits/char 2 - lshift
298 :     -1 cells allot bigendian [IF] c, 0 1 cells 1- times
299 :     [ELSE] 0 1 cells 1- times c, [THEN]
300 : anton 1.67 $20000000 constant restrict-mask
301 : pazsan 1.69 1 bits/char 3 - lshift
302 :     -1 cells allot bigendian [IF] c, 0 1 cells 1- times
303 :     [ELSE] 0 1 cells 1- times c, [THEN]
304 : anton 1.67 $1fffffff constant lcount-mask
305 : pazsan 1.69 1 bits/char 3 - lshift 1 -
306 : pazsan 1.71 -1 cells allot bigendian [IF] c, -1 1 cells 1- times
307 :     [ELSE] -1 1 cells 1- times c, [THEN]
308 : pazsan 1.103 [THEN]
309 : pazsan 1.1
310 :     \ higher level parts of find
311 :    
312 :     : flag-sign ( f -- 1|-1 )
313 :     \ true becomes 1, false -1
314 :     0= 2* 1+ ;
315 :    
316 : anton 1.79 : ticking-compile-only-error ( ... -- )
317 :     -&2048 throw ;
318 : pazsan 1.1
319 : anton 1.93 : compile-only-error ( ... -- )
320 :     -&14 throw ;
321 :    
322 : pazsan 1.1 : (cfa>int) ( cfa -- xt )
323 :     [ has? compiler [IF] ]
324 :     dup interpret/compile?
325 :     if
326 :     interpret/compile-int @
327 :     then
328 :     [ [THEN] ] ;
329 :    
330 : anton 1.67 : (x>int) ( cfa w -- xt )
331 : pazsan 1.1 \ get interpretation semantics of name
332 :     restrict-mask and
333 :     if
334 : anton 1.93 drop ['] compile-only-error
335 : pazsan 1.1 else
336 :     (cfa>int)
337 :     then ;
338 :    
339 : pazsan 1.103 has? f83headerstring [IF]
340 :     : name>string ( nt -- addr count ) \ gforth head-to-string
341 :     \g @i{addr count} is the name of the word represented by @i{nt}.
342 :     cell+ count lcount-mask and ;
343 :    
344 :     : ((name>)) ( nfa -- cfa )
345 :     name>string + cfaligned ;
346 :    
347 :     : (name>x) ( nfa -- cfa w )
348 :     \ cfa is an intermediate cfa and w is the flags cell of nfa
349 :     dup ((name>))
350 :     swap cell+ c@ dup alias-mask and 0=
351 :     IF
352 :     swap @ swap
353 :     THEN ;
354 :     [ELSE]
355 : pazsan 1.1 : name>string ( nt -- addr count ) \ gforth head-to-string
356 : crook 1.40 \g @i{addr count} is the name of the word represented by @i{nt}.
357 : anton 1.67 cell+ dup cell+ swap @ lcount-mask and ;
358 : pazsan 1.1
359 :     : ((name>)) ( nfa -- cfa )
360 :     name>string + cfaligned ;
361 :    
362 : anton 1.67 : (name>x) ( nfa -- cfa w )
363 :     \ cfa is an intermediate cfa and w is the flags cell of nfa
364 : pazsan 1.1 dup ((name>))
365 : anton 1.67 swap cell+ @ dup alias-mask and 0=
366 : pazsan 1.1 IF
367 :     swap @ swap
368 :     THEN ;
369 : pazsan 1.103 [THEN]
370 : pazsan 1.1
371 :     : name>int ( nt -- xt ) \ gforth
372 : crook 1.31 \G @i{xt} represents the interpretation semantics of the word
373 :     \G @i{nt}. If @i{nt} has no interpretation semantics (i.e. is
374 :     \G @code{compile-only}), @i{xt} is the execution token for
375 : anton 1.79 \G @code{ticking-compile-only-error}, which performs @code{-2048 throw}.
376 : pazsan 1.1 (name>x) (x>int) ;
377 :    
378 :     : name?int ( nt -- xt ) \ gforth
379 : anton 1.79 \G Like @code{name>int}, but perform @code{-2048 throw} if @i{nt}
380 : crook 1.31 \G has no interpretation semantics.
381 : pazsan 1.1 (name>x) restrict-mask and
382 :     if
383 : anton 1.79 ticking-compile-only-error \ does not return
384 : pazsan 1.1 then
385 :     (cfa>int) ;
386 :    
387 :     : (name>comp) ( nt -- w +-1 ) \ gforth
388 : crook 1.31 \G @i{w xt} is the compilation token for the word @i{nt}.
389 : pazsan 1.1 (name>x) >r
390 :     [ has? compiler [IF] ]
391 :     dup interpret/compile?
392 :     if
393 :     interpret/compile-comp @
394 :     then
395 :     [ [THEN] ]
396 :     r> immediate-mask and flag-sign
397 :     ;
398 :    
399 :     : (name>intn) ( nfa -- xt +-1 )
400 : anton 1.67 (name>x) tuck (x>int) ( w xt )
401 : pazsan 1.1 swap immediate-mask and flag-sign ;
402 :    
403 : pazsan 1.72 const Create ??? 0 , 3 , char ? c, char ? c, char ? c,
404 : jwilke 1.30 \ ??? is used by dovar:, must be created/:dovar
405 :    
406 :     [IFDEF] forthstart
407 :     \ if we have a forthstart we can define head? with it
408 :     \ otherwise leave out the head? check
409 :    
410 : anton 1.14 : head? ( addr -- f )
411 : anton 1.82 \G heuristic check whether addr is a name token; may deliver false
412 :     \G positives; addr must be a valid address; returns 1 for
413 :     \G particularly unsafe positives
414 : anton 1.14 \ we follow the link fields and check for plausibility; two
415 :     \ iterations should catch most false addresses: on the first
416 :     \ iteration, we may get an xt, on the second a code address (or
417 :     \ some code), which is typically not in the dictionary.
418 : anton 1.82 \ we added a third iteration for working with code and ;code words.
419 :     3 0 do
420 : anton 1.41 dup dup aligned <> if \ protect @ against unaligned accesses
421 :     drop false unloop exit
422 :     then
423 : anton 1.14 dup @ dup
424 :     if ( addr addr1 )
425 :     dup rot forthstart within
426 :     if \ addr1 is outside forthstart..addr, not a head
427 :     drop false unloop exit
428 :     then ( addr1 )
429 :     else \ 0 in the link field, no further checks
430 : anton 1.81 2drop 1 unloop exit \ this is very unsure, so return 1
431 : anton 1.14 then
432 :     loop
433 :     \ in dubio pro:
434 :     drop true ;
435 :    
436 : anton 1.48 : >head-noprim ( cfa -- nt ) \ gforth to-head-noprim
437 : anton 1.97 \ also heuristic
438 :     dup forthstart - max-name-length @ float+ cell+ min cell max cell ?do ( cfa )
439 : pazsan 1.70 dup i - dup @ [ alias-mask lcount-mask or ] literal
440 :     [ 1 bits/char 3 - lshift 1 - 1 bits/char 1 - lshift or
441 : pazsan 1.71 -1 cells allot bigendian [IF] c, -1 1 cells 1- times
442 :     [ELSE] -1 1 cells 1- times c, [THEN] ]
443 : pazsan 1.70 and ( cfa len|alias )
444 : anton 1.97 swap + cell+ cfaligned over alias-mask + =
445 : anton 1.14 if ( cfa )
446 :     dup i - cell - dup head?
447 :     if
448 :     nip unloop exit
449 :     then
450 :     drop
451 :     then
452 :     cell +loop
453 :     drop ??? ( wouldn't 0 be better? ) ;
454 : pazsan 1.1
455 : jwilke 1.30 [ELSE]
456 :    
457 : anton 1.48 : >head-noprim ( cfa -- nt ) \ gforth to-head-noprim
458 : pazsan 1.45 $25 cell do ( cfa )
459 : pazsan 1.70 dup i - dup @ [ alias-mask lcount-mask or ] literal
460 :     [ 1 bits/char 3 - lshift 1 - 1 bits/char 1 - lshift or
461 : pazsan 1.71 -1 cells allot bigendian [IF] c, -1 1 cells 1- times
462 :     [ELSE] -1 1 cells 1- times c, [THEN] ]
463 : pazsan 1.70 and ( cfa len|alias )
464 : anton 1.67 swap + cell + cfaligned over alias-mask + =
465 : jwilke 1.30 if ( cfa ) i - cell - unloop exit
466 :     then
467 :     cell +loop
468 :     drop ??? ( wouldn't 0 be better? ) ;
469 :    
470 :     [THEN]
471 : pazsan 1.1
472 : anton 1.83 cell% 2* 0 0 field >body ( xt -- a_addr ) \ core
473 :     \G Get the address of the body of the word represented by @i{xt} (the
474 :     \G address of the word's data field).
475 :     drop drop
476 :    
477 :     cell% -2 * 0 0 field body> ( xt -- a_addr )
478 : anton 1.84 drop drop
479 :    
480 :     has? standardthreading has? compiler and [IF]
481 :    
482 :     ' @ alias >code-address ( xt -- c_addr ) \ gforth
483 :     \G @i{c-addr} is the code address of the word @i{xt}.
484 :    
485 :     : >does-code ( xt -- a_addr ) \ gforth
486 :     \G If @i{xt} is the execution token of a child of a @code{DOES>} word,
487 :     \G @i{a-addr} is the start of the Forth code after the @code{DOES>};
488 :     \G Otherwise @i{a-addr} is 0.
489 :     dup @ dodoes: = if
490 :     cell+ @
491 :     else
492 :     drop 0
493 :     endif ;
494 :    
495 : anton 1.85 ' ! alias code-address! ( c_addr xt -- ) \ gforth
496 :     \G Create a code field with code address @i{c-addr} at @i{xt}.
497 :    
498 :     : does-code! ( a_addr xt -- ) \ gforth
499 :     \G Create a code field at @i{xt} for a child of a @code{DOES>}-word;
500 :     \G @i{a-addr} is the start of the Forth code after @code{DOES>}.
501 :     dodoes: over ! cell+ ! ;
502 :    
503 : anton 1.86 ' drop alias does-handler! ( a_addr -- ) \ gforth
504 :     \G Create a @code{DOES>}-handler at address @i{a-addr}. Normally,
505 :     \G @i{a-addr} points just behind a @code{DOES>}.
506 :    
507 : anton 1.85 2 cells constant /does-handler ( -- n ) \ gforth
508 :     \G The size of a @code{DOES>}-handler (includes possible padding).
509 :    
510 : anton 1.84 [THEN]
511 : pazsan 1.1
512 : crook 1.31 : (search-wordlist) ( addr count wid -- nt | false )
513 : pazsan 1.1 dup wordlist-map @ find-method perform ;
514 :    
515 : crook 1.31 : search-wordlist ( c-addr count wid -- 0 | xt +-1 ) \ search
516 : anton 1.53 \G Search the word list identified by @i{wid} for the definition
517 :     \G named by the string at @i{c-addr count}. If the definition is
518 :     \G not found, return 0. If the definition is found return 1 (if
519 :     \G the definition is immediate) or -1 (if the definition is not
520 :     \G immediate) together with the @i{xt}. In Gforth, the @i{xt}
521 :     \G returned represents the interpretation semantics. ANS Forth
522 :     \G does not specify clearly what @i{xt} represents.
523 : pazsan 1.1 (search-wordlist) dup if
524 :     (name>intn)
525 :     then ;
526 :    
527 : crook 1.31 : find-name ( c-addr u -- nt | 0 ) \ gforth
528 :     \g Find the name @i{c-addr u} in the current search
529 :     \g order. Return its @i{nt}, if found, otherwise 0.
530 : pazsan 1.1 lookup @ (search-wordlist) ;
531 :    
532 :     : sfind ( c-addr u -- 0 / xt +-1 ) \ gforth-obsolete
533 :     find-name dup
534 :     if ( nt )
535 :     state @
536 :     if
537 :     (name>comp)
538 :     else
539 :     (name>intn)
540 :     then
541 :     then ;
542 :    
543 : crook 1.31 : find ( c-addr -- xt +-1 | c-addr 0 ) \ core,search
544 : anton 1.53 \G Search all word lists in the current search order for the
545 :     \G definition named by the counted string at @i{c-addr}. If the
546 :     \G definition is not found, return 0. If the definition is found
547 :     \G return 1 (if the definition has non-default compilation
548 :     \G semantics) or -1 (if the definition has default compilation
549 :     \G semantics). The @i{xt} returned in interpret state represents
550 :     \G the interpretation semantics. The @i{xt} returned in compile
551 :     \G state represented either the compilation semantics (for
552 :     \G non-default compilation semantics) or the run-time semantics
553 :     \G that the compilation semantics would @code{compile,} (for
554 :     \G default compilation semantics). The ANS Forth standard does
555 :     \G not specify clearly what the returned @i{xt} represents (and
556 :     \G also talks about immediacy instead of non-default compilation
557 :     \G semantics), so this word is questionable in portable programs.
558 :     \G If non-portability is ok, @code{find-name} and friends are
559 :     \G better (@pxref{Name token}).
560 : pazsan 1.1 dup count sfind dup
561 :     if
562 :     rot drop
563 :     then ;
564 :    
565 : jwilke 1.34 \ ticks in interpreter
566 : pazsan 1.1
567 :     : (') ( "name" -- nt ) \ gforth
568 : anton 1.32 name name-too-short?
569 : anton 1.28 find-name dup 0=
570 : pazsan 1.1 IF
571 : anton 1.42 drop -&13 throw
572 : pazsan 1.1 THEN ;
573 :    
574 :     : ' ( "name" -- xt ) \ core tick
575 : crook 1.31 \g @i{xt} represents @i{name}'s interpretation
576 :     \g semantics. Perform @code{-14 throw} if the word has no
577 : pazsan 1.1 \g interpretation semantics.
578 :     (') name?int ;
579 : jwilke 1.34
580 :     has? compiler 0= [IF] \ interpreter only version of IS and TO
581 :    
582 :     : IS ' >body ! ;
583 :     ' IS Alias TO
584 :    
585 :     [THEN]
586 : pazsan 1.1
587 :     \ \ the interpreter loop mar92py
588 :    
589 :     \ interpret 10mar92py
590 :    
591 : anton 1.37 Defer parser ( c-addr u -- )
592 : anton 1.100 Defer parse-word ( "name" -- c-addr u ) \ gforth
593 : anton 1.55 \G Get the next word from the input buffer
594 : anton 1.77 ' (name) IS parse-word
595 :    
596 :     ' parse-word alias name ( -- c-addr u ) \ gforth-obsolete
597 :     \G old name for @code{parse-word}
598 :    
599 : pazsan 1.1 Defer compiler-notfound ( c-addr count -- )
600 :     Defer interpreter-notfound ( c-addr count -- )
601 :    
602 :     : no.extensions ( addr u -- )
603 : anton 1.42 2drop -&13 throw ;
604 : pazsan 1.1 ' no.extensions IS compiler-notfound
605 :     ' no.extensions IS interpreter-notfound
606 :    
607 : anton 1.106 Defer before-word ( -- ) \ gforth
608 :     \ called before the text interpreter parses the next word
609 :     ' noop IS before-word
610 :    
611 : anton 1.66 : interpret1 ( ... -- ... )
612 : jwilke 1.33 [ has? backtrace [IF] ]
613 : anton 1.24 rp@ backtrace-rp0 !
614 : jwilke 1.33 [ [THEN] ]
615 : pazsan 1.1 BEGIN
616 : anton 1.106 ?stack before-word name dup
617 : pazsan 1.1 WHILE
618 :     parser
619 :     REPEAT
620 : anton 1.66 2drop ;
621 :    
622 :     : interpret ( ?? -- ?? ) \ gforth
623 :     \ interpret/compile the (rest of the) input buffer
624 :     [ has? backtrace [IF] ]
625 :     backtrace-rp0 @ >r
626 :     [ [THEN] ]
627 :     ['] interpret1 catch
628 : anton 1.65 [ has? backtrace [IF] ]
629 :     r> backtrace-rp0 !
630 : anton 1.66 [ [THEN] ]
631 :     throw ;
632 : pazsan 1.1
633 :     \ interpreter 30apr92py
634 :    
635 :     \ not the most efficient implementations of interpreter and compiler
636 : jwilke 1.33 : interpreter ( c-addr u -- )
637 : pazsan 1.1 2dup find-name dup
638 :     if
639 :     nip nip name>int execute
640 :     else
641 :     drop
642 :     2dup 2>r snumber?
643 :     IF
644 :     2rdrop
645 :     ELSE
646 :     2r> interpreter-notfound
647 :     THEN
648 :     then ;
649 :    
650 :     ' interpreter IS parser
651 :    
652 :     \ \ Query Evaluate 07apr93py
653 :    
654 :     has? file 0= [IF]
655 : pazsan 1.12 : sourceline# ( -- n ) 1 ;
656 : pazsan 1.61 [ELSE]
657 : pazsan 1.64 has? new-input 0= [IF]
658 : pazsan 1.58 Variable #fill-bytes
659 :     \G number of bytes read via (read-line) by the last refill
660 : pazsan 1.61 [THEN]
661 : pazsan 1.64 [THEN]
662 : pazsan 1.58
663 : pazsan 1.64 has? new-input 0= [IF]
664 : pazsan 1.1 : refill ( -- flag ) \ core-ext,block-ext,file-ext
665 : crook 1.29 \G Attempt to fill the input buffer from the input source. When
666 :     \G the input source is the user input device, attempt to receive
667 :     \G input into the terminal input device. If successful, make the
668 :     \G result the input buffer, set @code{>IN} to 0 and return true;
669 :     \G otherwise return false. When the input source is a block, add 1
670 :     \G to the value of @code{BLK} to make the next block the input
671 :     \G source and current input buffer, and set @code{>IN} to 0;
672 :     \G return true if the new value of @code{BLK} is a valid block
673 :     \G number, false otherwise. When the input source is a text file,
674 :     \G attempt to read the next line from the file. If successful,
675 :     \G make the result the current input buffer, set @code{>IN} to 0
676 :     \G and return true; otherwise, return false. A successful result
677 :     \G includes receipt of a line containing 0 characters.
678 : pazsan 1.12 [ has? file [IF] ]
679 :     blk @ IF 1 blk +! true 0 >in ! EXIT THEN
680 :     [ [THEN] ]
681 :     tib /line
682 :     [ has? file [IF] ]
683 :     loadfile @ ?dup
684 : pazsan 1.59 IF (read-line) throw #fill-bytes !
685 : pazsan 1.12 ELSE
686 :     [ [THEN] ]
687 :     sourceline# 0< IF 2drop false EXIT THEN
688 :     accept true
689 :     [ has? file [IF] ]
690 :     THEN
691 :     1 loadline +!
692 :     [ [THEN] ]
693 :     swap #tib ! 0 >in ! ;
694 : pazsan 1.1
695 :     : query ( -- ) \ core-ext
696 : crook 1.29 \G Make the user input device the input source. Receive input into
697 :     \G the Terminal Input Buffer. Set @code{>IN} to zero. OBSOLESCENT:
698 :     \G superceeded by @code{accept}.
699 : pazsan 1.12 [ has? file [IF] ]
700 :     blk off loadfile off
701 :     [ [THEN] ]
702 : pazsan 1.64 refill drop ;
703 :     [THEN]
704 : pazsan 1.1
705 :     \ save-mem extend-mem
706 :    
707 :     has? os [IF]
708 :     : save-mem ( addr1 u -- addr2 u ) \ gforth
709 :     \g copy a memory block into a newly allocated region in the heap
710 :     swap >r
711 :     dup allocate throw
712 :     swap 2dup r> -rot move ;
713 :    
714 : anton 1.68 : free-mem-var ( addr -- )
715 :     \ addr is the address of a 2variable containing address and size
716 :     \ of a memory range; frees memory and clears the 2variable.
717 :     dup 2@ drop dup
718 :     if ( addr mem-start )
719 :     free throw
720 :     0 0 rot 2!
721 :     else
722 :     2drop
723 :     then ;
724 :    
725 : pazsan 1.1 : extend-mem ( addr1 u1 u -- addr addr2 u2 )
726 :     \ extend memory block allocated from the heap by u aus
727 : anton 1.105 \ the (possibly reallocated) piece is addr2 u2, the extension is at addr
728 : pazsan 1.1 over >r + dup >r resize throw
729 :     r> over r> + -rot ;
730 :     [THEN]
731 :    
732 :     \ EVALUATE 17may93jaw
733 :    
734 : pazsan 1.64 has? file 0= has? new-input 0= and [IF]
735 : pazsan 1.1 : push-file ( -- ) r>
736 : pazsan 1.12 tibstack @ >r >tib @ >r #tib @ >r
737 : pazsan 1.1 >tib @ tibstack @ = IF r@ tibstack +! THEN
738 :     tibstack @ >tib ! >in @ >r >r ;
739 :    
740 :     : pop-file ( throw-code -- throw-code )
741 :     r>
742 : pazsan 1.12 r> >in ! r> #tib ! r> >tib ! r> tibstack ! >r ;
743 : pazsan 1.1 [THEN]
744 :    
745 : pazsan 1.64 has? new-input 0= [IF]
746 : crook 1.29 : evaluate ( c-addr u -- ) \ core,block
747 : crook 1.40 \G Save the current input source specification. Store @code{-1} in
748 :     \G @code{source-id} and @code{0} in @code{blk}. Set @code{>IN} to
749 :     \G @code{0} and make the string @i{c-addr u} the input source
750 :     \G and input buffer. Interpret. When the parse area is empty,
751 :     \G restore the input source specification.
752 : pazsan 1.64 [ has? file [IF] ]
753 : anton 1.92 s" *evaluated string*" loadfilename>r
754 : pazsan 1.64 [ [THEN] ]
755 : crook 1.40 push-file #tib ! >tib !
756 : crook 1.29 >in off
757 :     [ has? file [IF] ]
758 :     blk off loadfile off -1 loadline !
759 :     [ [THEN] ]
760 :     ['] interpret catch
761 : anton 1.56 pop-file
762 : pazsan 1.64 [ has? file [IF] ]
763 : anton 1.92 r>loadfilename
764 : pazsan 1.64 [ [THEN] ]
765 : anton 1.56 throw ;
766 : pazsan 1.64 [THEN]
767 : pazsan 1.1
768 :     \ \ Quit 13feb93py
769 :    
770 :     Defer 'quit
771 :    
772 :     Defer .status
773 :    
774 :     : prompt state @ IF ." compiled" EXIT THEN ." ok" ;
775 :    
776 : anton 1.39 : (quit) ( -- )
777 :     \ exits only through THROW etc.
778 :     BEGIN
779 : anton 1.98 .status
780 :     ['] cr catch if
781 : anton 1.99 >stderr cr ." Can't print to stdout, leaving" cr
782 : anton 1.98 \ if stderr does not work either, already DoError causes a hang
783 :     2 (bye)
784 :     endif
785 :     query interpret prompt
786 : anton 1.39 AGAIN ;
787 : pazsan 1.1
788 :     ' (quit) IS 'quit
789 :    
790 :     \ \ DOERROR (DOERROR) 13jun93jaw
791 :    
792 :     8 Constant max-errors
793 :     Variable error-stack 0 error-stack !
794 : pazsan 1.64 max-errors has? file [IF] 6 [ELSE] 4 [THEN] * cells allot
795 : pazsan 1.1 \ format of one cell:
796 :     \ source ( addr u )
797 :     \ >in
798 :     \ line-number
799 :     \ Loadfilename ( addr u )
800 :    
801 : pazsan 1.64 : error> ( -- addr u >in line# [addr u] )
802 :     -1 error-stack +!
803 :     error-stack dup @
804 :     [ has? file [IF] 6 [ELSE] 4 [THEN] ] Literal * cells + cell+
805 :     [ has? file [IF] 6 [ELSE] 4 [THEN] ] Literal cells bounds DO
806 :     I @
807 :     cell +LOOP ;
808 :     : >error ( addr u >in line# [addr u] -- )
809 :     error-stack dup @ dup 1+
810 :     max-errors 1- min error-stack !
811 :     [ has? file [IF] 6 [ELSE] 4 [THEN] ] Literal * cells + cell+
812 :     [ has? file [IF] 6 [ELSE] 4 [THEN] 1- ] Literal cells bounds swap DO
813 :     I !
814 :     -1 cells +LOOP ;
815 :    
816 : pazsan 1.1 : dec. ( n -- ) \ gforth
817 : crook 1.40 \G Display @i{n} as a signed decimal number, followed by a space.
818 :     \ !! not used...
819 : pazsan 1.1 base @ decimal swap . base ! ;
820 :    
821 : anton 1.111 : dec.r ( u n -- ) \ gforth
822 :     \G Display @i{u} as a unsigned decimal number in a field @i{n}
823 :     \G characters wide.
824 :     base @ >r decimal .r r> base ! ;
825 : jwilke 1.23
826 : pazsan 1.1 : hex. ( u -- ) \ gforth
827 : crook 1.40 \G Display @i{u} as an unsigned hex number, prefixed with a "$" and
828 : crook 1.17 \G followed by a space.
829 : crook 1.40 \ !! not used...
830 : jwilke 1.33 [char] $ emit base @ swap hex u. base ! ;
831 : pazsan 1.1
832 : anton 1.95 : typewhite ( addr n -- ) \ gforth
833 :     \G Like type, but white space is printed instead of the characters.
834 :     \ bounds u+do
835 :     0 max bounds ?do
836 : pazsan 1.1 i c@ #tab = if \ check for tab
837 :     #tab
838 :     else
839 :     bl
840 :     then
841 :     emit
842 :     loop ;
843 :    
844 : anton 1.94 : -trailing ( c_addr u1 -- c_addr u2 ) \ string dash-trailing
845 :     \G Adjust the string specified by @i{c-addr, u1} to remove all
846 :     \G trailing spaces. @i{u2} is the length of the modified string.
847 :     BEGIN
848 : pazsan 1.102 dup
849 : anton 1.94 WHILE
850 : pazsan 1.102 1- 2dup + c@ bl <>
851 :     UNTIL 1+ THEN ;
852 : anton 1.94
853 : pazsan 1.1 DEFER DOERROR
854 : jwilke 1.33
855 :     has? backtrace [IF]
856 : anton 1.15 Defer dobacktrace ( -- )
857 :     ' noop IS dobacktrace
858 : jwilke 1.33 [THEN]
859 : pazsan 1.1
860 : jwilke 1.23 : .error-string ( throw-code -- )
861 :     dup -2 =
862 :     IF "error @ ?dup IF count type THEN drop
863 :     ELSE .error
864 :     THEN ;
865 :    
866 : anton 1.111 : umin ( u1 u2 -- u )
867 :     2dup u>
868 :     if
869 :     swap
870 :     then
871 :     drop ;
872 :    
873 :     : .error-line ( addr1 u1 n1 -- )
874 :     \ print error ending at char n1 in line addr1 u1
875 :     \ should work with UTF-8 (whitespace check looks ok)
876 :     over umin \ protect against wrong n1
877 :     swap >r ( addr1 n1 R: u1 )
878 :     -trailing 1- \ last non-space
879 :     0 >r BEGIN \ search for the first non-space
880 :     2dup + c@ bl > WHILE
881 :     r> 1+ >r 1- dup 0< UNTIL THEN 1+
882 :     ( addr1 n2 r: u1 namelen )
883 :     2dup type ." >>>"
884 :     r> -rot r> swap /string ( namelen addr2 u2 )
885 :     >r swap 2dup type ." <<<" ( addr2 namelen r: u2 )
886 :     r> swap /string type ;
887 :    
888 : pazsan 1.64 : .error-frame ( throwcode addr1 u1 n1 n2 [addr2 u2] -- throwcode )
889 :     \ addr2 u2: filename of included file - optional
890 : jwilke 1.23 \ n2: line number
891 :     \ n1: error position in input line
892 :     \ addr1 u1: input line
893 : pazsan 1.1 cr error-stack @
894 : anton 1.111 IF ( throwcode addr1 u1 n1 n2 [addr2 u2] )
895 :     [ has? file [IF] ] \ !! unbalanced stack effect
896 : pazsan 1.64 ." in file included from "
897 :     type ." :"
898 : anton 1.111 [ [THEN] ] ( throwcode addr1 u1 n1 n2 )
899 :     0 dec.r drop 2drop
900 :     ELSE ( throwcode addr1 u1 n1 n2 [addr2 u2] )
901 : pazsan 1.64 [ has? file [IF] ]
902 :     type ." :"
903 : anton 1.111 [ [THEN] ] ( throwcode addr1 u1 n1 n2 )
904 :     dup 0 dec.r ." : " 4 pick .error-string
905 :     IF \ if line# non-zero, there is a line
906 :     cr .error-line
907 : anton 1.57 ELSE
908 :     2drop drop
909 :     THEN
910 : jwilke 1.23 THEN ;
911 : pazsan 1.1
912 :     : (DoError) ( throw-code -- )
913 :     [ has? os [IF] ]
914 : pazsan 1.8 >stderr
915 : pazsan 1.1 [ [THEN] ]
916 : anton 1.111 source >in @ sourceline# [ has? file [IF] ] \ !! unbalanced stack effect
917 : pazsan 1.64 sourcefilename
918 :     [ [THEN] ] .error-frame
919 : pazsan 1.1 error-stack @ 0 ?DO
920 : pazsan 1.64 error>
921 : pazsan 1.1 .error-frame
922 :     LOOP
923 : jwilke 1.33 drop
924 :     [ has? backtrace [IF] ]
925 :     dobacktrace
926 :     [ [THEN] ]
927 : pazsan 1.8 normal-dp dpp ! ;
928 : pazsan 1.1
929 :     ' (DoError) IS DoError
930 :    
931 :     : quit ( ?? -- ?? ) \ core
932 : crook 1.27 \G Empty the return stack, make the user input device
933 :     \G the input source, enter interpret state and start
934 :     \G the text interpreter.
935 : pazsan 1.64 rp0 @ rp! handler off clear-tibstack
936 :     [ has? new-input 0= [IF] ] >tib @ >r [ [THEN] ]
937 : pazsan 1.1 BEGIN
938 :     [ has? compiler [IF] ]
939 : anton 1.104 [compile] [
940 : pazsan 1.1 [ [THEN] ]
941 : anton 1.104 \ stack depths may be arbitrary here
942 : pazsan 1.1 ['] 'quit CATCH dup
943 :     WHILE
944 : anton 1.104 <# \ reset hold area, or we may get another error
945 :     DoError
946 :     \ stack depths may be arbitrary still (or again), so clear them
947 :     clearstacks
948 :     [ has? new-input [IF] ] clear-tibstack
949 :     [ [ELSE] ] r@ >tib ! r@ tibstack !
950 :     [ [THEN] ]
951 : pazsan 1.1 REPEAT
952 : pazsan 1.64 drop [ has? new-input [IF] ] clear-tibstack
953 :     [ [ELSE] ] r> >tib !
954 :     [ [THEN] ] ;
955 : pazsan 1.1
956 :     \ \ Cold Boot 13feb93py
957 :    
958 :     : (bootmessage)
959 : anton 1.101 ." Gforth " version-string type
960 : pazsan 1.88 ." , Copyright (C) 1995-2003 Free Software Foundation, Inc." cr
961 : anton 1.101 ." Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'"
962 : pazsan 1.1 [ has? os [IF] ]
963 :     cr ." Type `bye' to exit"
964 :     [ [THEN] ] ;
965 :    
966 :     defer bootmessage
967 :     defer process-args
968 :    
969 :     ' (bootmessage) IS bootmessage
970 :    
971 : anton 1.10 Defer 'cold ( -- ) \ gforth tick-cold
972 : pazsan 1.1 \ hook (deferred word) for things to do right before interpreting the
973 :     \ command-line arguments
974 :     ' noop IS 'cold
975 :    
976 :    
977 : jwilke 1.76 AVariable init8 NIL init8 !
978 : pazsan 1.1
979 :     : cold ( -- ) \ gforth
980 : anton 1.44 [ has? backtrace [IF] ]
981 :     rp@ backtrace-rp0 !
982 :     [ [THEN] ]
983 : pazsan 1.1 [ has? file [IF] ]
984 : pazsan 1.78 os-cold
985 : pazsan 1.1 [ [THEN] ]
986 :     'cold
987 :     init8 chainperform
988 :     [ has? file [IF] ]
989 : anton 1.91 s" *the terminal*" loadfilename 2!
990 : pazsan 1.8 process-args
991 : pazsan 1.12 loadline off
992 : pazsan 1.1 [ [THEN] ]
993 :     bootmessage
994 : pazsan 1.12 quit ;
995 : pazsan 1.1
996 : pazsan 1.64 has? new-input 0= [IF]
997 : anton 1.5 : clear-tibstack ( -- )
998 :     [ has? glocals [IF] ]
999 :     lp@ forthstart 7 cells + @ -
1000 :     [ [ELSE] ]
1001 :     [ has? os [IF] ]
1002 : pazsan 1.8 r0 @ forthstart 6 cells + @ -
1003 : anton 1.5 [ [ELSE] ]
1004 : pazsan 1.16 sp@ $10 cells +
1005 : anton 1.5 [ [THEN] ]
1006 :     [ [THEN] ]
1007 :     dup >tib ! tibstack ! #tib off >in off ;
1008 : pazsan 1.64 [THEN]
1009 : anton 1.5
1010 : pazsan 1.64 : boot ( path n **argv argc -- )
1011 : pazsan 1.1 main-task up!
1012 :     [ has? os [IF] ]
1013 : pazsan 1.78 os-boot
1014 : pazsan 1.1 [ [THEN] ]
1015 :     sp@ sp0 !
1016 : pazsan 1.74 [ has? peephole [IF] ]
1017 : anton 1.87 \ only needed for greedy static superinstruction selection
1018 :     \ primtable prepare-peephole-table TO peeptable
1019 : pazsan 1.74 [ [THEN] ]
1020 : pazsan 1.64 [ has? new-input [IF] ]
1021 :     current-input off
1022 :     [ [THEN] ]
1023 : anton 1.5 clear-tibstack
1024 : pazsan 1.1 rp@ rp0 !
1025 :     [ has? floating [IF] ]
1026 :     fp@ fp0 !
1027 :     [ [THEN] ]
1028 : anton 1.46 handler off
1029 : anton 1.98 ['] cold catch dup -&2049 <> if \ broken pipe?
1030 :     DoError cr
1031 :     endif
1032 : pazsan 1.1 [ has? os [IF] ]
1033 : anton 1.35 1 (bye) \ !! determin exit code from throw code?
1034 : pazsan 1.1 [ [THEN] ]
1035 :     ;
1036 :    
1037 :     has? os [IF]
1038 :     : bye ( -- ) \ tools-ext
1039 :     [ has? file [IF] ]
1040 :     script? 0= IF cr THEN
1041 :     [ [ELSE] ]
1042 :     cr
1043 :     [ [THEN] ]
1044 :     0 (bye) ;
1045 :     [THEN]
1046 :    
1047 :     \ **argv may be scanned by the C starter to get some important
1048 :     \ information, as -display and -geometry for an X client FORTH
1049 :     \ or space and stackspace overrides
1050 :    
1051 :     \ 0 arg contains, however, the name of the program.
1052 :    

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help