Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ucsd!usc!samsung!uunet!zephyr.ens.tek.com!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.lang.forth Subject: Re: Multi-line custom compilers Message-ID: <8033@tekgvs.LABS.TEK.COM> Date: 31 Aug 90 14:16:41 GMT References: <9008310127.AA29178@ucbvax.Berkeley.EDU> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 29 In article <9008310127.AA29178@ucbvax.Berkeley.EDU> wmb%MITCH.ENG.SUN.COM@SCFVM.GSFC.NASA.GOV writes: >> The point is that the solutions offered [to the problem that Dr. Wavrik >> posed about building your own compiling words] are only valid if the >> source code is on one line, such as the specific formulation proposed >> as the problem. > >One of my A-1, non-negotiable, burning-issue-class goals with the file >input stream stuff was the ability to write a version of WORD (call it >GETWORD for the sake of discussion) that will read past line boundaries. I needed this for my Forth compilers, to handle conditional compilation, among other things. Quite simple, you end up with something on the order of-- : GETWORD ( delim -- string ) BEGIN DUP WORD ( parse next word ) DUP C@ 0= WHILE ( while at end of line ) DROP ( toss the null word parsed ) QUERY ( read the next line ) REPEAT SWAP DROP ( toss the delimiter ) ; Thats as close as I can get to a generic 83 Standard solution. Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply