-
Notifications
You must be signed in to change notification settings - Fork 8
/
parser.zap
1745 lines (1654 loc) · 37.1 KB
/
parser.zap
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
.FUNCT PARSER:ANY:0:0,PTR,WRD,VAL,VERB,OF-FLAG,OWINNER,OMERGED,LEN,DIR,NW,LW,CNT,?TMP2,?TMP1
SET 'PTR,P-LEXSTART
SET 'CNT,-1
?PRG1: IGRTR? 'CNT,P-ITBLLEN /?REP2
ZERO? P-OFLAG \?CND6
GET P-ITBL,CNT
PUT P-OTBL,CNT,STACK
?CND6: PUT P-ITBL,CNT,0
JUMP ?PRG1
?REP2: SET 'OWINNER,WINNER
SET 'OMERGED,P-MERGED
SET 'P-ADVERB,FALSE-VALUE
SET 'P-MERGED,FALSE-VALUE
SET 'P-END-ON-PREP,FALSE-VALUE
PUT P-PRSO,P-MATCHLEN,0
PUT P-PRSI,P-MATCHLEN,0
PUT P-BUTS,P-MATCHLEN,0
ZERO? QUOTE-FLAG \?CND8
EQUAL? WINNER,PLAYER /?CND8
SET 'WINNER,PLAYER
CALL2 META-LOC,PLAYER >HERE
CALL2 LIT?,HERE >LIT
?CND8: ZERO? RESERVE-PTR /?CCL14
SET 'PTR,RESERVE-PTR
ICALL STUFF,RESERVE-LEXV,P-LEXV
ZERO? SUPER-BRIEF \?CND15
EQUAL? PLAYER,WINNER \?CND15
CRLF
?CND15: SET 'RESERVE-PTR,FALSE-VALUE
SET 'P-CONT,FALSE-VALUE
JUMP ?CND12
?CCL14: ZERO? P-CONT /?CCL20
SET 'PTR,P-CONT
ZERO? SUPER-BRIEF \?CND21
EQUAL? PLAYER,WINNER \?CND21
EQUAL? PRSA,V?SAY /?CND21
CRLF
?CND21: SET 'P-CONT,FALSE-VALUE
JUMP ?CND12
?CCL20: SET 'WINNER,PLAYER
SET 'QUOTE-FLAG,FALSE-VALUE
LOC WINNER
FSET? STACK,VEHBIT /?CND26
LOC WINNER >HERE
?CND26: CALL2 LIT?,HERE >LIT
ZERO? SUPER-BRIEF \?PRG30
CRLF
?PRG30: ICALL1 UPDATE-STATUS-LINE
PRINTC 62
PUTB P-INBUF,1,0
READ P-INBUF,P-LEXV
?CND12: GETB P-LEXV,P-LEXWORDS >P-LEN
ZERO? P-LEN \?CND32
PRINTI "Bitte?"
CRLF
RFALSE
?CND32: GET P-LEXV,PTR >WRD
EQUAL? WRD,W?ACH \?CCL36
ADD PTR,P-LEXELEN
GET P-LEXV,STACK
EQUAL? STACK,W?PERIOD,W?COMMA \?CND37
ADD PTR,P-LEXELEN >PTR
DEC 'P-LEN
?CND37: GRTR? P-LEN,1 /?CCL41
PRINTI "Das war tolpatschig."
CRLF
RFALSE
?CCL41: GET OOPS-TABLE,O-PTR
ZERO? STACK /?CCL43
GRTR? P-LEN,2 \?CCL46
ADD PTR,P-LEXELEN
GET P-LEXV,STACK
EQUAL? STACK,W?QUOTE \?CCL46
PRINTI "Es tut mir leid, aber Fehler im vorgegebenen Text lassen sich nicht korrigieren."
CRLF
RFALSE
?CCL46: GRTR? P-LEN,2 \?CND44
PRINTI "Warnung: nur das erste Wort nach ACH kann gelten."
CRLF
?CND44: GET OOPS-TABLE,O-PTR >?TMP1
ADD PTR,P-LEXELEN
GET P-LEXV,STACK
PUT AGAIN-LEXV,?TMP1,STACK
SET 'WINNER,OWINNER
MUL PTR,P-LEXELEN
ADD STACK,6
GETB P-LEXV,STACK >?TMP2
MUL PTR,P-LEXELEN
ADD STACK,7
GETB P-LEXV,STACK >?TMP1
GET OOPS-TABLE,O-PTR
MUL STACK,P-LEXELEN
ADD STACK,3
ICALL INBUF-ADD,?TMP2,?TMP1,STACK
ICALL STUFF,AGAIN-LEXV,P-LEXV
GETB P-LEXV,P-LEXWORDS >P-LEN
GET OOPS-TABLE,O-START >PTR
ICALL INBUF-STUFF,OOPS-INBUF,P-INBUF
JUMP ?CND34
?CCL43: PUT OOPS-TABLE,O-END,FALSE-VALUE
PRINTI "Hier gab es kein Wort zu ersetzen!"
CRLF
RFALSE
?CCL36: EQUAL? WRD,W?WIEDER /?CND50
SET 'P-NUMBER,0
?CND50: PUT OOPS-TABLE,O-END,FALSE-VALUE
?CND34: GET P-LEXV,PTR
EQUAL? STACK,W?WIEDER \?CCL54
GETB OOPS-INBUF,1
ZERO? STACK \?CCL57
PRINTI "Bitte?"
CRLF
RFALSE
?CCL57: ZERO? P-OFLAG /?CCL59
PRINTI "Gespr%achsfetzen wiederholen ist schwierig."
CRLF
RFALSE
?CCL59: ZERO? P-WON \?CCL61
PRINTI "Das w%urde den Fehler nur wiederholen."
CRLF
RFALSE
?CCL61: GRTR? P-LEN,1 \?CCL63
ADD PTR,P-LEXELEN
GET P-LEXV,STACK
EQUAL? STACK,W?PERIOD,W?COMMA,W?DANN /?CTR65
ADD PTR,P-LEXELEN
GET P-LEXV,STACK
EQUAL? STACK,W?UND \?CCL66
?CTR65: ADD PTR,4 >PTR
GETB P-LEXV,P-LEXWORDS
SUB STACK,2
PUTB P-LEXV,P-LEXWORDS,STACK
JUMP ?CND55
?CCL66: PRINTI "Dieser Satz ist nicht verstanden worden."
CRLF
RFALSE
?CCL63: ADD PTR,P-LEXELEN >PTR
GETB P-LEXV,P-LEXWORDS
SUB STACK,1
PUTB P-LEXV,P-LEXWORDS,STACK
?CND55: GETB P-LEXV,P-LEXWORDS
GRTR? STACK,0 \?CCL71
ICALL STUFF,P-LEXV,RESERVE-LEXV
SET 'RESERVE-PTR,PTR
JUMP ?CND69
?CCL71: SET 'RESERVE-PTR,FALSE-VALUE
?CND69: SET 'WINNER,OWINNER
SET 'P-MERGED,OMERGED
ICALL INBUF-STUFF,OOPS-INBUF,P-INBUF
ICALL STUFF,AGAIN-LEXV,P-LEXV
SET 'CNT,-1
SET 'DIR,AGAIN-DIR
?PRG72: IGRTR? 'CNT,P-ITBLLEN /?CND52
GET P-OTBL,CNT
PUT P-ITBL,CNT,STACK
JUMP ?PRG72
?CCL54: ICALL STUFF,P-LEXV,AGAIN-LEXV
ICALL INBUF-STUFF,P-INBUF,OOPS-INBUF
PUT OOPS-TABLE,O-START,PTR
MUL 4,P-LEN
PUT OOPS-TABLE,O-LENGTH,STACK
GETB P-LEXV,P-LEXWORDS
MUL P-LEXELEN,STACK
ADD PTR,STACK
MUL 2,STACK >LEN
SUB LEN,1
GETB P-LEXV,STACK >?TMP1
SUB LEN,2
GETB P-LEXV,STACK
ADD ?TMP1,STACK
PUT OOPS-TABLE,O-END,STACK
SET 'RESERVE-PTR,FALSE-VALUE
SET 'LEN,P-LEN
SET 'P-DIR,FALSE-VALUE
SET 'P-NCN,0
SET 'P-GETFLAGS,0
?PRG77: DLESS? 'P-LEN,0 \?CCL81
SET 'QUOTE-FLAG,FALSE-VALUE
JUMP ?CND52
?CCL81: GET P-LEXV,PTR >WRD
ZERO? WRD \?CTR82
CALL2 NUMBER?,PTR >WRD
ZERO? WRD /?CCL83
?CTR82: ZERO? P-LEN \?CCL88
SET 'NW,0
JUMP ?CND86
?CCL88: ADD PTR,P-LEXELEN
GET P-LEXV,STACK >NW
?CND86: EQUAL? WRD,W?ZU \?CCL91
EQUAL? VERB,ACT?SAG \?CCL91
SET 'WRD,W?QUOTE
JUMP ?CND89
?CCL91: EQUAL? WRD,W?DANN \?CND89
GRTR? P-LEN,0 \?CND89
ZERO? VERB \?CND89
ZERO? QUOTE-FLAG \?CND89
EQUAL? LW,0,W?PERIOD \?CCL101
SET 'WRD,W?DER
JUMP ?CND89
?CCL101: PUT P-ITBL,P-VERB,ACT?SAG
PUT P-ITBL,P-VERBN,0
SET 'WRD,W?QUOTE
?CND89: EQUAL? WRD,W?DANN,W?PERIOD,W?QUOTE \?CCL104
EQUAL? WRD,W?QUOTE \?CND105
ZERO? QUOTE-FLAG /?CCL109
SET 'QUOTE-FLAG,FALSE-VALUE
JUMP ?CND105
?CCL109: SET 'QUOTE-FLAG,TRUE-VALUE
?CND105: ZERO? P-LEN /?PEN110
ADD PTR,P-LEXELEN >P-CONT
?PEN110: PUTB P-LEXV,P-LEXWORDS,P-LEN
JUMP ?CND52
?CCL104: CALL WT?,WRD,16,3 >VAL
ZERO? VAL /?CCL113
EQUAL? VERB,FALSE-VALUE,ACT?GEH \?CCL113
EQUAL? LEN,1 /?CTR112
EQUAL? LEN,2 \?PRD119
EQUAL? VERB,ACT?GEH /?CTR112
?PRD119: EQUAL? NW,W?DANN,W?PERIOD,W?QUOTE \?PRD122
LESS? LEN,2 \?CTR112
?PRD122: ZERO? QUOTE-FLAG /?PRD125
EQUAL? LEN,2 \?PRD125
EQUAL? NW,W?QUOTE /?CTR112
?PRD125: GRTR? LEN,2 \?CCL113
EQUAL? NW,W?COMMA,W?UND \?CCL113
?CTR112: SET 'DIR,VAL
EQUAL? NW,W?COMMA,W?UND \?CND131
ADD PTR,P-LEXELEN
PUT P-LEXV,STACK,W?DANN
?CND131: GRTR? LEN,2 /?CND79
SET 'QUOTE-FLAG,FALSE-VALUE
JUMP ?CND52
?CCL113: CALL WT?,WRD,64,1 >VAL
ZERO? VAL /?CCL136
ZERO? VERB \?CCL136
SET 'VERB,VAL
PUT P-ITBL,P-VERB,VAL
PUT P-ITBL,P-VERBN,P-VTBL
PUT P-VTBL,0,WRD
MUL PTR,2
ADD STACK,2 >CNT
GETB P-LEXV,CNT
PUTB P-VTBL,2,STACK
ADD CNT,1
GETB P-LEXV,STACK
PUTB P-VTBL,3,STACK
JUMP ?CND79
?CCL136: CALL WT?,WRD,8,0 >VAL
ZERO? VAL \?CTR139
EQUAL? WRD,W?ALLES /?CTR139
EQUAL? WRD,W?EIN,W?EINE,W?EINER /?CTR139
EQUAL? WRD,W?EINEM,W?EINEN /?CTR139
CALL WT?,WRD,32
ZERO? STACK \?CTR139
CALL WT?,WRD,128
ZERO? STACK /?CCL140
?CTR139: GRTR? P-LEN,1 \?CCL149
EQUAL? NW,W?VOLL \?CCL149
ZERO? VAL \?CCL149
EQUAL? WRD,W?ALLES /?CCL149
EQUAL? WRD,W?EIN,W?EINE,W?EINER /?CCL149
EQUAL? WRD,W?EINEM,W?EINEN /?CCL149
SET 'OF-FLAG,TRUE-VALUE
JUMP ?CND79
?CCL149: ZERO? VAL /?CCL158
ZERO? P-LEN /?CTR157
EQUAL? NW,W?DANN,W?PERIOD \?CCL158
?CTR157: SET 'P-END-ON-PREP,TRUE-VALUE
LESS? P-NCN,2 \?CND79
PUT P-ITBL,P-PREP1,VAL
PUT P-ITBL,P-PREP1N,WRD
JUMP ?CND79
?CCL158: EQUAL? P-NCN,2 \?CCL166
PRINTI "Der Satz hatte zu viele Substantive."
CRLF
RFALSE
?CCL166: INC 'P-NCN
SET 'P-ACT,VERB
CALL CLAUSE,PTR,VAL,WRD >PTR
ZERO? PTR /FALSE
LESS? PTR,0 \?CND79
SET 'QUOTE-FLAG,FALSE-VALUE
?CND52: PUT OOPS-TABLE,O-PTR,FALSE-VALUE
ZERO? DIR /?CCL186
SET 'PRSA,V?WALK
SET 'PRSO,DIR
SET 'P-OFLAG,FALSE-VALUE
SET 'P-WALK-DIR,DIR
SET 'AGAIN-DIR,DIR
RETURN AGAIN-DIR
?CCL140: EQUAL? WRD,W?VOLL \?CCL172
ZERO? OF-FLAG /?CTR174
EQUAL? NW,W?PERIOD,W?DANN \?CCL175
?CTR174: ICALL2 CANT-USE,PTR
RFALSE
?CCL175: SET 'OF-FLAG,FALSE-VALUE
?CND79: SET 'LW,WRD
ADD PTR,P-LEXELEN >PTR
JUMP ?PRG77
?CCL172: CALL WT?,WRD,4
ZERO? STACK \?CND79
EQUAL? VERB,ACT?SAG \?CCL180
CALL WT?,WRD,64,1
ZERO? STACK /?CCL180
EQUAL? WINNER,PLAYER \?CCL180
PRINTI "Bitte lies die Anleitung zum Spiel, um die richtige Anrede zu finden, die man f%ur andere Leute oder Biester benutzt."
CRLF
RFALSE
?CCL180: ICALL2 CANT-USE,PTR
RFALSE
?CCL83: ICALL2 UNKNOWN-WORD,PTR
RFALSE
?CCL186: ZERO? P-OFLAG /?CND187
ICALL1 ORPHAN-MERGE
?CND187: SET 'P-WALK-DIR,FALSE-VALUE
SET 'AGAIN-DIR,FALSE-VALUE
CALL1 SYNTAX-CHECK
ZERO? STACK /FALSE
CALL1 SNARF-OBJECTS
ZERO? STACK /FALSE
CALL1 MANY-CHECK
ZERO? STACK /FALSE
CALL1 TAKE-CHECK
ZERO? STACK \TRUE
RFALSE
.FUNCT STUFF:ANY:2:3,SRC,DEST,MAX,PTR,CTR,BPTR
ASSIGNED? 'MAX /?CND1
SET 'MAX,29
?CND1: SET 'PTR,P-LEXSTART
SET 'CTR,1
GETB SRC,0
PUTB DEST,0,STACK
GETB SRC,1
PUTB DEST,1,STACK
?PRG3: GET SRC,PTR
PUT DEST,PTR,STACK
MUL PTR,2
ADD STACK,2 >BPTR
GETB SRC,BPTR
PUTB DEST,BPTR,STACK
MUL PTR,2
ADD STACK,3 >BPTR
GETB SRC,BPTR
PUTB DEST,BPTR,STACK
ADD PTR,P-LEXELEN >PTR
IGRTR? 'CTR,MAX \?PRG3
RTRUE
.FUNCT INBUF-STUFF:ANY:2:2,SRC,DEST,CNT
GETB SRC,0
SUB STACK,1 >CNT
?PRG1: GETB SRC,CNT
PUTB DEST,CNT,STACK
DLESS? 'CNT,0 \?PRG1
RTRUE
.FUNCT INBUF-ADD:ANY:3:3,LEN,BEG,SLOT,DBEG,CTR,TMP,?TMP1
GET OOPS-TABLE,O-END >TMP
ZERO? TMP /?CCL3
SET 'DBEG,TMP
JUMP ?CND1
?CCL3: GET OOPS-TABLE,O-LENGTH >TMP
GETB AGAIN-LEXV,TMP >?TMP1
ADD TMP,1
GETB AGAIN-LEXV,STACK
ADD ?TMP1,STACK >DBEG
?CND1: ADD DBEG,LEN
PUT OOPS-TABLE,O-END,STACK
?PRG4: ADD DBEG,CTR >?TMP1
ADD BEG,CTR
GETB P-INBUF,STACK
PUTB OOPS-INBUF,?TMP1,STACK
INC 'CTR
EQUAL? CTR,LEN \?PRG4
PUTB AGAIN-LEXV,SLOT,DBEG
SUB SLOT,1
PUTB AGAIN-LEXV,STACK,LEN
RTRUE
.FUNCT WT?:ANY:2:3,PTR,BIT,B1,OFFS,TYP
ASSIGNED? 'B1 /?CND1
SET 'B1,5
?CND1: SET 'OFFS,P-P1OFF
GETB PTR,P-PSOFF >TYP
BTST TYP,BIT \FALSE
GRTR? B1,4 /TRUE
EQUAL? BIT,128 /TRUE
BAND TYP,P-P1BITS >TYP
EQUAL? TYP,B1 /?CND11
INC 'OFFS
?CND11: GETB PTR,OFFS
RSTACK
.FUNCT CLAUSE:ANY:3:3,PTR,VAL,WRD,OFF,NUM,ANDFLG,FIRST??,NW,LW,?TMP1
SET 'FIRST??,TRUE-VALUE
SUB P-NCN,1
MUL STACK,2 >OFF
ZERO? VAL /?CCL3
ADD P-PREP1,OFF >NUM
PUT P-ITBL,NUM,VAL
ADD NUM,1
PUT P-ITBL,STACK,WRD
ADD PTR,P-LEXELEN >PTR
JUMP ?CND1
?CCL3: INC 'P-LEN
?CND1: ZERO? P-LEN \?CND4
DEC 'P-NCN
RETURN -1
?CND4: ADD P-NC1,OFF >NUM
MUL PTR,2
ADD P-LEXV,STACK
PUT P-ITBL,NUM,STACK
GET P-LEXV,PTR
EQUAL? STACK,W?DER,W?DIE,W?DAS /?CCL7
GET P-LEXV,PTR
EQUAL? STACK,W?EIN,W?EINE,W?EINEM /?CCL7
GET P-LEXV,PTR
EQUAL? STACK,W?EINEN,W?EINER \?PRG11
?CCL7: GET P-ITBL,NUM
ADD STACK,4
PUT P-ITBL,NUM,STACK
?PRG11: DLESS? 'P-LEN,0 \?CND13
ADD NUM,1 >?TMP1
MUL PTR,2
ADD P-LEXV,STACK
PUT P-ITBL,?TMP1,STACK
RETURN -1
?CND13: GET P-LEXV,PTR >WRD
ZERO? WRD \?CTR16
CALL2 NUMBER?,PTR >WRD
ZERO? WRD /?CCL17
?CTR16: ZERO? P-LEN \?CCL22
SET 'NW,0
JUMP ?CND20
?CCL22: ADD PTR,P-LEXELEN
GET P-LEXV,STACK >NW
?CND20: EQUAL? WRD,W?UND,W?COMMA \?CCL25
SET 'ANDFLG,TRUE-VALUE
JUMP ?CND15
?CCL25: EQUAL? WRD,W?ALLES /?CTR26
EQUAL? WRD,W?EIN,W?EINE,W?EINER /?CTR26
EQUAL? WRD,W?EINEM,W?EINEN \?CCL27
?CTR26: EQUAL? NW,W?VOLL \?CND15
DEC 'P-LEN
ADD PTR,P-LEXELEN >PTR
JUMP ?CND15
?CCL27: EQUAL? WRD,W?DANN,W?PERIOD /?CTR33
CALL WT?,WRD,8
ZERO? STACK /?CCL34
GET P-ITBL,P-VERB
ZERO? STACK /?CCL34
ZERO? FIRST?? \?CCL34
?CTR33: INC 'P-LEN
ADD NUM,1 >?TMP1
MUL PTR,2
ADD P-LEXV,STACK
PUT P-ITBL,?TMP1,STACK
SUB PTR,P-LEXELEN
RSTACK
?CCL34: CALL WT?,WRD,128
ZERO? STACK /?CCL41
GRTR? P-LEN,0 \?CCL44
EQUAL? NW,W?VOLL \?CCL44
EQUAL? WRD,W?ALLES /?CCL44
EQUAL? WRD,W?EIN,W?EINE,W?EINER /?CCL44
EQUAL? WRD,W?EINEM,W?EINEN \?CND15
?CCL44: CALL WT?,WRD,32
ZERO? STACK /?CCL51
ZERO? NW /?CCL51
CALL WT?,NW,128
ZERO? STACK \?CND15
?CCL51: ZERO? ANDFLG \?CCL56
EQUAL? NW,W?ABER,W?AUSSER,W?AU%SER /?CCL56
EQUAL? NW,W?UND,W?COMMA /?CCL56
ADD NUM,1 >?TMP1
ADD PTR,2
MUL STACK,2
ADD P-LEXV,STACK
PUT P-ITBL,?TMP1,STACK
RETURN PTR
?CCL56: SET 'ANDFLG,FALSE-VALUE
JUMP ?CND15
?CCL41: ZERO? P-MERGED \?PRD62
ZERO? P-OFLAG \?PRD62
GET P-ITBL,P-VERB
ZERO? STACK /?CCL60
?PRD62: CALL WT?,WRD,32
ZERO? STACK \?CND15
CALL WT?,WRD,4
ZERO? STACK \?CND15
?CCL60: ZERO? ANDFLG /?CCL69
CALL WT?,WRD,16
ZERO? STACK \?CTR68
CALL WT?,WRD,64
ZERO? STACK /?CCL69
?CTR68: SUB PTR,4 >PTR
ADD PTR,2
PUT P-LEXV,STACK,W?DANN
ADD P-LEN,2 >P-LEN
?CND15: SET 'LW,WRD
SET 'FIRST??,FALSE-VALUE
ADD PTR,P-LEXELEN >PTR
JUMP ?PRG11
?CCL69: CALL WT?,WRD,8
ZERO? STACK \?CND15
ICALL2 CANT-USE,PTR
RFALSE
?CCL17: ICALL2 UNKNOWN-WORD,PTR
RFALSE
.FUNCT NUMBER?:ANY:1:1,PTR,CNT,BPTR,CHR,SUM,TIM,?TMP1
MUL PTR,2
ADD P-LEXV,STACK
GETB STACK,2 >CNT
MUL PTR,2
ADD P-LEXV,STACK
GETB STACK,3 >BPTR
?PRG1: DLESS? 'CNT,0 /?REP2
GETB P-INBUF,BPTR >CHR
EQUAL? CHR,58 \?CCL8
SET 'TIM,SUM
SET 'SUM,0
JUMP ?CND6
?CCL8: GRTR? SUM,10000 /FALSE
LESS? CHR,58 \FALSE
GRTR? CHR,47 \FALSE
MUL SUM,10 >?TMP1
SUB CHR,48
ADD ?TMP1,STACK >SUM
?CND6: INC 'BPTR
JUMP ?PRG1
?REP2: PUT P-LEXV,PTR,W?INTNUM
GRTR? SUM,1000 /FALSE
ZERO? TIM /?CND15
LESS? TIM,8 \?CCL21
ADD TIM,12 >TIM
JUMP ?CND19
?CCL21: GRTR? TIM,23 /FALSE
?CND19: MUL TIM,60
ADD SUM,STACK >SUM
?CND15: SET 'P-NUMBER,SUM
RETURN W?INTNUM
.FUNCT ORPHAN-MERGE:ANY:0:0,CNT,TEMP,VERB,BEG,END,ADJ,WRD,?TMP1
SET 'CNT,-1
SET 'P-OFLAG,FALSE-VALUE
GET P-ITBL,P-VERBN
GET STACK,0 >WRD
CALL WT?,WRD,64,1 >?TMP1
GET P-OTBL,P-VERB
EQUAL? ?TMP1,STACK /?CTR2
CALL WT?,WRD,32
ZERO? STACK /?CCL3
?CTR2: SET 'ADJ,TRUE-VALUE
JUMP ?CND1
?CCL3: CALL WT?,WRD,128,0
ZERO? STACK /?CND1
ZERO? P-NCN \?CND1
PUT P-ITBL,P-VERB,0
PUT P-ITBL,P-VERBN,0
ADD P-LEXV,2
PUT P-ITBL,P-NC1,STACK
ADD P-LEXV,6
PUT P-ITBL,P-NC1L,STACK
SET 'P-NCN,1
?CND1: GET P-ITBL,P-VERB >VERB
ZERO? VERB /?CCL11
ZERO? ADJ \?CCL11
GET P-OTBL,P-VERB
EQUAL? VERB,STACK \FALSE
?CCL11: EQUAL? P-NCN,2 /FALSE
GET P-OTBL,P-NC1
EQUAL? STACK,1 \?CCL18
GET P-ITBL,P-PREP1 >TEMP
GET P-OTBL,P-PREP1
EQUAL? TEMP,STACK /?CTR20
ZERO? TEMP \FALSE
?CTR20: ZERO? ADJ /?CCL26
ADD P-LEXV,2
PUT P-OTBL,P-NC1,STACK
GET P-ITBL,P-NC1L
ZERO? STACK \?CND27
ADD P-LEXV,6
PUT P-ITBL,P-NC1L,STACK
?CND27: ZERO? P-NCN \?CND24
SET 'P-NCN,1
JUMP ?CND24
?CCL26: GET P-ITBL,P-NC1
PUT P-OTBL,P-NC1,STACK
?CND24: GET P-ITBL,P-NC1L
PUT P-OTBL,P-NC1L,STACK
JUMP ?CND9
?CCL18: GET P-OTBL,P-NC2
EQUAL? STACK,1 \?CCL32
GET P-ITBL,P-PREP1 >TEMP
GET P-OTBL,P-PREP2
EQUAL? TEMP,STACK /?CTR34
ZERO? TEMP \FALSE
?CTR34: ZERO? ADJ /?CND38
ADD P-LEXV,2
PUT P-ITBL,P-NC1,STACK
GET P-ITBL,P-NC1L
ZERO? STACK \?CND38
ADD P-LEXV,6
PUT P-ITBL,P-NC1L,STACK
?CND38: GET P-ITBL,P-NC1
PUT P-OTBL,P-NC2,STACK
GET P-ITBL,P-NC1L
PUT P-OTBL,P-NC2L,STACK
SET 'P-NCN,2
JUMP ?CND9
?CCL32: ZERO? P-ACLAUSE /?CND9
EQUAL? P-NCN,1 /?CCL45
ZERO? ADJ \?CCL45
SET 'P-ACLAUSE,FALSE-VALUE
RFALSE
?CCL45: GET P-ITBL,P-NC1 >BEG
ZERO? ADJ /?CND48
ADD P-LEXV,2 >BEG
SET 'ADJ,FALSE-VALUE
?CND48: GET P-ITBL,P-NC1L >END
?PRG50: GET BEG,0 >WRD
EQUAL? BEG,END \?CCL54
ZERO? ADJ /?CCL57
ICALL2 ACLAUSE-WIN,ADJ
JUMP ?CND9
?CCL57: SET 'P-ACLAUSE,FALSE-VALUE
RFALSE
?CCL54: ZERO? ADJ \?CCL59
GETB WRD,P-PSOFF
BTST STACK,32 /?CTR58
EQUAL? WRD,W?ALLES /?CTR58
EQUAL? WRD,W?EIN,W?EINE,W?EINER /?CTR58
EQUAL? WRD,W?EINEM,W?EINEN \?CCL59
?CTR58: SET 'ADJ,WRD
?CND52: ADD BEG,P-WORDLEN >BEG
ZERO? END \?PRG50
SET 'END,BEG
SET 'P-NCN,1
SUB BEG,4
PUT P-ITBL,P-NC1,STACK
PUT P-ITBL,P-NC1L,BEG
JUMP ?PRG50
?CCL59: EQUAL? WRD,W?EIN,W?EINE,W?EINER /?CTR66
EQUAL? WRD,W?EINEM,W?EINEN \?CCL67
?CTR66: ICALL2 ACLAUSE-WIN,ADJ
JUMP ?CND9
?CCL67: GETB WRD,P-PSOFF
BTST STACK,128 \?CND52
EQUAL? WRD,P-ANAM \?CCL73
ICALL2 ACLAUSE-WIN,ADJ
JUMP ?CND9
?CCL73: ICALL1 NCLAUSE-WIN
?CND9: GET P-OVTBL,0
PUT P-VTBL,0,STACK
GETB P-OVTBL,2
PUTB P-VTBL,2,STACK
GETB P-OVTBL,3
PUTB P-VTBL,3,STACK
PUT P-OTBL,P-VERBN,P-VTBL
PUTB P-VTBL,2,0
?PRG76: IGRTR? 'CNT,P-ITBLLEN \?CCL80
SET 'P-MERGED,TRUE-VALUE
RTRUE
?CCL80: GET P-OTBL,CNT
PUT P-ITBL,CNT,STACK
JUMP ?PRG76
.FUNCT ACLAUSE-WIN:ANY:1:1,ADJ
GET P-OTBL,P-VERB
PUT P-ITBL,P-VERB,STACK
PUT P-CCTBL,CC-SBPTR,P-ACLAUSE
ADD P-ACLAUSE,1
PUT P-CCTBL,CC-SEPTR,STACK
PUT P-CCTBL,CC-DBPTR,P-ACLAUSE
ADD P-ACLAUSE,1
PUT P-CCTBL,CC-DEPTR,STACK
ICALL CLAUSE-COPY,P-OTBL,P-OTBL,ADJ
GET P-OTBL,P-NC2
ZERO? STACK /?PEN1
SET 'P-NCN,2
?PEN1: SET 'P-ACLAUSE,FALSE-VALUE
RTRUE
.FUNCT NCLAUSE-WIN:ANY:0:0
PUT P-CCTBL,CC-SBPTR,P-NC1
PUT P-CCTBL,CC-SEPTR,P-NC1L
PUT P-CCTBL,CC-DBPTR,P-ACLAUSE
ADD P-ACLAUSE,1
PUT P-CCTBL,CC-DEPTR,STACK
ICALL CLAUSE-COPY,P-ITBL,P-OTBL
GET P-OTBL,P-NC2
ZERO? STACK /?PEN1
SET 'P-NCN,2
?PEN1: SET 'P-ACLAUSE,FALSE-VALUE
RTRUE
.FUNCT WORD-PRINT:ANY:2:3,CNT,BUF,CAP?,DID-CAP
?PRG1: DLESS? 'CNT,0 /TRUE
ZERO? DID-CAP \?CCL8
ZERO? CAP? /?CCL8
SET 'DID-CAP,TRUE-VALUE
GETB P-INBUF,BUF
SUB STACK,32
PRINTC STACK
JUMP ?CND6
?CCL8: GETB P-INBUF,BUF
PRINTC STACK
?CND6: INC 'BUF
JUMP ?PRG1
.FUNCT UNKNOWN-WORD:ANY:1:1,PTR,BUF,?TMP1
PUT OOPS-TABLE,O-PTR,PTR
EQUAL? PRSA,V?SAY \?CND1
PRINTI "Hier passiert garnichts."
CRLF
RFALSE
?CND1: PRINTI "Das Wort %>"
MUL PTR,2 >BUF
ADD P-LEXV,BUF
GETB STACK,2 >?TMP1
ADD P-LEXV,BUF
GETB STACK,3
ICALL WORD-PRINT,?TMP1,STACK
PRINTI "%< kann nicht von dem Spielvokabular verstanden werden."
CRLF
SET 'QUOTE-FLAG,FALSE-VALUE
SET 'P-OFLAG,FALSE-VALUE
RETURN P-OFLAG
.FUNCT CANT-USE:ANY:1:1,PTR,BUF,?TMP1
EQUAL? PRSA,V?SAY \?CND1
PRINTI "Hier passiert garnichts."
CRLF
RFALSE
?CND1: PRINTI "Du hast das Wort %>"
MUL PTR,2 >BUF
ADD P-LEXV,BUF
GETB STACK,2 >?TMP1
ADD P-LEXV,BUF
GETB STACK,3
ICALL WORD-PRINT,?TMP1,STACK
PRINTI "%< so gebraucht, da%s ich es nicht verstehen kann."
CRLF
SET 'QUOTE-FLAG,FALSE-VALUE
SET 'P-OFLAG,FALSE-VALUE
RETURN P-OFLAG
.FUNCT SYNTAX-CHECK:ANY:0:0,SYN,LEN,NUM,OBJ,DRIVE1,DRIVE2,PREP,VERB,TMP,THE-PREP,?TMP2,?TMP1
GET P-ITBL,P-VERB >VERB
ZERO? VERB \?CND1
PRINTI "In diesem Satz fehlt das Verb!"
CRLF
RFALSE
?CND1: SUB 255,VERB
GET VERBS,STACK >SYN
GETB SYN,0 >LEN
INC 'SYN
?PRG3: GETB SYN,P-SBITS
BAND STACK,P-SONUMS >NUM
GRTR? P-NCN,NUM /?CND5
LESS? NUM,1 /?CCL9
ZERO? P-NCN \?CCL9
GET P-ITBL,P-PREP1 >PREP
ZERO? PREP /?CTR8
GETB SYN,P-SPREP1
EQUAL? PREP,STACK \?CCL9
?CTR8: SET 'DRIVE1,SYN
JUMP ?CND5
?CCL9: GETB SYN,P-SPREP1 >?TMP1
GET P-ITBL,P-PREP1
EQUAL? ?TMP1,STACK \?CND5
EQUAL? NUM,2 \?CCL18
EQUAL? P-NCN,1 \?CCL18
SET 'DRIVE2,SYN
?CND5: DLESS? 'LEN,1 \?CCL24
ZERO? DRIVE1 \?REP4
ZERO? DRIVE2 \?REP4
PRINTI "Das Spiel erkennt diesen Satz nicht."
CRLF
RFALSE
?CCL18: GETB SYN,P-SPREP2 >?TMP1
GET P-ITBL,P-PREP2
EQUAL? ?TMP1,STACK \?CND5
ICALL2 SYNTAX-FOUND,SYN
RTRUE
?CCL24: ADD SYN,P-SYNLEN >SYN
JUMP ?PRG3
?REP4: ZERO? DRIVE1 /?CCL32
SET 'GWIM-PRSO?,TRUE-VALUE
ZERO? GWIM-PRSO? /?CCL32
GETB DRIVE1,P-SFWIM1 >?TMP2
GETB DRIVE1,P-SLOC1 >?TMP1
GETB DRIVE1,P-SPREP1
CALL GWIM,?TMP2,?TMP1,STACK >OBJ
ZERO? OBJ /?CCL32
PUT P-PRSO,P-MATCHLEN,1
PUT P-PRSO,1,OBJ
CALL2 SYNTAX-FOUND,DRIVE1
RSTACK
?CCL32: ZERO? DRIVE2 /?CCL37
CALL1 SET-GWIM-PRSO?
ZERO? STACK /?CCL37
GETB DRIVE2,P-SFWIM2 >?TMP2
GETB DRIVE2,P-SLOC2 >?TMP1
GETB DRIVE2,P-SPREP2
CALL GWIM,?TMP2,?TMP1,STACK >OBJ
ZERO? OBJ /?CCL37
PUT P-PRSI,P-MATCHLEN,1
PUT P-PRSI,1,OBJ
CALL2 SYNTAX-FOUND,DRIVE2
RSTACK
?CCL37: EQUAL? VERB,ACT?FIND \?CCL42
PRINTI "Diese Frage kann nicht beantwortet werden."
CRLF
RFALSE
?CCL42: EQUAL? WINNER,PLAYER /?CCL44
CALL1 CANT-ORPHAN
RSTACK
?CCL44: ICALL ORPHAN,DRIVE1,DRIVE2
GET P-OTBL,P-VERBN >TMP
SET 'P-OFLAG,TRUE-VALUE
ZERO? DRIVE1 /?CCL47
ZERO? TMP \?CCL50
PRINTI "Was?!"
CRLF
RFALSE
?CCL50: GETB P-VTBL,2
ZERO? STACK \?CCL52
GET TMP,0
ICALL2 CAPITALIZE,STACK
JUMP ?CND48
?CCL52: GETB TMP,2 >?TMP1
GETB TMP,3
ICALL WORD-PRINT,?TMP1,STACK,TRUE-VALUE
PUTB P-VTBL,2,0
?CND48: GETB DRIVE1,P-SPREP1 >THE-PREP
CALL NON-SEP?,VERB,THE-PREP
ZERO? STACK /?CCL55
GETB DRIVE1,P-SPREP1
ICALL2 PREP-PRINT,STACK
PRINTI " was"
JUMP ?CND45
?CCL55: PRINTI " was"
GETB DRIVE1,P-SPREP1
ICALL2 PREP-PRINT,STACK
JUMP ?CND45
?CCL47: ZERO? DRIVE2 /?CCL57
PRINTI "Na ja,"
GETB DRIVE2,P-SPREP2
ICALL2 PREP-PRINT,STACK
PRINTI " was"
JUMP ?CND45
?CCL57: PRINTI "Na ja, "
ZERO? TMP \?CCL60
PRINTI "was?"
CRLF
RFALSE
?CCL60: GETB P-VTBL,2
ZERO? STACK \?CCL62
GET TMP,0
PRINTB STACK
JUMP ?CND58
?CCL62: GETB TMP,2 >?TMP1
GETB TMP,3
ICALL WORD-PRINT,?TMP1,STACK
PUTB P-VTBL,2,0
?CND58: PRINTI " was"
?CND45: PRINTC 63
CRLF
RFALSE
.FUNCT NON-SEP?:ANY:2:2,VERB,THE-PREP
EQUAL? VERB,ACT?TRINK,ACT?SPRING,ACT?GRAB /TRUE
EQUAL? VERB,ACT?ISS,ACT?TRITT,ACT?UNTERSUCH /TRUE
EQUAL? VERB,ACT?SUCH,ACT?SCHWIMM /TRUE
EQUAL? VERB,ACT?HOER \?PRD8
EQUAL? THE-PREP,W?NACH /TRUE
?PRD8: EQUAL? VERB,ACT?SCHAU \?PRD11
EQUAL? THE-PREP,W?AN \TRUE
?PRD11: EQUAL? VERB,ACT?STEIG \?PRD14
EQUAL? THE-PREP,W?AUF,W?DURCH /TRUE
?PRD14: EQUAL? VERB,ACT?GEH \FALSE
EQUAL? THE-PREP,W?DURCH,W?IN,W?AUF /TRUE
RFALSE
.FUNCT CANT-ORPHAN:ANY:0:0
PRINTI "%>Ich verstehe das nicht! Worauf beziehst du dich?%<"
CRLF
RFALSE
.FUNCT ORPHAN:ANY:2:2,D1,D2,CNT
SET 'CNT,-1
ZERO? P-MERGED \?CND1
PUT P-OCLAUSE,P-MATCHLEN,0
?CND1: GET P-VTBL,0
PUT P-OVTBL,0,STACK
GETB P-VTBL,2
PUTB P-OVTBL,2,STACK
GETB P-VTBL,3
PUTB P-OVTBL,3,STACK
?PRG3: IGRTR? 'CNT,P-ITBLLEN /?REP4
GET P-ITBL,CNT
PUT P-OTBL,CNT,STACK
JUMP ?PRG3
?REP4: EQUAL? P-NCN,2 \?CND8
PUT P-CCTBL,CC-SBPTR,P-NC2
PUT P-CCTBL,CC-SEPTR,P-NC2L
PUT P-CCTBL,CC-DBPTR,P-NC2
PUT P-CCTBL,CC-DEPTR,P-NC2L
ICALL CLAUSE-COPY,P-ITBL,P-OTBL
?CND8: LESS? P-NCN,1 /?CND10
PUT P-CCTBL,CC-SBPTR,P-NC1
PUT P-CCTBL,CC-SEPTR,P-NC1L
PUT P-CCTBL,CC-DBPTR,P-NC1
PUT P-CCTBL,CC-DEPTR,P-NC1L
ICALL CLAUSE-COPY,P-ITBL,P-OTBL
?CND10: ZERO? D1 /?CCL14
GETB D1,P-SPREP1
PUT P-OTBL,P-PREP1,STACK
PUT P-OTBL,P-NC1,1
RTRUE
?CCL14: ZERO? D2 /FALSE
GETB D2,P-SPREP2
PUT P-OTBL,P-PREP2,STACK
PUT P-OTBL,P-NC2,1
RTRUE
.FUNCT THING-PRINT:ANY:1:2,PRSO?,THE?,BEG,END
ZERO? PRSO? /?CCL3
GET P-ITBL,P-NC1 >BEG
GET P-ITBL,P-NC1L >END
JUMP ?CND1
?CCL3: GET P-ITBL,P-NC2 >BEG
GET P-ITBL,P-NC2L >END
?CND1: CALL BUFFER-PRINT,BEG,END,THE?
RSTACK
.FUNCT BUFFER-PRINT:ANY:3:3,BEG,END,CP,NOSP,WRD,FIRST??,PN,Q?,?TMP1
SET 'NOSP,TRUE-VALUE
SET 'FIRST??,TRUE-VALUE
?PRG1: EQUAL? BEG,END /TRUE
GET BEG,0 >WRD
EQUAL? WRD,W?COMMA \?CCL8
PRINTI ", "
JUMP ?CND6
?CCL8: ZERO? NOSP /?CCL10
SET 'NOSP,FALSE-VALUE
JUMP ?CND6
?CCL10: PRINTC 32
?CND6: EQUAL? WRD,W?PERIOD,W?COMMA \?CCL13
SET 'NOSP,TRUE-VALUE
JUMP ?CND3
?CCL13: EQUAL? WRD,W?MICH \?CCL15
PRINTD ME
SET 'PN,TRUE-VALUE
JUMP ?CND3
?CCL15: EQUAL? WRD,W?INTNUM \?CCL17
PRINTN P-NUMBER
SET 'PN,TRUE-VALUE
JUMP ?CND3
?CCL17: ZERO? FIRST?? /?CND18
ZERO? PN \?CND18
ZERO? CP /?CND18
PRINTI "the "
?CND18: ZERO? P-OFLAG \?CTR24
ZERO? P-MERGED /?CCL25
?CTR24: PRINTB WRD
JUMP ?CND23
?CCL25: EQUAL? WRD,W?ER,W?IHN,W?IHM \?CCL29
CALL2 ACCESSIBLE?,P-HIM-OBJECT
ZERO? STACK /?CCL29
PRINTD P-HIM-OBJECT
JUMP ?CND23
?CCL29: EQUAL? WRD,W?SIE,W?IHR \?CCL33
CALL2 ACCESSIBLE?,P-HER-OBJECT
ZERO? STACK /?CCL33
PRINTD P-HER-OBJECT
JUMP ?CND23