| |
|
| \ recursive descent parser generator ) |
\ recursive descent parser generator ) |
| |
|
| |
warnings @ [IF] |
| .( Loading Gray ... Copyright 1990 Martin Anton Ertl; NO WARRANTY ) cr |
.( Loading Gray ... Copyright 1990 Martin Anton Ertl; NO WARRANTY ) cr |
| |
[THEN] |
| |
|
| \ misc ) |
\ misc ) |
| : noop ; |
: noop ; |
| |
|
| : check-conflict \ set1 set2 -- ) |
: check-conflict \ set1 set2 -- ) |
| \ print the intersection of set1 and set2 if it isn't empty ) |
\ print the intersection of set1 and set2 if it isn't empty ) |
| 2dup disjoint? ?not? if |
2dup disjoint? ?not? warnings @ and if |
| cr .in ." conflict:" |
cr .in ." conflict:" |
| intersection print-token @ apply-to-members |
intersection print-token @ apply-to-members |
| else |
else |
| : compute-alternative \ -- first maybe-empty ) |
: compute-alternative \ -- first maybe-empty ) |
| operand1 compute |
operand1 compute |
| operand2 compute |
operand2 compute |
| rot 2dup and if |
rot 2dup and warnings @ and if |
| cr .in ." warning: two branches may be empty" endif |
cr .in ." warning: two branches may be empty" endif |
| or >r union r> ; |
or >r union r> ; |
| |
|
| |
|
| \ options ) |
\ options ) |
| : compute-option \ -- set f ) |
: compute-option \ -- set f ) |
| operand compute if |
operand compute warnings @ and if |
| cr .in ." warning: unnessesary option" endif |
cr .in ." warning: unnessesary option" endif |
| true ; |
true ; |
| |
|
| |
|
| \ *-repetitions ) |
\ *-repetitions ) |
| : compute-*repetition \ -- set f ) |
: compute-*repetition \ -- set f ) |
| operand compute if |
operand compute warnings @ and if |
| cr .in ." warning: *repetition of optional term" endif |
cr .in ." warning: *repetition of optional term" endif |
| true ; |
true ; |
| |
|