Anton,


I got the other half of Gray. A slight problem with the mail software.

Below is a final report of my changes. Mini.f83 needed a lot of work.
It also uncovered a bug in i/tForth, and showed me an interesting
problem when writing for an optimizing Forth. (I repeat some of the
material I already sent you.)
-----------------------------
: {{   ( -- syntax-expr )
 action-map make-syntax-expr
 new-context
 empty first-set !
 true maybe-empty c!
 this old-context
 ?exec !csp
 align here cell allot
 ^^^^^ This is one of four or five places it mattered.
 :noname swap ! ;
         ^^^^^^
Do not assume the address on the stack is an xt, it is (could
be) a "colon-sys". Switch-off compilation state first, by using
a word that consumes a colon-sys ( ; or DOES> ).

: parser \ syntax-expr -- )
\ use: syntax-expr parser xxx )
 context-stack clear
 empty over propagate
 dup pass2
 >r [compile] : r> generate [compile] ; ;
    ^^^^^^^^^^^

What a wonderful little feature!  As : is not immediate,
[compile] : is equivalent to : . When I blindly changed it to
postpone : it didn't work :-)

: ?readnext ( f -- )
 ?syntax-error
 expected clear
 0 begin
  drop key
       ^^^ key does not echo. I have used REFILL , so now it
           works from within files (blocks, strings) too.
  dup BL <> until
 sym ! ;

Your use of vocabularies in mini.f83 caused some hard work.
There was a bug in my GET-ORDER and SET-ORDER words that I had to
fix first (thanks ..)

Then you defined WHILE THEN IF etcetera as symbols, as far as I can
see with Forth as the CURRENT vocabulary. This is not so nice, because
at code generation time _your_ WHILE is used for the loops, not the
system's. This caused some segmentation faults. I renamed WHILE etcetera
to "WHILE" "PROGRAM" and so forth, like you had done for "Read" and "Write"
already. Maybe you have a better idea?

The most interesting problem was caused by key/ident:

\ checks string at addr for keyword and returns token value
\ ANS Forth: words may 'execute' differently depending on state.
\ We need the normal execution behavior here.
: key/ident ( c-addr u -- n )
  state @ dup >r if  postpone [  endif
  keywords search-wordlist if
  execute
 else
  Ident
 endif
 r> ( state) if ] endif ;

The [ ] fixed it.

And then it worked, although mini seems to take one extra item of the data
stack when it it stops. If have to say  "0 5 test" for a correct result.

Oberon
------
This is the output when doing Oberon. I see some of the conflicts you
mentioned, but also others? (I can't find a way to get at the file name and
line number, so this error output will have to do.)
Oberon needs about 296 cells of return stack with both iForth and tForth.

=====
FORTH> in oberon
(( MODULE ident ";" ImportList ?? DeclarationSequence
                                  ^
::: conflict:4

(( (( CONST (( ConstantDeclaration ";" )) ** )) ??
                                             ^
::: conflict:4

(( (( ident "." )) ?? ident )) <- qualident
                      ^
::: conflict:4

(( qualident (( "." ident || "[" ExpList "]" || "(" qualident ")" || "^" )) **
                                                                              ^
::: conflict:15

   designator ActualParameters ?? || "(" expression ")" || "~" factor ))
                                  ^
::: conflict:15

(( (( "+" || "-" )) ?? term AddOperator && )) <- SimpleExpression
                                           ^
::: conflict:5 6

   (( TYPE (( TypeDeclaration ";" )) ** )) ??
                                             ^
::: conflict:57

   (( ProcedureDeclaration ";" || ForwardDeclaration ";" )) **
                                                            ^
::: conflict:57

)) ?? statement rule
      ^
::: conflict:0 1 2 3 4 5 6 9 15 29 47

)) ?? statement rule
   ^
::: conflict:4

)) ?? statement rule
   ^
::: conflict:4

(( designator ActualParameters ?? )) <- ProcedureCall
                                  ^
::: conflict:15

(( CaseLabelList ":" StatementSequence )) ?? <- case
                                             ^
::: conflict:0 1 2 3 4 5 6 9 15 29 47

   LoopStatement || WithStatement || EXIT || RETURN expression ??
                                                                 ^
::: conflict:0 1 2 3 4 5 6 9 15 29 47

(( DEFINITION ident ";" ImportList ?? DefSequence END ident "." )) <- definition
                                      ^
::: conflict:4

(( (( CONST (( ConstantDeclaration ";" )) ** )) ??
                                             ^
::: conflict:4

   (( TYPE (( TypeDeclaration ";" )) ** )) ??
                                             ^
::: conflict:57  ok
====

Marcel.