-
Notifications
You must be signed in to change notification settings - Fork 1
/
Recognizer-rfc-C.html
1781 lines (1694 loc) · 98.1 KB
/
Recognizer-rfc-C.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><script src="//archive.org/includes/analytics.js?v=cf34f82" type="text/javascript"></script>
<script type="text/javascript">window.addEventListener('DOMContentLoaded',function(){var v=archive_analytics.values;v.service='wb';v.server_name='wwwb-app39.us.archive.org';v.server_ms=630;archive_analytics.send_pageview({});});</script><script type="text/javascript" src="/_static/js/playback.bundle.js?v=qchdzUCo" charset="utf-8"></script>
<script type="text/javascript" src="/_static/js/wombat.js?v=cRqOKCOw" charset="utf-8"></script>
<script type="text/javascript">
__wm.init("https://web.archive.org/web");
__wm.wombat("http://amforth.sourceforge.net/pr/Recognizer-rfc-C.html","20160328150126","https://web.archive.org/web/","web","/_static/",
"1459177286","amforth.sourceforge.net");
</script>
<link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css?v=NHuXCfBH" />
<link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css?v=qtvMKcIJ" />
<!-- End Wayback Rewrite JS Include -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/"/>
<title>Forth Recognizer -- Request For Discussion</title>
<meta name="author" content="Matthias Trute"/>
<meta name="date" content="December, 1 2015"/>
<style type="text/css">
/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body><!-- BEGIN WAYBACK TOOLBAR INSERT -->
<style type="text/css">
body {
margin-top:0 !important;
padding-top:0 !important;
/*min-width:800px !important;*/
}
</style>
<script>__wm.rw(0);</script>
<div id="wm-ipp-base" lang="en" style="display:none;direction:ltr;">
<div id="wm-ipp" style="position:fixed;left:0;top:0;right:0;">
<div id="wm-ipp-inside">
<div style="position:relative;">
<div id="wm-logo" style="float:left;width:110px;padding-top:12px;">
<a href="/web/" title="Wayback Machine home page"><img src="/_static/images/toolbar/wayback-toolbar-logo-200.png" srcset="/_static/images/toolbar/wayback-toolbar-logo-100.png, /_static/images/toolbar/wayback-toolbar-logo-150.png 1.5x, /_static/images/toolbar/wayback-toolbar-logo-200.png 2x" alt="Wayback Machine" style="width:100px" border="0" /></a>
</div>
<div class="r" style="float:right;">
<div id="wm-btns" style="text-align:right;height:25px;">
<div id="wm-save-snapshot-success">success</div>
<div id="wm-save-snapshot-fail">fail</div>
<a id="wm-save-snapshot-open" href="#"
title="Share via My Web Archive" >
<span class="iconochive-web"></span>
</a>
<a href="https://archive.org/account/login.php"
title="Sign In"
id="wm-sign-in"
>
<span class="iconochive-person"></span>
</a>
<span id="wm-save-snapshot-in-progress" class="iconochive-web"></span>
<a href="http://faq.web.archive.org/" title="Get some help using the Wayback Machine" style="top:-6px;"><span class="iconochive-question" style="color:rgb(87,186,244);font-size:160%;"></span></a>
<a id="wm-tb-close" href="#close" onclick="__wm.h(event);return false;" style="top:-2px;" title="Close the toolbar"><span class="iconochive-remove-circle" style="color:#888888;font-size:240%;"></span></a>
</div>
<div id="wm-share">
<a href="/web/20160328150126/http://web.archive.org/screenshot/http://amforth.sourceforge.net/pr/Recognizer-rfc-C.html"
id="wm-screenshot"
title="screenshot">
<span class="wm-icon-screen-shot"></span>
</a>
<a id="wm-share-facebook" href="#" data-url="https://web.archive.org/web/20160328150126/http://amforth.sourceforge.net/pr/Recognizer-rfc-C.html" title="Share on Facebook" style="margin-right:5px;" target="_blank"><span class="iconochive-facebook" style="color:#3b5998;font-size:160%;"></span></a>
<a id="wm-share-twitter" href="#" data-url="https://web.archive.org/web/20160328150126/http://amforth.sourceforge.net/pr/Recognizer-rfc-C.html" title="Share on Twitter" style="margin-right:5px;" target="_blank"><span class="iconochive-twitter" style="color:#1dcaff;font-size:160%;"></span></a>
</div>
</div>
<table class="c" style="">
<tbody>
<tr>
<td class="u" colspan="2">
<form target="_top" method="get" action="/web/submit" name="wmtb" id="wmtb"><input type="text" name="url" id="wmtbURL" value="http://amforth.sourceforge.net/pr/Recognizer-rfc-C.html" onfocus="this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20160328150126" /><input type="submit" value="Go" /></form>
</td>
<td class="n" rowspan="2" style="width:110px;">
<table>
<tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr class="m">
<td class="b" nowrap="nowrap">Feb</td>
<td class="c" id="displayMonthEl" title="You are here: 15:01:26 Mar 28, 2016">MAR</td>
<td class="f" nowrap="nowrap">Apr</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr class="d">
<td class="b" nowrap="nowrap"><img src="/_static/images/toolbar/wm_tb_prv_off.png" alt="Previous capture" width="14" height="16" border="0" /></td>
<td class="c" id="displayDayEl" style="width:34px;font-size:24px;white-space:nowrap;" title="You are here: 15:01:26 Mar 28, 2016">28</td>
<td class="f" nowrap="nowrap"><img src="/_static/images/toolbar/wm_tb_nxt_off.png" alt="Next capture" width="14" height="16" border="0" /></td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr class="y">
<td class="b" nowrap="nowrap">2015</td>
<td class="c" id="displayYearEl" title="You are here: 15:01:26 Mar 28, 2016">2016</td>
<td class="f" nowrap="nowrap">2017</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="s">
<div id="wm-nav-captures">
<a class="t" href="/web/20160328150126*/http://amforth.sourceforge.net/pr/Recognizer-rfc-C.html" title="See a list of every capture for this URL">1 capture</a>
<div class="r" title="Timespan for captures of this URL">28 Mar 2016</div>
</div>
</td>
<td class="k">
<a href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" title="Explore captures for this URL" style="position: relative">
<canvas id="wm-sparkline-canvas" width="625" height="27" border="0"></canvas>
</div>
</a>
</td>
</tr>
</tbody>
</table>
<div style="position:absolute;bottom:0;right:2px;text-align:right;">
<a id="wm-expand" class="wm-btn wm-closed" href="#expand" onclick="__wm.ex(event);return false;"><span id="wm-expand-icon" class="iconochive-down-solid"></span> <span style="font-size:80%">About this capture</span></a>
</div>
</div>
<div id="wm-capinfo" style="border-top:1px solid #777;display:none; overflow: hidden">
<div id="wm-capinfo-collected-by">
<div style="background-color:#666;color:#fff;font-weight:bold;text-align:center">COLLECTED BY</div>
<div style="padding:3px;position:relative" id="wm-collected-by-content">
<div style="display:inline-block;vertical-align:top;width:50%;">
<span class="c-logo" style="background-image:url(https://archive.org/services/img/webwidecrawl);"></span>
Organization: <a style="color:#33f;" href="https://archive.org/details/webwidecrawl" target="_new"><span class="wm-title">Internet Archive</span></a>
<div style="max-height:75px;overflow:hidden;position:relative;">
<div style="position:absolute;top:0;left:0;width:100%;height:75px;background:linear-gradient(to bottom,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 90%,rgba(255,255,255,255) 100%);"></div>
The Internet Archive discovers and captures web pages through many different web crawls.
At any given time several distinct crawls are running, some for months, and some every day or longer.
View the web archive through the <a href="http://archive.org/web/web.php">Wayback Machine</a>.
</div>
</div>
<div style="display:inline-block;vertical-align:top;width:49%;">
<span class="c-logo" style="background-image:url(https://archive.org/services/img/hackernews00000)"></span>
<div>Collection: <a style="color:#33f;" href="https://archive.org/details/hackernews00000" target="_new"><span class="wm-title">Hackernews crawl number 0</span></a></div>
<div style="max-height:75px;overflow:hidden;position:relative;">
<div style="position:absolute;top:0;left:0;width:100%;height:75px;background:linear-gradient(to bottom,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 90%,rgba(255,255,255,255) 100%);"></div>
Hacker News Crawl of their links.
</div>
</div>
</div>
</div>
<div id="wm-capinfo-timestamps">
<div style="background-color:#666;color:#fff;font-weight:bold;text-align:center" title="Timestamps for the elements of this page">TIMESTAMPS</div>
<div>
<div id="wm-capresources" style="margin:0 5px 5px 5px;max-height:250px;overflow-y:scroll !important"></div>
<div id="wm-capresources-loading" style="text-align:left;margin:0 20px 5px 5px;display:none"><img src="/_static/images/loading.gif" alt="loading" /></div>
</div>
</div>
</div></div></div></div><div id="donato" style="position:relative;width:100%;">
<div id="donato-base">
<iframe id="donato-if" src="https://archive.org/includes/donate.php?as_page=1&transpiled=0&referer=https%3A//web.archive.org/web/20160328150126/http%3A//amforth.sourceforge.net/pr/Recognizer-rfc-C.html"
scrolling="no" frameborder="0" style="width:100%; height:100%">
</iframe>
</div>
</div><script type="text/javascript">
__wm.bt(625,27,25,2,"web","http://amforth.sourceforge.net/pr/Recognizer-rfc-C.html","20160328150126",1996,"/_static/",["/_static/css/banner-styles.css?v=NHuXCfBH","/_static/css/iconochive.css?v=qtvMKcIJ"]);
__wm.rw(1);
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div class="document" id="forth-recognizer-request-for-discussion">
<h1 class="title">Forth Recognizer -- Request For Discussion</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name"/>
<col class="docinfo-content"/>
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Matthias Trute</td></tr>
<tr><th class="docinfo-name">Contact:</th>
<td><a class="first last reference external" href="https://web.archive.org/web/20160328150126/mailto:[email protected]">mtrute@web.de</a></td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>3</td></tr>
<tr><th class="docinfo-name">Date:</th>
<td>December, 1 2015</td></tr>
<tr><th class="docinfo-name">Status:</th>
<td>Final</td></tr>
</tbody>
</table>
<div class="section" id="change-history">
<h1>Change history</h1>
<blockquote>
<ul>
<li><p class="first">2014-10-03 Version 1 - initial version.</p>
</li>
<li><p class="first">2015-05-17 Version 2 - extend rationale, added ' and [']</p>
</li>
<li><p class="first">2015-12-01 Version 3 - separate use cases, minor changes for
nested recognizer stacks. New <tt class="docutils literal">POSTPONE</tt> action</p>
<blockquote>
<ul>
<li><dl class="first docutils">
<dt>2015-09-27</dt>
<dd><ul class="first last simple">
<li>Move naming conventions to informal appendix (not
mandatory but worth to be mentioned)</li>
<li>New <tt class="docutils literal">POSTPONE</tt> action. That finalizes the <tt class="docutils literal">R:TABLE</tt>
API.</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>2015-10-17</dt>
<dd><ul class="first last simple">
<li>Recognizers <em>can/may/shall</em> but don't <em>have to</em> replace
the existing interpreter (Euroforth 2015).</li>
<li>empty recognizer stacks are now allowed as a consequence from the above.</li>
<li><a class="reference internal" href="#r-fail-necessity">R:FAIL necessity</a></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>2015-10-31</dt>
<dd><ul class="first last simple">
<li><a class="reference internal" href="#nested-recognizer-stacks">Nested Recognizer Stacks</a> and (fast) switching between them.
Introducing <tt class="docutils literal"><span class="pre">FORTH-RECOGNIZER</span></tt> as entry for the interpreter
and similar words.</li>
<li>fix stack effects at various places. More precious <tt class="docutils literal">POSTPONE</tt>
description.</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>2015-11-07</dt>
<dd><ul class="first last simple">
<li>finalize the building blocks.</li>
<li>Introduce the recognizer stack id as an additional parameter.</li>
<li>remove use cases from the proposal. Affects e.g. interpret, tick, bracket-tick
and <tt class="docutils literal">POSTPONE</tt>. These words went to the informal appendix if applicable.</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>2015-11-17</dt>
<dd><ul class="first last simple">
<li>expose the <tt class="docutils literal">R>INT</tt>/<tt class="docutils literal">R>COMP</tt>/<tt class="docutils literal">R>POST</tt> words.</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>2015-11-28</dt>
<dd><ul class="first last simple">
<li>document structure revisited.</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt>2015-12-01</dt>
<dd><ul class="first last simple">
<li>final version and public announcement</li>
</ul>
</dd>
</dl>
</li>
</ul>
</blockquote>
</li>
</ul>
</blockquote>
</div>
<div class="section" id="background">
<h1>Background</h1>
<p>I'm working on a Forth for 8-bit micro-controllers
for almost 10 years now (<a class="reference external" href="https://web.archive.org/web/20160328150126/http://amforth.sf.net/">amforth.sf.net</a>).
It is not only a useful tool for serious work but
a nice playground to experiment with Forth too.</p>
<p>In 2011 my Forth got a floating point library. Since
a micro-controller is (was) a resource constrained
system it is not an option to include it permanently.
It has to be a loadable module. Therefore I needed a
way to keep the core system small but at the same time
able to fully handle the new numbers. All but one
problem were easy to fix. Only adding the number format
to the Forth interpreter turned out to be serious one. I
searched the net for ways to extend the Forth interpreter.
What I found was having many hooks in the interpreter (U.
Hoffman, Euroforth 2008) or a conditional re-compile of
the sources with an autotool/configure like build system.
Nothing really convinced me or my users. While googling
I stumbled across the number parsing prefix discussion
in c.l.f in 2007. The ideas sketched there looked
promising so I stopped searching and started with
them to invent my own solution.</p>
<p>I changed the Forth interpreter into a dumb tool, that
delegates all data related work to modules, which can
be changed at run-time. That made it possible to load the
FP library into a running system that afterwards was able
to deal with the new numbers like native ones. Surprisingly
the new system had no disadvantages in speed or size
compared the old one, something I consider very
important on a micro-controller.</p>
<p>Shortly thereafter, Bernd Paysan got interested in what I
did (we have regular IRC sessions on Forth topics) and
started to implement recognizers in gforth. He suggested
changes that further simplified my concept and made
it more flexible.</p>
<p>By now we reached a point that justifies the public review.
There are two very different Forth's available (both GPL'ed)
that implement recognizers. A third implementation is in
the proposal (public domain).</p>
<p>A recognizer written for one Forth works without modification
for the other ones too. The words used to actually implement a
recognizer (mostly string processing) need to be available
of course. E.g. I wrote a recognizer for time stamp strings
with gforth that converts the hh:mm:ss notation into a
double cell number for the seconds since midnight. The
code runs on amforth too. Gforth is a 64-bit system
on the PC, amforth a 16-bit system on an 8-bit micro-controller
(hence the double numbers). With that, something like</p>
<pre class="code forth literal-block">
<span class="keyword namespace">:</span> <span class="name class">test</span> <span class="literal number integer">01</span><span class="name function">:00:01</span> <span class="keyword">d. </span><span class="literal string">."</span> <span class="literal string"> seconds since midnight</span><span class="name function">"</span> <span class="keyword">; </span><span class="name function">ok</span>
<span class="name function">test</span> <span class="literal number integer">3601</span> <span class="name function">seconds</span> <span class="name function">since</span> <span class="name function">midnight</span> <span class="name function">ok</span>
<span class="literal number integer">01</span><span class="name function">:01:00</span> <span class="literal number integer">01</span><span class="name function">:00:01</span> <span class="keyword">d+ d. </span><span class="literal number integer">7261</span> <span class="name function">ok</span>
</pre>
<p>is possible. Similarly strings: everything that starts
with a <tt class="docutils literal">"</tt> is a string until the closing <tt class="docutils literal">"</tt> is
reached. Further string handling get the addr/len
without the enclosing <tt class="docutils literal">"</tt>.</p>
<pre class="code forth literal-block">
<span class="keyword namespace">:</span> <span class="name class">test</span> <span class="name function">"A</span> <span class="name function">string"</span> <span class="keyword">type ; </span><span class="name function">ok</span>
<span class="name function">test</span> <span class="name function">A</span> <span class="name function">string</span> <span class="name function">ok</span>
<span class="name function">"</span> <span class="name function">Another</span> <span class="name function">string"</span> <span class="keyword">type </span><span class="name function">ok</span> <span class="name function">Another</span> <span class="name function">string</span>
</pre>
<p>Another use case are name-spaces with
word lists, without touching <tt class="docutils literal">ORDER</tt>:</p>
<pre class="code forth literal-block">
<span class="keyword namespace">:</span> <span class="name class">test</span> <span class="name function">i2c.begin</span> <span class="name function">i2c.sendbyte</span> <span class="name function">i2c.end</span> <span class="keyword">;</span>
</pre>
<p>where <tt class="docutils literal">begin/sendbyte/end</tt> are words from
the word-list identified with <tt class="docutils literal">i2c</tt> (a constant
with the wid). The recognizer splits the word
at the first dot and uses the left sub-word to
get the a word-list. In that word-list it searches
with the remaining string and handles the result
just like an ordinary dictionary search:
interpret, compile (or not found).</p>
<p>Implementations for these examples are available in
the respective Forth systems.</p>
</div>
<div class="section" id="problem">
<h1>Problem</h1>
<p>The Forth compiler can be extended easily. The Forth
interpreter however has a fixed set of capabilities as
outlined in section 3.4 of the standard text: Words from
the dictionary and some numbers.</p>
<p>It's not easily possible to use the Forth text interpreter
in an application or system extension context. The building
blocks (<tt class="docutils literal">FIND</tt>, <tt class="docutils literal">COMPILE,</tt>, <tt class="docutils literal">>NUMBER</tt> etc) are available
but there is a gap between them and what the Forth interpreter
does. Applications need to use either additional system
provided and system specific intermediate words (if available)
or have to re-invent the wheel to use e.g. numbers with a
sign or hex numbers with the $ prefix.</p>
<p>Some Forth interpreters have ways to add new data types.
That makes it possible to use a loadable library to
implement new data types to be handled like the built-in
ones. An example are the floating point numbers. They
have their own parsing and data handling words including
a stack of their own.</p>
<p>To actually handle data in the Forth context, the
processing actions need to be <tt class="docutils literal">STATE</tt> aware. It
would be nice if the Forth text interpreter,
that maintains <tt class="docutils literal">STATE</tt>, is able to do the data
processing without exposing <tt class="docutils literal">STATE</tt> to the data
handling methods. For that the different methods
need to be registered somehow.</p>
</div>
<div class="section" id="solution">
<h1>Solution</h1>
<p>The monolithic design of the Forth interpreter is factored into
three major blocks: First the interpreter. It maintains <tt class="docutils literal">STATE</tt>
and organizes the work. Second the actual data parsing. It is
called from the interpreter and analyses strings (usually
sub-strings of <tt class="docutils literal">SOURCE</tt>) if they match the criteria for a
certain data type. These parsing words are grouped as a stack
to achieve an order of invocation. The result of the parsing
words is handed over by the interpreter to data specific
handling methods. There are three different methods for each
data type depending on <tt class="docutils literal">STATE</tt> and to <tt class="docutils literal">POSTPONE</tt> the data.</p>
<p>The combination of a parsing word and the set of data handling words
to deal with the data is called a recognizer. There is no strict 1:1
relation between the parsing words and the data handling sets. A data
handling set for e.g. single cell numbers can be used by different
parsing words.</p>
<p>Whenever the Forth text interpreter is mentioned, the standard
words <tt class="docutils literal">EVALUATE</tt> (CORE), <tt class="docutils literal">'</tt> (tick, CORE), <tt class="docutils literal"><span class="pre">INCLUDE-FILE</span></tt>
(FILE), <tt class="docutils literal"><span class="pre">INCLUDED``(FILE),</span> ``LOAD</tt> (BLOCK) and <tt class="docutils literal">THRU</tt> (BLOCK)
are expected to act likewise. This proposal is not about to change
these words, but to provide the tools to do so. As long as the
standard feature set is used, a complete replacement with
recognizers is possible.</p>
<p>The proposal is about the building blocks.</p>
</div>
<div class="section" id="proposal">
<h1>Proposal</h1>
<div class="section" id="xy-the-optional-recognizer-word-set">
<h2>XY. The optional Recognizer word set</h2>
<div class="section" id="xy-1-introduction">
<h3>XY.1 Introduction</h3>
<p>A recognizer consists of two elements: a parsing word and
information token(s) returned by the parsing words that
identify the parsed data and provide methods to perform
the various semantics of the data: interpret, compile and
postpone. A parsing word can return different information
tokens. A particular information token can be used by
different parsing words.</p>
<p>There is a system provided information token called <tt class="docutils literal">R:FAIL</tt>. It
is used if no other token is applicable. This failure token is
associated with the system error actions if used in step e) of
the text interpreter (see Appendix). It is used to achieve the
action d) of the section 3.4 text interpreter.</p>
<p>The parsing word of a recognizer has the stack effect (parsing
word names start with <tt class="docutils literal">REC:</tt> in this chapter)</p>
<pre class="code forth literal-block">
<span class="name function">REC:TABLE</span> <span class="comment single">( addr len -- i*x R:TABLE | R:FAIL )</span>
</pre>
<p>"addr/len" is a string, if provided by the Forth text interpreter
a sub-string inside <tt class="docutils literal">SOURCE</tt>. The parsing word must not change the
string content. It may change <tt class="docutils literal">>IN</tt> however.</p>
<p>"i*x" is the result of the parse action of the string "addr/len".
<tt class="docutils literal">R:TABLE</tt> is the information token that the interpreter uses
to execute the interpret, compile or postpone actions for the
data "i*x".</p>
<p>All three actions are called with the "i*x" data as left by the
parsing word and are generally expected to consume it. They can
have additional stack effects, depending on what <tt class="docutils literal">R:TABLE:METHOS</tt>
actually does.</p>
<pre class="code forth literal-block">
<span class="name function">R:TABLE:METHOD</span> <span class="comment single">( ... i*x -- j*y )</span>
</pre>
<p>The data items "i*x" don't have to be on the data stack, they
can be at different places, if applicable. E.g. floating
point numbers have a stack of their own. In this case,
the data stack contains the <tt class="docutils literal">R:TABLE</tt> information only.</p>
<p>The names <tt class="docutils literal">R:TABLE</tt>, <tt class="docutils literal">REC:TABLE</tt> and <tt class="docutils literal">R:TABLE:METHOD</tt>
don't have to actually exist, except the <tt class="docutils literal">R:FAIL</tt> name.</p>
<p>A Forth system shall provide recognizers for integer numbers (both
single and double precision) and the word look-up in the dictionary.</p>
<p>A recognizer stack is identified by its ID. The numeric value
is system dependent and generally opaque. The elements of a
recognizer stack are available with <tt class="docutils literal"><span class="pre">GET/SET-RECOGNIZERS</span></tt> only.</p>
</div>
<div class="section" id="xy-2-additional-terms-and-notations">
<h3>XY.2 Additional terms and notations</h3>
<p>Information token: A single cell number. It identifies the
data type and a method table to perform the data processing
of the interpreter.</p>
<p>Recognizer: A combination of a text parsing word that
returns information tokens together with parsed data
if successful. The text parsing word is assumed to
run in cooperation with <tt class="docutils literal">SOURCE</tt> and <tt class="docutils literal">>IN</tt>.</p>
<p>A recognizer stack is identified with its stack id. This
is cell sized numeric value. It may but don't have to
be an address accessible with <tt class="docutils literal">@</tt> and <tt class="docutils literal">!</tt> operations.</p>
</div>
<div class="section" id="xy-3-additional-usage-requirements">
<h3>XY.3 Additional usage requirements</h3>
<div class="section" id="xy-3-1-environment-queries">
<h4>XY.3.1 Environment Queries</h4>
<p>Obsolete.</p>
</div>
</div>
<div class="section" id="xy-4-additional-documentation-requirements">
<h3>XY.4 Additional documentation requirements</h3>
<div class="section" id="xy-4-1-system-documentation">
<h4>XY.4.1 System documentation</h4>
<div class="section" id="xy-4-1-1-implementation-defined-options">
<h5>XY.4.1.1 Implementation-defined options</h5>
<p>No additional options.</p>
</div>
<div class="section" id="xy-4-1-2-ambiguous-conditions">
<h5>XY.4.1.2 Ambiguous conditions</h5>
<ul class="simple">
<li>Change of the content of the parsed string during
parsing.</li>
<li>During <tt class="docutils literal"><span class="pre">SET-RECOGNIZERS</span></tt> the Recognizer stack size is exceeded.
In this case, at least the following actions are possible
* resize the stack, keeping its id
* throw an exception (TBD)
* execute an error action</li>
</ul>
</div>
</div>
<div class="section" id="xy-4-2-program-documentation">
<h4>XY.4.2 Program documentation</h4>
<ul class="simple">
<li>No additional dependencies.</li>
</ul>
</div>
</div>
<div class="section" id="xy-5-compliance-and-labeling">
<h3>XY.5 Compliance and labeling</h3>
<p>The phrase "Providing the Recognizer word set" shall be appended
to the label of any Standard System that provides all of the
Recognizer word set.</p>
</div>
<div class="section" id="xy-6-glossary">
<h3>XY.6 Glossary</h3>
<div class="section" id="xy-6-1-recognizer-words">
<h4>XY.6.1 Recognizer Words</h4>
<dl class="docutils">
<dt>DO-RECOGNIZER ( addr len stack-id -- i*x R:TABLE | R:FAIL ) RECOGNIZER</dt>
<dd><p class="first">Apply the string at "addr/len" to the elements of the recognizer
stack identified by <tt class="docutils literal"><span class="pre">stack-id</span></tt>. Terminate the iteration if either
one recognizer returns a information token that is different from
<tt class="docutils literal">R:FAIL</tt> or the stack is exhausted. In this case return <tt class="docutils literal">R:FAIL</tt>.</p>
<p class="last">"i*x" is the result of the parsing word. It represents the data from
the string. It may be on other locations than the data stack. In this
case the stack diagram should be read accordingly.</p>
</dd>
<dt>FORTH-RECOGNIZER ( -- stack-id ) RECOGNIZER</dt>
<dd><p class="first">A system VALUE with a recognizer stack id.</p>
<p>It is <tt class="docutils literal">VALUE</tt> that can be changed using <tt class="docutils literal">TO</tt> assigning a
new recognizer stack id. This change has immediate effect.</p>
<p class="last">The recognizer stack from this stack-id shall be used in all
system level words like <tt class="docutils literal">EVALUATE</tt>, <tt class="docutils literal">LOAD</tt> etc.</p>
</dd>
<dt>GET-RECOGNIZERS ( stack-id -- rec-n .. rec-1 n ) RECOGNIZER</dt>
<dd><p class="first">Return the execution tokens <tt class="docutils literal"><span class="pre">rec-1</span> .. <span class="pre">rec-n</span></tt> of the parsing
words in the recognizer stack identified with <tt class="docutils literal"><span class="pre">stack-id</span></tt>.
<tt class="docutils literal"><span class="pre">rec-1</span></tt> identifies the recognizer that is called first and
<tt class="docutils literal"><span class="pre">rec-n</span></tt> the word that is called last.</p>
<p class="last">The recognizer stack is left unchanged.</p>
</dd>
<dt>R>COMP ( R:TABLE -- XT-COMPILE ) RECOGNIZER</dt>
<dd>Return the execution token for the compilation action from the
recognizer information token.</dd>
<dt>R>INT ( R:TABLE -- XT-INTERPRET ) RECOGNIZER</dt>
<dd>Return the execution token for the interpretation action from
the recognizer information token.</dd>
<dt>R>POST ( R:TABLE -- XT-POSTPONE ) RECOGNIZER</dt>
<dd>Return the execution token for the postpone action from the
recognizer information token.</dd>
<dt>R:FAIL ( -- R:FAIL ) RECOGNIZER</dt>
<dd><p class="first">An information token with two uses: First it is used to
deliver the information that a specific recognizer could
not deal with the string passed to it. Second it is a
predefined information token whose elements are used
when no recognizer from the recognizer stack could handle the
passed string. These methods provide the system error actions.</p>
<p class="last">The actual numeric value is system dependent.</p>
</dd>
<dt>RECOGNIZER ( size -- stack-id ) RECOGNIZER</dt>
<dd>Create a new recognizer stack with size elements.</dd>
<dt>RECOGNIZER: ( XT-INTERPRET XT-COMPILE XT-POSTPONE "<spaces>name" -- ) RECOGNIZER</dt>
<dd><p class="first">Skip leading space delimiters. Parse name delimited by a space. Create
a recognizer information token "name" with the three execution tokens.</p>
<p>The words for XT-INTERPRET, XT-COMPILE and XT-POSTPONE are called with
the parsed data that the associated parsing word of the recognizer
returned. The information token itself is consumed by the caller.</p>
<p class="last">Each of the words XT-INTERPRET, XT-COMPILE and XT-POSTPONE has the
stack effect <tt class="docutils literal">( ... i*x <span class="pre">--</span> j*y )</tt>. The words to compile and postpone
the data shall consume the data "i*x". If the data "i*x" is on different
locations (e.g. floating point numbers), these words shall use that data.</p>
</dd>
<dt>SET-RECOGNIZERS ( rec-n .. rec-1 n stack-id -- ) RECOGNIZER</dt>
<dd><p class="first">Set the recognizer stack identified by <tt class="docutils literal"><span class="pre">stack-id</span></tt> to the recognizers
identified by the execution tokens of their parsing words <tt class="docutils literal"><span class="pre">rec-n</span> .. <span class="pre">rec-1</span></tt>.
<tt class="docutils literal"><span class="pre">rec-1</span></tt> will be the parsing word of the recognizer that is called
first, <tt class="docutils literal"><span class="pre">rec-n</span></tt> will be the last one.</p>
<p class="last">If the size of the existing recognizer stack is too small to hold all
new elements, an ambiguous situation arises.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="xy-7-reference-implementation">
<h3>XY.7 Reference Implementation</h3>
<p>The code has as little as possible dependencies.</p>
<pre class="code forth literal-block">
<span class="keyword namespace">:</span> <span class="name class">RECOGNIZER</span> <span class="comment single">( size -- stack-id )</span>
<span class="keyword">1+ </span><span class="comment single">( size )</span> <span class="keyword">CELLS HERE SWAP ALLOT
</span> <span class="literal number integer">0</span> <span class="keyword">OVER ! </span><span class="comment single">\ empty stack
</span><span class="keyword">;
</span><span class="comment single">\ create the default recognizer stack
</span><span class="literal number integer">4</span> <span class="name decorator">RECOGNIZER </span><span class="keyword namespace">VALUE</span> <span class="name class">FORTH-RECOGNIZER</span>
<span class="keyword namespace">:</span> <span class="name class">SET-RECOGNIZERS</span> <span class="comment single">( rec-n .. rec-1 n stack-id -- )</span>
<span class="keyword">2DUP ! >R
</span> <span class="keyword">BEGIN
</span> <span class="keyword">DUP
</span> <span class="keyword">WHILE
</span> <span class="keyword">DUP CELLS R@ +
</span> <span class="keyword">ROT SWAP ! 1-
</span> <span class="keyword">REPEAT R> 2DROP
;
</span>
<span class="keyword namespace">:</span> <span class="name class">GET-RECOGNIZERS</span> <span class="comment single">( stack-id -- rec-n .. rec-1 n )</span>
<span class="keyword">DUP @ DUP >R SWAP
</span> <span class="keyword">BEGIN
</span> <span class="keyword">CELL+ OVER
</span> <span class="keyword">WHILE
</span> <span class="keyword">DUP @ ROT 1- ROT
</span> <span class="keyword">REPEAT 2DROP
</span> <span class="keyword">R>
;
</span>
<span class="comment single">\ create a simple 3 element structure
</span><span class="keyword namespace">:</span> <span class="name class">RECOGNIZER:</span> <span class="comment single">( XT-INTERPRET XT-COMPILE XT-POSTPONE "<spaces>name" -- )</span>
<span class="keyword">CREATE SWAP ROT , , ,
;
</span>
<span class="comment single">\ decode the data structure created by RECOGNIZER:
</span><span class="keyword namespace">:</span> <span class="name class">R>POST</span> <span class="comment single">( R:TABLE -- XT-POSTPONE )</span> <span class="keyword">CELL+ CELL+ @ ;
</span><span class="keyword namespace">:</span> <span class="name class">R>COMP</span> <span class="comment single">( R:TABLE -- XT-COMPILE )</span> <span class="keyword">CELL+ @ ;
</span><span class="keyword namespace">:</span> <span class="name class">R>INT</span> <span class="comment single">( R:TABLE -- XT-INTERPRET)</span> <span class="keyword">@ ;
</span>
<span class="comment single">\ system failure recognizer
</span><span class="keyword">:NONAME </span><span class="literal number integer">-13</span> <span class="keyword">THROW ; DUP DUP </span><span class="name decorator">RECOGNIZER: R:FAIL
</span>
<span class="keyword namespace">:</span> <span class="name class">DO-RECOGNIZER</span> <span class="comment single">( addr len stack-id -- i*x R:TABLE | R:FAIL )</span>
<span class="keyword">DUP >R @
</span> <span class="keyword">BEGIN
</span> <span class="keyword">DUP
</span> <span class="keyword">WHILE
</span> <span class="keyword">DUP CELLS R@ + @
</span> <span class="keyword">2OVER 2>R SWAP 1- >R
</span> <span class="keyword">EXECUTE DUP </span><span class="name decorator">R:FAIL </span><span class="name function"><></span> <span class="keyword">IF
</span> <span class="keyword">2R> 2DROP 2R> 2DROP EXIT
</span> <span class="keyword">THEN
</span> <span class="keyword">DROP R> 2R> ROT
</span> <span class="keyword">REPEAT
</span> <span class="keyword">DROP 2DROP R> DROP </span><span class="name decorator">R:FAIL
</span><span class="keyword">;</span>
</pre>
</div>
</div>
<div class="section" id="a-xy-informal-appendix">
<h2>A.XY Informal Appendix</h2>
<div class="section" id="a-xy-1-postpone">
<h3>A.XY.1 POSTPONE</h3>
<p><tt class="docutils literal">POSTPONE</tt> compiles the data returned by <tt class="docutils literal"><span class="pre">DO-RECOGNIZER</span></tt> (<tt class="docutils literal">i*x</tt>)
into the dictionary as literal(s) and appends the compilation action
of the <tt class="docutils literal">R:TABLE</tt> information token. Later at run-time the <tt class="docutils literal">i*x</tt>
data is read back and the compilation action is performed like it
would have been called directly at compile time.</p>
<pre class="code forth literal-block">
<span class="keyword namespace">:</span> <span class="name class">POSTPONE</span> <span class="comment single">( "name" -- )</span>
<span class="keyword">PARSE-NAME </span><span class="name decorator">FORTH-RECOGNIZER DO-RECOGNIZER </span><span class="keyword">DUP >R
</span> <span class="name decorator">R>POST </span><span class="keyword">EXECUTE R> </span><span class="name decorator">R>COMP </span><span class="keyword">COMPILE, ;</span>
</pre>
<p>This implementation assumes a system that uses recognizers only.</p>
</div>
<div class="section" id="a-xy-2-example-recognizer">
<h3>A.XY.2 Example Recognizer</h3>
<p>The first example looks up the dictionary for the word
and returns the execution token and the header flags if
found. The data processing is the usual interpret/compile
action. The Compile actions checks for immediacy and act
accordingly. A portable postpone action is not possible.
Amforth and gforth do it in a system specific way.</p>
<pre class="code forth literal-block">
<span class="comment single">\ find-word is close to FIND but takes addr/len as input
</span><span class="literal number integer">256</span> <span class="keyword namespace">BUFFER:</span> <span class="name class">find-word-buf</span> <span class="comment single">\ counted string
</span><span class="keyword namespace">:</span> <span class="name class">place</span> <span class="comment single">( c-addr1 u c-addr2 )</span> <span class="keyword">2DUP C! CHAR+ SWAP MOVE ;
</span><span class="keyword namespace">:</span> <span class="name class">find-word</span> <span class="comment single">( addr len -- xt +/-1 | 0 )</span>
<span class="name function">find-word-buf</span> <span class="name function">place</span> <span class="name function">find-word-buf</span>
<span class="keyword">FIND DUP 0= IF NIP THEN ;
</span>
<span class="keyword namespace">:</span> <span class="name class">immediate?</span> <span class="comment single">( flags -- true|false )</span> <span class="keyword">0> ;
:NONAME </span><span class="comment single">( i*x XT flags -- j*y )</span> <span class="comment single">\ INTERPRET
</span> <span class="keyword">DROP EXECUTE ;
:NONAME </span><span class="comment single">( XT flags -- )</span> <span class="comment single">\ COMPILE