Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #56189 > unrolled thread

Recognizers : Search order for recognizers

Started byAlex <alex@rivadpm.com>
First post2017-03-23 16:47 +0000
Last post2017-03-23 11:59 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.lang.forth


Contents

  Recognizers : Search order for recognizers Alex <alex@rivadpm.com> - 2017-03-23 16:47 +0000
    Re: Recognizers : Search order for recognizers Alex <alex@rivadpm.com> - 2017-03-23 16:56 +0000
      Re: Recognizers : Search order for recognizers Matthias Trute <matthias.trute@gmail.com> - 2017-03-23 11:59 -0700

#56189 — Recognizers : Search order for recognizers

FromAlex <alex@rivadpm.com>
Date2017-03-23 16:47 +0000
SubjectRecognizers : Search order for recognizers
Message-ID<ob0u20$6ml$1@dont-email.me>
Search order for recognizers.

GET-RECOGNIZERS ( stack-id -- rec-n .. rec-1 n ) RECOGNIZER
rec-1 identifies the recognizer that is called first and rec-n the word 
that is called last.

SET-RECOGNIZERS ( rec-n .. rec-1 n stack-id -- ) RECOGNIZER
Set the recognizer stack identified by stack-id with a new set of 
parsing words identified by the execution tokens rec-n .. rec-1. rec-1 
will be the parsing word that is called first, rec-n will be the last one.

For instance where rec:tick recognizes words of the form 'XXXX and 
returns the tick of XXXX;

' rec:tick get-recognizers 1+ set-recognizers

Then

: special  20 ;
: 'special 10 ;

'SPECIAL . will print XT of SPECIAL, not 10. This is unintuitive.

-- 
Alex

[toc] | [next] | [standalone]


#56190

FromAlex <alex@rivadpm.com>
Date2017-03-23 16:56 +0000
Message-ID<ob0uig$8is$1@dont-email.me>
In reply to#56189
On 3/23/2017 16:47, Alex wrote:
> Search order for recognizers.
>
> GET-RECOGNIZERS ( stack-id -- rec-n .. rec-1 n ) RECOGNIZER
> rec-1 identifies the recognizer that is called first and rec-n the word
> that is called last.
>
> SET-RECOGNIZERS ( rec-n .. rec-1 n stack-id -- ) RECOGNIZER
> Set the recognizer stack identified by stack-id with a new set of
> parsing words identified by the execution tokens rec-n .. rec-1. rec-1
> will be the parsing word that is called first, rec-n will be the last one.
>
> For instance where rec:tick recognizes words of the form 'XXXX and
> returns the tick of XXXX;
>
> ' rec:tick get-recognizers 1+ set-recognizers
>
> Then
>
> : special  20 ;
> : 'special 10 ;
>
> 'SPECIAL . will print XT of SPECIAL, not 10. This is unintuitive.
>

Ignore this. I've just found a bug regression and this is not the case.

-- 
Alex

[toc] | [prev] | [next] | [standalone]


#56199

FromMatthias Trute <matthias.trute@gmail.com>
Date2017-03-23 11:59 -0700
Message-ID<3a22534b-d693-41ef-a88b-b28a7e39c853@googlegroups.com>
In reply to#56190
Am Donnerstag, 23. März 2017 17:56:33 UTC+1 schrieb Alex:
> On 3/23/2017 16:47, Alex wrote:
> > Search order for recognizers.
> >
> > GET-RECOGNIZERS ( stack-id -- rec-n .. rec-1 n ) RECOGNIZER
> > rec-1 identifies the recognizer that is called first and rec-n the word
> > that is called last.
> >
> > SET-RECOGNIZERS ( rec-n .. rec-1 n stack-id -- ) RECOGNIZER
> > Set the recognizer stack identified by stack-id with a new set of
> > parsing words identified by the execution tokens rec-n .. rec-1. rec-1
> > will be the parsing word that is called first, rec-n will be the last one.
> >
> > For instance where rec:tick recognizes words of the form 'XXXX and
> > returns the tick of XXXX;
> >
> > ' rec:tick get-recognizers 1+ set-recognizers
> >
> > Then
> >
> > : special  20 ;
> > : 'special 10 ;
> >
> > 'SPECIAL . will print XT of SPECIAL, not 10. This is unintuitive.
> >
> 
> Ignore this. I've just found a bug regression and this is not the case.

I'd like to recommend the stack test cases in the
stack package at http://theforth.net/package/stack. 
They cover each error *I* made during its development.
Mr Hayes is (was?) a great man.

Matthias

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.forth


csiph-web