Commit a5fb7ce1 authored by pazsan's avatar pazsan

Added makedoc facility to cross compiler.

Now most doc-* reverences are resolved.
parent edbee227
......@@ -61,7 +61,7 @@ FORTH_SRC = anslocal.fs add.fs assert.fs ansi.fs blocks.fs bufio.fs checkans.fs
SOURCES = Makefile.in configure.in configure config.sub config.guess \
install-sh INSTALL README ToDo BUGS model COPYING \
gforth.ds texinfo.tex gforth.1 \
gforth.ds texinfo.tex gforth.1 gforth.el \
primitives engine.c main.c io.c \
m68k.h mips.h 386.h hppa.h cache.c sparc.h power.h alpha.h 32bit.h \
getopt.c getopt1.c getopt.h select.c \
......@@ -252,13 +252,13 @@ version.c: Makefile.in
echo "char gforth_version[]=\"$(VERSION)\" ;" >$@
doc.fs: makedoc.fs float.fs search-order.fs glocals.fs environ.fs \
doc.fd: makedoc.fs float.fs search-order.fs glocals.fs environ.fs \
toolsext.fs wordinfo.fs \
vt100.fs colorize.fs see.fs bufio.fs debug.fs history.fs \
doskey.fs vt100key.fs startup.fs assert.fs debugging.fs
$(FORTH) -e "s\" doc.fs\"" makedoc.fs startup.fs -e bye
$(FORTH) -e "s\" doc.fd\"" makedoc.fs startup.fs -e bye
gforth.texi: gforth.ds primitives.b ds2texi.fs prims2x.fs doc.fs
gforth.texi: gforth.ds primitives.b ds2texi.fs prims2x.fs doc.fd crossdoc.fd
$(FORTH) ds2texi.fs >$@
gforth.dvi: gforth.texi
......
\ CROSS.FS The Cross-Compiler 06oct92py
\ $Id: cross.fs,v 1.24 1995-02-23 20:17:16 pazsan Exp $
\ $Id: cross.fs,v 1.25 1995-07-06 15:57:25 pazsan Exp $
\ Idea and implementation: Bernd Paysan (py)
\ Copyright 1992-94 by the GNU Forth Development Group
......@@ -361,6 +361,32 @@ VARIABLE ^imm
: name, ( "name" -- ) bl word count string, T cfalign H ;
: view, ( -- ) ( dummy ) ;
\ Target Document Creation (goes to crossdoc.fd) 05jul95py
s" crossdoc.fd" r/w create-file throw value doc-file-id
\ contains the file-id of the documentation file
: \G ( -- )
source >in @ /string doc-file-id write-line throw
source >in ! drop ; immediate
Variable to-doc
: cross-doc-entry ( -- )
to-doc @ tlast @ 0<> and \ not an anonymous (i.e. noname) header
IF
s" " doc-file-id write-line throw
s" make-doc " doc-file-id write-file throw
tlast @ >image count $1F and doc-file-id write-file throw
>in @
[char] ( parse 2drop
[char] ) parse doc-file-id write-file throw
s" )" doc-file-id write-file throw
[char] \ parse 2drop
POSTPONE \g
>in !
THEN to-doc on ;
VARIABLE CreateFlag CreateFlag off
: (Theader ( "name" -- ghost ) T align H view,
......@@ -375,7 +401,8 @@ VARIABLE CreateFlag CreateFlag off
dup >magic ^imm ! \ a pointer for immediate
Already @ IF dup >end tdoes !
ELSE 0 tdoes ! THEN
80 flag! ;
80 flag!
cross-doc-entry ;
VARIABLE ;Resolve 1 cells allot
......@@ -384,6 +411,7 @@ VARIABLE ;Resolve 1 cells allot
>TARGET
: Alias ( cfa -- ) \ name
dup 0< IF to-doc off THEN
(THeader over resolve T A, H 80 flag! ;
>CROSS
......@@ -816,8 +844,9 @@ cell constant cell
\ include bug5.fs
\ only forth also minimal definitions
: \ postpone \ ;
: ( postpone ( ;
: \ postpone \ ;
: \G postpone \G ;
: ( postpone ( ;
: include bl word count included ;
: .( [char] ) parse type ;
: cr cr ;
......
......@@ -134,6 +134,7 @@ create docline doclinelength chars allot
script? [IF]
include prims2x.fs
s" primitives.b" ' register-doc process-file
require doc.fs
require doc.fd
require crossdoc.fd
s" gforth.ds" r/o open-file throw ds2texi bye
[THEN]
......@@ -70,8 +70,8 @@ decimal
\ ERASE 17may93jaw
: erase ( 0 1 chars um/mod nip ) 0 fill ;
: blank ( 0 1 chars um/mod nip ) bl fill ;
: erase ( addr len -- ) ( 0 1 chars um/mod nip ) 0 fill ;
: blank ( addr len -- ) ( 0 1 chars um/mod nip ) bl fill ;
\ SEARCH 02sep94py
......@@ -85,8 +85,9 @@ decimal
\ ROLL 17may93jaw
: roll dup 1+ pick >r
cells sp@ cell+ dup cell+ rot move drop r> ;
: roll ( x0 x1 .. xn n -- x1 .. xn x0 )
dup 1+ pick >r
cells sp@ cell+ dup cell+ rot move drop r> ;
\ SOURCE-ID SAVE-INPUT RESTORE-INPUT 11jun93jaw
......
......@@ -45,7 +45,7 @@ s" \ automatically generated by makedoc.fs" doc-file-id write-line throw
locals-list @ 0= \ not in a colon def, i.e., not a local name
last @ 0<> and \ not an anonymous (i.e. noname) header
if
0 0 doc-file-id write-line throw
s" " doc-file-id write-line throw
s" make-doc " doc-file-id write-file throw
last @ name>string doc-file-id write-file throw
>in @
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment