Repository navigation
Expand file tree
/
Copy pathhs_compile.c
More file actions
3536 lines (3214 loc) · 101 KB
/
Copy pathhs_compile.c
File metadata and controls
3536 lines (3214 loc) · 101 KB
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
/*
HS_COMPILE.C
symbols in this file:
000B46B0 02c0:
_code_000b46b0 (0000)
000B4970 00b0:
_code_000b4970 (0000)
000B4A20 00b0:
_hs_compile_initialize (0000)
000B4AD0 0070:
_code_000b4ad0 (0000)
000B4B40 0030:
_hs_verify_source_offset (0000)
000B4B70 0050:
_code_000b4b70 (0000)
000B4BC0 0020:
_code_000b4bc0 (0000)
000B4BE0 0120:
_code_000b4be0 (0000)
000B4D00 00c0:
_code_000b4d00 (0000)
000B4DC0 0130:
_code_000b4dc0 (0000)
000B4EF0 00f0:
_code_000b4ef0 (0000)
000B4FE0 0120:
_code_000b4fe0 (0000)
000B5100 0080:
_code_000b5100 (0000)
000B5180 00b0:
_code_000b5180 (0000)
000B5230 00d0:
_code_000b5230 (0000)
000B5300 01d0:
_code_000b5300 (0000)
000B54D0 0100:
_code_000b54d0 (0000)
000B55D0 0070:
_code_000b55d0 (0000)
000B5640 0070:
_code_000b5640 (0000)
000B56B0 0070:
_code_000b56b0 (0000)
000B5720 0070:
_code_000b5720 (0000)
000B5790 0070:
_code_000b5790 (0000)
000B5800 0070:
_code_000b5800 (0000)
000B5870 00b0:
_code_000b5870 (0000)
000B5920 0070:
_code_000b5920 (0000)
000B5990 0070:
_code_000b5990 (0000)
000B5A00 0070:
_code_000b5a00 (0000)
000B5A70 0140:
_code_000b5a70 (0000)
000B5BB0 00a0:
_code_000b5bb0 (0000)
000B5C50 0090:
_code_000b5c50 (0000)
000B5CE0 0090:
_code_000b5ce0 (0000)
000B5D70 0060:
_code_000b5d70 (0000)
000B5DD0 0040:
_code_000b5dd0 (0000)
000B5E10 0090:
_code_000b5e10 (0000)
000B5EA0 0290:
_code_000b5ea0 (0000)
000B6130 0430:
_code_000b6130 (0000)
000B6560 00f0:
_code_000b6560 (0000)
000B6650 00f0:
_code_000b6650 (0000)
000B6740 0120:
_code_000b6740 (0000)
000B6860 0380:
_code_000b6860 (0000)
000B6BE0 02d0:
_hs_compile_postprocess (0000)
000B6EB0 00d0:
_code_000b6eb0 (0000)
000B6F80 00c0:
_code_000b6f80 (0000)
000B7040 00e0:
_code_000b7040 (0000)
000B7120 00d0:
_hs_parse (0000)
000B71F0 0120:
_hs_macro_function_parse (0000)
000B7310 01b0:
_hs_parse_begin (0000)
000B74C0 01c0:
_hs_parse_if (0000)
000B7680 00a0:
_hs_parse_cond (0000)
000B7720 0230:
_hs_parse_set (0000)
000B7950 0170:
_hs_parse_logical (0000)
000B7AC0 0190:
_hs_parse_arithmetic (0000)
000B7C50 0110:
_hs_parse_equality (0000)
000B7D60 01d0:
_hs_parse_inequality (0000)
000B7F30 00c0:
_hs_parse_sleep (0000)
000B7FF0 00e0:
_hs_parse_sleep_until (0000)
000B80D0 00d0:
_hs_parse_wake (0000)
000B81A0 00c0:
_hs_parse_inspect (0000)
000B8260 0080:
_hs_parse_object_cast_up (0000)
000B82E0 0110:
_hs_parse_debug_string (0000)
000B83F0 0260:
_hs_compile_expression (0000)
000B8650 0140:
_hs_compile (0000)
000B8790 0100:
_hs_compile_finish (0000)
000B8890 00d0:
_hs_compile_dispose (0000)
00269F98 00cc:
_whitespace_characters (0000)
_eol_characters (0004)
_hs_type_primitive_parsers (0008)
0026A064 0038:
??_C@_0DI@FFMILLMF@this?5argument?5to?5cond?5should?5be?5@ (0000)
0026A09C 0026:
??_C@_0CG@CKIGEJPJ@this?5argument?5to?5cond?5needs?5a?5re@ (0000)
0026A0C4 0023:
??_C@_0CD@IJMPPEHP@i?5couldn?8t?5allocate?5a?5syntax?5nod@ (0000)
0026A0E8 0023:
??_C@_0CD@CMPGDOHG@the?5?$CFs?5call?5requires?5?$CFd?5argument@ (0000)
0026A10C 0020:
??_C@_0CA@FLDPLDBJ@?$CBhs_compile_globals?4initialized?$AA@ (0000)
0026A12C 001f:
??_C@_0BP@MLCFIFLN@c?3?2halo?2SOURCE?2hs?2hs_compile?4c?$AA@ (0000)
0026A14C 002b:
??_C@_0CL@GBEGGBNG@bad?5source?5offset?5?$CIyou?5need?5to?5r@ (0000)
0026A178 0023:
??_C@_0CD@EFKPEBIG@this?5is?5not?5a?5valid?5variable?5nam@ (0000)
0026A19C 003f:
??_C@_0DP@PEGJCBIB@i?5expected?5a?5value?5of?5type?5?$CFs?0?5b@ (0000)
0026A1E0 0042:
??_C@_0EC@IIFEBBHH@hs_type_valid?$CIexpression?9?$DOtype?$CJ?5@ (0000)
0026A224 0020:
??_C@_0CA@DKEMPFLD@predicate?9?$DOfunction_index?$CB?$DNNONE?$AA@ (0000)
0026A244 001e:
??_C@_0BO@OIGMDMNN@i?5expected?5?$CCtrue?$CC?5or?5?$CCfalse?$CC?4?$AA@ (0000)
0026A264 0002:
??_C@_01HIHLOKLC@1?$AA@ (0000)
0026A268 0002:
??_C@_01GBGANLPD@0?$AA@ (0000)
0026A26C 002c:
??_C@_0CM@LMJJMGPB@expression?9?$DOconstant_type?$DN?$DNexpre@ (0000)
0026A298 0023:
??_C@_0CD@PDJAANOA@expression?9?$DOtype?$DN?$DN_hs_type_boole@ (0000)
0026A2BC 0021:
??_C@_0CB@OIAINLCH@this?5is?5not?5a?5valid?5real?5number?4@ (0000)
0026A2E0 0020:
??_C@_0CA@FDCELDHN@expression?9?$DOtype?$DN?$DN_hs_type_real?$AA@ (0000)
0026A300 002d:
??_C@_0CN@PNJHLLDG@shorts?5must?5be?5in?5the?5range?5?$FL?932@ (0000)
0026A330 001d:
??_C@_0BN@MIAGNDJA@this?5is?5not?5a?5valid?5integer?4?$AA@ (0000)
0026A350 0054:
??_C@_0FE@HAABGHID@expression?9?$DOtype?$DN?$DN_hs_type_short@ (0000)
0026A3A4 0022:
??_C@_0CC@NOGPGKAJ@expression?9?$DOtype?$DN?$DN_hs_type_strin@ (0000)
0026A3C8 0021:
??_C@_0CB@PILDPBCN@this?5is?5not?5a?5valid?5script?5name?4@ (0000)
0026A3EC 0022:
??_C@_0CC@LHOLJHMC@expression?9?$DOtype?$DN?$DN_hs_type_scrip@ (0000)
0026A410 002b:
??_C@_0CL@GNGCJOIJ@HS_TYPE_IS_TAG_REFERENCE?$CIexpress@ (0000)
0026A43C 0003:
??_C@_02DAHALNEP@?$CC?4?$AA@ (0000)
0026A440 0004:
??_C@_03HPAPFPCK@or?5?$AA@ (0000)
0026A444 0004:
??_C@_03HAFDNMHA@?$CC?0?5?$AA@ (0000)
0026A448 0002:
??_C@_01BJJEKLCA@?$CC?$AA@ (0000)
0026A44C 000c:
??_C@_0M@KDPMODNJ@?$CFs?5must?5be?5?$AA@ (0000)
0026A458 0017:
??_C@_0BH@KAIIDDCD@enum_definition?9?$DOcount?$AA@ (0000)
0026A470 0022:
??_C@_0CC@MAMGKIFK@HS_TYPE_IS_ENUM?$CIexpression?9?$DOtype@ (0000)
0026A494 001c:
??_C@_0BM@LLFLMGFD@this?5is?5not?5a?5valid?5?$CFs?5name?$AA@ (0000)
0026A4B0 0026:
??_C@_0CG@KJHDFGKE@offset?$CLTAG_STRING_LENGTH?$DMelement@ (0000)
0026A4D8 0018:
??_C@_0BI@DDGKIDCA@element_size?$DM?$DNSHORT_MAX?$AA@ (0000)
0026A4F0 003f:
??_C@_0DP@DDIGGJCL@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A530 003e:
??_C@_0DO@KIKHDLLO@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A570 0046:
??_C@_0EG@OIMEONBP@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A5B8 003f:
??_C@_0DP@NJJHMCPO@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A5F8 0043:
??_C@_0ED@MFJLLEIG@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A63C 003d:
??_C@_0DN@ENBCEMCP@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A67C 002b:
??_C@_0CL@GHINNEMH@this?5is?5not?5a?5valid?5ai?5encounter@ (0000)
0026A6A8 0033:
??_C@_0DD@BFEBGH@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A6E0 0040:
??_C@_0EA@CLIOJMOJ@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A720 0041:
??_C@_0EB@LFKOHNHB@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A764 003d:
??_C@_0DN@KMDNBPLF@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A7A4 0021:
??_C@_0CB@NGOPBJNH@this?5is?5not?5a?5valid?5object?5name?4@ (0000)
0026A7C8 0022:
??_C@_0CC@PHOMBDHG@this?5is?5not?5an?5object?5of?5type?5?$CFs@ (0000)
0026A7EC 0027:
??_C@_0CH@BODOHPOD@object_name?9?$DOruntime_object_type@ (0000)
0026A814 0029:
??_C@_0CJ@IEEDGBAJ@HS_TYPE_IS_OBJECT_NAME?$CIexpressio@ (0000)
0026A840 0024:
??_C@_0CE@OBCLMFIJ@HS_TYPE_IS_OBJECT?$CIexpression?9?$DOty@ (0000)
0026A864 0039:
??_C@_0DJ@MLDFNHMP@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A8A0 003c:
??_C@_0DM@NDFNDKDO@hs_syntax_get?$CIexpression_index?$CJ?9@ (0000)
0026A8DC 0027:
??_C@_0CH@KPEEOMPJ@expression?9?$DOtype?$DN?$DN_hs_type_objec@ (0000)
0026A904 0029:
??_C@_0CJ@MJLOCEH@ran?5out?5of?5script?5string?5constan@ (0000)
0026A930 0031:
??_C@_0DB@KNNKPLIC@i?5expected?5?$CIglobal?$DMtype?$DO?5?$DMname?$DO?5@ (0000)
0026A964 003b:
??_C@_0DL@HEBOLCPD@i?5expected?5a?5global?5variable?5nam@ (0000)
0026A9A0 002a:
??_C@_0CK@ILPHLOJN@there?5is?5already?5a?5variable?5by?5t@ (0000)
0026A9CC 002b:
??_C@_0CL@FLFKBOAG@i?5couldn?8t?5allocate?5space?5for?5th@ (0000)
0026A9F8 001a:
??_C@_0BK@IKPJOEIK@this?5is?5not?5a?5valid?5type?4?$AA@ (0000)
0026AA14 0032:
??_C@_0DC@LIKMAGAH@i?5expected?5?$CIscript?5?$DMtype?$DO?5?$DMname?$DO@ (0000)
0026AA48 0037:
??_C@_0DH@HLEPKBGC@i?5expected?5?$CIscript?5stub?5?$DMtype?$DO?5?$DM@ (0000)
0026AA80 0039:
??_C@_0DJ@ICFJDLL@i?5expected?5?$CIscript?5static?5?$DMtype?$DO@ (0000)
0026AABC 0032:
??_C@_0DC@KKMNLEGD@i?5expected?5a?5script?5name?5less?5th@ (0000)
0026AAF0 0040:
??_C@_0EA@JEODPONE@only?5static?5scripts?5of?5the?5same?5@ (0000)
0026AB30 001e:
??_C@_0BO@DIEOOMIB@i?5couldn?8t?5allocate?5a?5script?4?$AA@ (0000)
0026AB50 0039:
??_C@_0DJ@KPBLJMAG@i?5expected?5?$CIscript?5local?5?$DMtype?$DO?5@ (0000)
0026AB8C 0021:
??_C@_0CB@IMBMFBPE@this?5is?5not?5a?5valid?5return?5type?4@ (0000)
0026ABB0 0045:
??_C@_0EF@HPGCPNKB@script?5type?5must?5be?5?$CCstartup?$CC?0?5?$CC@ (0000)
0026ABF8 0026:
??_C@_0CG@DLDLACEH@this?5quoted?5constant?5is?5untermin@ (0000)
0026AC20 0016:
??_C@_0BG@OBOCFOLJ@unterminated?5comment?4?$AA@ (0000)
0026AC38 0032:
??_C@_0DC@DNDDDIBA@expressions?5of?5type?5?$CFs?5are?5curre@ (0000)
0026AC70 0043:
??_C@_0ED@BCCOKIBI@the?5value?5of?5this?5expression?5?$CIin@ (0000)
0026ACB4 002c:
??_C@_0CM@DJEKPL@i?5expected?5a?5script?5or?5variable?5@ (0000)
0026ACE0 0068:
??_C@_0GI@BHJPJIIC@hs_type_valid?$CIexpression?9?$DOtype?$CJ?5@ (0000)
0026AD48 0028:
??_C@_0CI@NKPOIECC@i?5expected?5?$CFs?0?5but?5i?5got?5an?5expr@ (0000)
0026AD70 0010:
??_C@_0BA@PAKINOFK@a?5function?5name?$AA@ (0000)
0026AD80 0015:
??_C@_0BF@IBMEIANF@?$CCscript?$CC?5or?5?$CCglobal?$CC?$AA@ (0000)
0026AD98 002d:
??_C@_0CN@EDPOFKO@this?5is?5not?5a?5valid?5function?5or?5@ (0000)
0026ADC8 0010:
??_C@_0BA@LKPMJEGC@function?9?$DOparse?$AA@ (0000)
0026ADD8 003d:
??_C@_0DN@MBGBMIIG@it?5is?5illegal?5to?5set?5the?5value?5o@ (0000)
0026AE18 0028:
??_C@_0CI@LEFIJLGP@it?5is?5illegal?5to?5block?5in?5this?5c@ (0000)
0026AE40 0031:
??_C@_0DB@FJPDKKBL@i?5expected?5a?5?$CFs?0?5but?5this?5functi@ (0000)
0026AE74 002f:
??_C@_0CP@EBGMPNCK@i?5expected?5a?5?$CFs?0?5but?5this?5script@ (0000)
0026AEA4 001d:
??_C@_0BN@IHENCGGJ@this?5is?5not?5a?5static?5script?4?$AA@ (0000)
0026AEC4 0021:
??_C@_0CB@IAHJHNPF@i?5expected?5?$CCscript?$CC?5or?5?$CCglobal?$CC?4@ (0000)
0026AEE8 002e:
??_C@_0CO@BFGOLJBG@missing?5type?5?$CIyou?5need?5to?5recomp@ (0000)
0026AF18 0041:
??_C@_0EB@EJKNFGEH@type?5is?5inconsistent?5with?5usage?5@ (0000)
0026AF5C 0035:
??_C@_0DF@DBAKANGN@corrupt?5syntax?5tree?5?$CIyou?5need?5to@ (0000)
0026AF94 0032:
??_C@_0DC@LGOKBIPD@missing?5function?5?$CIyou?5need?5to?5re@ (0000)
0026AFC8 002a:
??_C@_0CK@DLLKHDNE@bad?5script?5index?5?$CIyou?5need?5to?5re@ (0000)
0026AFF4 001a:
??_C@_0BK@BFLBDCPG@?$CBhs_compile_globals?4error?$AA@ (0000)
0026B010 001a:
??_C@_0BK@NAGDEHOO@this?5expression?5is?5empty?4?$AA@ (0000)
0026B02C 0024:
??_C@_0CE@GGGJMCLA@this?5left?5parenthesis?5is?5unmatch@ (0000)
0026B050 005f:
??_C@_0FP@FAMPHEFE@hs_type_valid?$CIexpected_type?$CJ?5?$HM?$HM?5@ (0000)
0026B0B0 002d:
??_C@_0CN@KIPPILAN@the?5?$CC?$CFs?$CC?5call?5requires?5exactly?5?$CF@ (0000)
0026B0E0 0027:
??_C@_0CH@HOBBAFGG@hs_type_valid?$CIdefinition?9?$DOreturn@ (0000)
0026B108 004a:
??_C@_0EK@BFPAJKIG@begin_random?5can?5take?5a?5maximum?5@ (0000)
0026B154 0036:
??_C@_0DG@ILKKMIFN@a?5statement?5block?5must?5contain?5a@ (0000)
0026B190 0050:
??_C@_0FA@MLNKNPCC@function_index?$DN?$DN_hs_function_beg@ (0000)
0026B1E0 0030:
??_C@_0DA@FDDIOHDH@c?3?2halo?2source?2hs?2hs_library_int@ (0000)
0026B210 002d:
??_C@_0CN@FFHDLAIG@i?5expected?5?$CIif?5?$DMcondition?$DO?5?$DMthen@ (0000)
0026B240 0020:
??_C@_0CA@JPNHPBMJ@function_index?$DN?$DN_hs_function_if?$AA@ (0000)
0026B260 002a:
??_C@_0CK@FOEIDHHM@i?5expected?5a?5variable?5to?5set?5and@ (0000)
0026B28C 0020:
??_C@_0CA@PGGJICDP@i?5expected?5an?5assignment?5value?4?$AA@ (0000)
0026B2AC 001f:
??_C@_0BP@FENPFJFI@i?5didn?8t?5expect?5this?5argument?4?$AA@ (0000)
0026B2CC 0025:
??_C@_0CF@JLOHFOAN@this?5is?5not?5a?5valid?5global?5varia@ (0000)
0026B2F4 0009:
??_C@_08NNEKJPJG@asserted?$AA@ (0000)
0026B300 0055:
??_C@_0FF@OKNDBCCJ@you?5cannot?5pass?5the?5result?5of?5th@ (0000)
0026B358 002b:
??_C@_0CL@HLGBMAID@the?5?$CFs?5call?5requires?5at?5least?52?5@ (0000)
0026B388 0044:
??_C@_0EE@DJKKNFEH@function_index?$DN?$DN_hs_function_and@ (0000)
0026B3CC 0024:
??_C@_0CE@JPJPEJGL@the?5?$CFs?5call?5requires?5?$CFs2?5argumen@ (0000)
0026B3F0 000a:
??_C@_09HJOCAFJB@at?5least?5?$AA@ (0000)
0026B400 0046:
??_C@_0EG@NCMDIGON@function_index?$DO?$DN_hs_function_plu@ (0000)
0026B448 004d:
??_C@_0EN@LKLJPEDN@function_index?$DN?$DN_hs_function_equ@ (0000)
0026B498 0044:
??_C@_0EE@DBJLFPAO@function_index?$DO?$DN_hs_function_gt?5@ (0000)
0026B4DC 003f:
??_C@_0DP@OBLOAKOC@the?5sleep?5call?5requires?5a?5time?5a@ (0000)
0026B51C 0023:
??_C@_0CD@OEIHEIL@function_index?$DN?$DN_hs_function_sle@ (0000)
0026B540 0045:
??_C@_0EF@ONCEJGKM@the?5sleep_until?5call?5requires?5a?5@ (0000)
0026B588 0029:
??_C@_0CJ@OOHINAAD@function_index?$DN?$DN_hs_function_sle@ (0000)
0026B5B4 0027:
??_C@_0CH@LDNCEPBK@this?5static?5script?5cannot?5be?5awa@ (0000)
0026B5DC 0022:
??_C@_0CC@MOINJLCD@function_index?$DN?$DN_hs_function_wak@ (0000)
0026B600 0048:
??_C@_0EI@PCGFDELO@this?5is?5not?5a?5global?5variable?5re@ (0000)
0026B648 0025:
??_C@_0CF@OOHBFBHF@function_index?$DN?$DN_hs_function_ins@ (0000)
0026B670 005b:
??_C@_0FL@GHADBDBJ@function_index?$DO?$DN_hs_function_obj@ (0000)
0026B6D0 0068:
??_C@_0GI@HCJMIFHN@?$CIfunction_index?$DO?$DN_hs_function_de@ (0000)
0026B738 0052:
??_C@_0FC@BMHAGKNK@hs_compile_globals?4error_offset?$DO@ (0000)
0026B78C 0023:
??_C@_0CD@IOHANEHH@hs_compile_globals?4compiled_sour@ (0000)
0026B7B0 0056:
??_C@_0FG@HHFCBJJH@global_scenario_get?$CI?$CJ?9?$DOhs_string@ (0000)
0026B808 002e:
??_C@_0CO@JFMALCKF@couldn?8t?5allocate?5memory?5for?5com@ (0000)
0026B838 0057:
??_C@_0FH@BKGDNNEC@hs_compile_globals?4error_offset?$DO@ (0000)
0026B890 0044:
??_C@_0EE@JNFGKPCH@tell?5matt?5that?5somebody?5failed?5t@ (0000)
0026B8D4 002d:
??_C@_0CN@CMJJHKPH@increase?5MAXIMUM_HS_STRING_DATA_@ (0000)
0026B904 001f:
??_C@_0BP@OAFEJCHM@hs_compile_globals?4initialized?$AA@ (0000)
00453480 012c:
_bss_00453480 (0000)
*/
/* ---------- headers */
#include "cseries/cseries.h"
#include "cache/cache_files.h"
#include "ai/ai_script.h"
#include "hs/hs.h"
#include "hs/hs_library_internal.h"
/* Empty reconstructed header removed; no declarations to include. */
#include "hs/hs_scenario_definitions.h"
#include "hs_console_state.h" /* port: port/linux/game/hs_console_state.inl */
#include "interface/hud_definitions.h"
#include "interface/interface.h"
#include "memory/data.h"
#include "scenario/scenario.h"
#include "scenario/scenario_definitions.h"
#include "mcc_script_parameters.h" /* port: port/linux/game/mcc_script_parameters.h */
#include "mcc_scripts.h" /* port: port/linux/game/mcc_scripts.h */
/* ---------- constants */
enum
{
first_hs_object_type = _hs_type_object,
first_hs_object_name_type = _hs_type_object_name,
MAXIMUM_HS_BEGIN_RANDOM_ARGUMENTS = 32,
HS_MAXIMUM_DYNAMIC_SOURCE_DATA_BYTES = 0x400,
scenario_cutscene_flag_size = 0x5C,
scenario_cutscene_title_size = 0x60,
scenario_recorded_animation_size = 0x40,
scenario_device_group_size = 0x34,
scenario_ai_command_list_size = 0x60,
scenario_conversation_size = 0x74,
hud_globals_group_tag = 'hudg',
hud_message_text_group_tag = 'hmt ',
hud_waypoint_arrow_size = 0x68,
hud_message_definition_size = 0x40,
};
enum hs_syntax_node_flag_bits
{
_hs_syntax_node_primitive_bit = 0,
_hs_syntax_node_script_bit,
_hs_syntax_node_variable_bit,
_hs_syntax_node_permanent_bit,
};
enum hs_tokenizer_state
{
_hs_tokenizer_state_normal = 0,
_hs_tokenizer_state_line_comment,
_hs_tokenizer_state_block_comment,
_hs_tokenizer_state_done,
};
/* ---------- macros */
#define hs_syntax_get(expression_index) ((struct hs_syntax_node *)datum_get(hs_syntax_data, (expression_index)))
#define hud_globals_definition_get(index) ((struct hud_globals_definition *)tag_get(hud_globals_group_tag, (index)))
#define hud_message_text_definition_get(index) ((struct hud_message_text_definition *)tag_get(hud_message_text_group_tag, (index)))
#undef HS_TYPE_IS_OBJECT
#undef HS_TYPE_IS_OBJECT_NAME
#define HS_TYPE_IS_OBJECT(type) ((type)>=first_hs_object_type && (type)<=first_hs_object_type+NUMBER_OF_HS_OBJECT_TYPES-1)
#define HS_TYPE_IS_OBJECT_NAME(type) ((type)>=first_hs_object_name_type && (type)<=first_hs_object_name_type+NUMBER_OF_HS_OBJECT_TYPES-1)
/* ---------- structures */
struct hs_compile_globals
{
boolean initialized;
byte pad001[3];
long compiled_source_size;
char *compiled_source;
char *string_constant_buffer;
long string_constant_buffer_offset;
long string_constant_buffer_size;
boolean error_since_initialize;
byte pad019[3];
char const *error;
long error_offset;
char error_buffer[256];
boolean malloced; /* port: unused console allocation flag; retain the original layout. */
boolean compiling_scenario;
boolean disallow_blocks;
boolean disallow_sets;
boolean variables_predetermined;
byte pad129[3];
};
struct hs_tokenizer
{
char *cursor;
};
typedef char verify_hs_syntax_node_size[
sizeof(struct hs_syntax_node) == 0x14 ? 1 : -1];
struct hud_message_text_definition
{
byte reserved000[0x20];
struct tag_block messages;
};
typedef boolean (*hs_primitive_parser)(
long expression_index);
typedef char verify_hs_compile_initialized_offset[
offsetof(struct hs_compile_globals, initialized) == 0x00 ? 1 : -1];
typedef char verify_hs_compile_compiled_source_size_offset[
offsetof(struct hs_compile_globals, compiled_source_size) == 0x04 ? 1 : -1];
typedef char verify_hs_compile_compiled_source_offset[
offsetof(struct hs_compile_globals, compiled_source) == 0x08 ? 1 : -1];
typedef char verify_hs_compile_string_constant_buffer_offset[
offsetof(struct hs_compile_globals, string_constant_buffer) == 0x0C ? 1 : -1];
typedef char verify_hs_compile_error_since_initialize_offset[
offsetof(struct hs_compile_globals, error_since_initialize) == 0x18 ? 1 : -1];
typedef char verify_hs_compile_error_offset[
offsetof(struct hs_compile_globals, error) == 0x1C ? 1 : -1];
typedef char verify_hs_compile_compiling_scenario_offset[
offsetof(struct hs_compile_globals, compiling_scenario) == 0x125 ? 1 : -1];
typedef char verify_hs_compile_globals_size[
sizeof(struct hs_compile_globals) == 0x12C ? 1 : -1];
/* ---------- prototypes */
static boolean hs_parse_scenario_datum(
long expression_index,
short offset,
struct tag_block *block,
long element_size);
static boolean hs_parse_trigger_volume(
long expression_index);
static boolean hs_parse_cutscene_flag(
long expression_index);
static boolean hs_parse_cutscene_camera_point(
long expression_index);
static boolean hs_parse_cutscene_title(
long expression_index);
static boolean hs_parse_cutscene_recording(
long expression_index);
static boolean hs_parse_device_group(
long expression_index);
static boolean hs_parse_ai_command_list(
long expression_index);
static boolean hs_parse_starting_profile(
long expression_index);
static boolean hs_parse_conversation(
long expression_index);
static boolean hs_parse_boolean(
long expression_index);
static boolean hs_parse_real(
long expression_index);
static boolean hs_parse_integer(
long expression_index);
static boolean hs_parse_string(
long expression_index);
static boolean hs_parse_script(
long expression_index);
static boolean hs_parse_tag_reference(
long expression_index);
static boolean hs_parse_enum(
long expression_index);
static boolean hs_parse_ai(
long expression_index);
static boolean hs_parse_object_name(
long expression_index);
static boolean hs_parse_object(
long expression_index);
static boolean hs_parse_navpoint(
long expression_index);
static boolean hs_parse_hud_message(
long expression_index);
static boolean hs_parse_object_list(
long expression_index);
static char *hs_compile_add_source(
long source_size,
char const *source);
static boolean hs_get_parameter_indices(
char const *function_name,
short parameter_count,
long *parameter_indices,
long expression_index);
static void hs_compile_finish(
void);
static long hs_find_string_constant(
char const *string);
static boolean character_in_list(
char character,
short list_count,
char const *list);
static boolean hs_parse_variable(
long expression_index);
static void hs_parse_call_predicate(
long expression_index);
static short string_list_find(
char const *string,
short list_count,
char const **list);
static long hs_concatenate_string_constant(
char const *string);
static boolean hs_add_global(
long expression_index);
static boolean hs_add_script(
long expression_index);
static void hs_tokenize_primitive(
struct hs_tokenizer *tokenizer,
long expression_index);
static void skip_whitespace(
char **cursor);
static boolean hs_parse_primitive(
long expression_index);
static boolean hs_parse_nonprimitive(
long expression_index);
static void hs_concatenate_expression(
long expression_index);
static long hs_tokenize(
struct hs_tokenizer *tokenizer);
static void hs_tokenize_nonprimitive(
struct hs_tokenizer *tokenizer,
long expression_index);
/* ---------- globals */
extern struct data_array *hs_syntax_data;
static struct hs_compile_globals hs_compile_globals;
char const whitespace_characters[2] = { ' ', '\t' };
char const eol_characters[2] = { '\n', '\r' };
hs_primitive_parser const hs_type_primitive_parsers[NUMBER_OF_HS_TYPES] =
{
NULL,
NULL,
NULL,
NULL,
NULL,
hs_parse_boolean,
hs_parse_real,
hs_parse_integer,
hs_parse_integer,
hs_parse_string,
hs_parse_script,
hs_parse_trigger_volume,
hs_parse_cutscene_flag,
hs_parse_cutscene_camera_point,
hs_parse_cutscene_title,
hs_parse_cutscene_recording,
hs_parse_device_group,
hs_parse_ai,
hs_parse_ai_command_list,
hs_parse_starting_profile,
hs_parse_conversation,
hs_parse_navpoint,
hs_parse_hud_message,
hs_parse_object_list,
hs_parse_tag_reference,
hs_parse_tag_reference,
hs_parse_tag_reference,
hs_parse_tag_reference,
hs_parse_tag_reference,
hs_parse_tag_reference,
hs_parse_tag_reference,
hs_parse_tag_reference,
hs_parse_enum,
hs_parse_enum,
hs_parse_enum,
hs_parse_enum,
hs_parse_enum,
hs_parse_object,
hs_parse_object,
hs_parse_object,
hs_parse_object,
hs_parse_object,
hs_parse_object,
hs_parse_object_name,
hs_parse_object_name,
hs_parse_object_name,
hs_parse_object_name,
hs_parse_object_name,
hs_parse_object_name,
};
/* ---------- private code */
static long hs_parse_cond_recursive(
long root_expression_index,
long expression_index)
{
long new_expression_index = datum_new(hs_syntax_data);
if (new_expression_index != NONE)
{
struct hs_syntax_node *new_expression = hs_syntax_get(new_expression_index);
new_expression->source_offset = hs_syntax_get(root_expression_index)->source_offset;
new_expression->flags = 0;
new_expression->next_node_index = NONE;
if (expression_index == NONE)
{
short root_type;
new_expression->flags = FLAG(_hs_syntax_node_primitive_bit);
root_type = hs_syntax_get(root_expression_index)->type;
new_expression->constant_type = root_type;
new_expression->type = root_type;
new_expression->data = 0;
}
else if (!TEST_FLAG(hs_syntax_get(expression_index)->flags, _hs_syntax_node_primitive_bit))
{
long condition_expression_index = hs_syntax_get(expression_index)->data;
struct hs_syntax_node *condition_expression = hs_syntax_get(condition_expression_index);
if (condition_expression->next_node_index != NONE)
{
long if_then_expression_index = datum_new(hs_syntax_data);
long then_value_expression_index = datum_new(hs_syntax_data);
if (if_then_expression_index != NONE && then_value_expression_index != NONE)
{
struct hs_syntax_node *if_then_expression = hs_syntax_get(if_then_expression_index);
struct hs_syntax_node *then_value_expression = hs_syntax_get(then_value_expression_index);
struct hs_syntax_node *expression = hs_syntax_get(expression_index);
if_then_expression->next_node_index = hs_parse_cond_recursive(
root_expression_index,
hs_syntax_get(expression_index)->next_node_index);
if (if_then_expression->next_node_index != NONE)
{
new_expression->constant_type = _hs_function_name;
new_expression->data = expression_index;
expression->data = 0;
expression->function_index = _hs_function_if;
expression->flags = FLAG(_hs_syntax_node_primitive_bit);
expression->next_node_index = condition_expression_index;
expression->source_offset = NONE;
expression->type = _hs_function_name;
if_then_expression->data = then_value_expression_index;
if_then_expression->flags = 0;
if_then_expression->source_offset = new_expression->source_offset;
then_value_expression->data = 0;
then_value_expression->function_index = _hs_function_begin;
then_value_expression->flags = FLAG(_hs_syntax_node_primitive_bit);
then_value_expression->next_node_index = hs_syntax_get(condition_expression_index)->next_node_index;
then_value_expression->source_offset = NONE;
then_value_expression->type = _hs_function_name;
condition_expression->next_node_index = if_then_expression_index;
}
else
{
new_expression_index = NONE;
}
}
else
{
hs_compile_globals.error = "i couldn't allocate a syntax node.";
hs_compile_globals.error_offset = hs_syntax_get(root_expression_index)->source_offset;
new_expression_index = NONE;
}
}
else
{
hs_compile_globals.error = "this argument to cond needs a result.";
hs_compile_globals.error_offset = hs_syntax_get(condition_expression_index)->source_offset;
new_expression_index = NONE;
}
}
else
{
hs_compile_globals.error = "this argument to cond should be a condition/result pair";
hs_compile_globals.error_offset = hs_syntax_get(expression_index)->source_offset;
new_expression_index = NONE;
}
}
else
{
hs_compile_globals.error = "i couldn't allocate a syntax node.";
hs_compile_globals.error_offset = hs_syntax_get(root_expression_index)->source_offset;
}
return new_expression_index;
}
static boolean hs_get_parameter_indices(
char const *function_name,
short parameter_count,
long *parameter_indices,
long expression_index)
{
boolean result = TRUE;
long parameter_expression_index = hs_syntax_get(hs_syntax_get(expression_index)->data)->next_node_index;
short parameter_index;
for (parameter_index = 0;
parameter_expression_index != NONE;
parameter_expression_index = hs_syntax_get(parameter_expression_index)->next_node_index,
parameter_index++)
{
if (parameter_index >= parameter_count)
break;
parameter_indices[parameter_index] = parameter_expression_index;
}
if (parameter_index != parameter_count || parameter_expression_index != NONE)
{
sprintf(
hs_compile_globals.error_buffer,
"the %s call requires %d arguments.",
function_name,
parameter_count);
hs_compile_globals.error = hs_compile_globals.error_buffer;
hs_compile_globals.error_offset = hs_syntax_get(expression_index)->source_offset;
result = FALSE;
}
return result;
}
/* ---------- public code */
void hs_compile_initialize(
boolean compiling_scenario)
{
struct scenario *scenario;
match_assert(
"c:\\halo\\SOURCE\\hs\\hs_compile.c",
0x5B,
!hs_compile_globals.initialized);
hs_compile_globals.initialized = TRUE;
hs_compile_globals.compiled_source = NULL;
hs_compile_globals.compiled_source_size = 0;
hs_compile_globals.compiling_scenario = compiling_scenario;
hs_compile_globals.error_since_initialize = FALSE;
hs_compile_globals.error = NULL;
if (compiling_scenario)
{
scenario = global_scenario_get();
tag_block_resize(&scenario->hs_scripts, 0);
tag_block_resize(&scenario->hs_globals, 0);
tag_block_resize(&scenario->hs_references, 0);
tag_data_resize(&scenario->hs_string_constants, 0);
data_delete_all(hs_syntax_data);
}
return;
}
void hs_compile_dispose(
void)
{
match_assert(
"c:\\halo\\SOURCE\\hs\\hs_compile.c",
0x75,
hs_compile_globals.initialized);
if (hs_compile_globals.compiling_scenario)
{
if (!hs_compile_globals.error_since_initialize)
{
hs_compile_finish();
}
else
{
struct scenario *scenario = global_scenario_get();
tag_block_resize(&scenario->hs_scripts, 0);
tag_block_resize(&scenario->hs_globals, 0);
tag_data_resize(&scenario->hs_string_constants, 0);
data_delete_all(hs_syntax_data);
}
if (hs_compile_globals.compiled_source)
{
match_free(
"c:\\halo\\SOURCE\\hs\\hs_compile.c",
0x87,
hs_compile_globals.compiled_source);
}
}
/* port: console source belongs to hs_console_state, not this compiler. */
hs_compile_globals.initialized = FALSE;
return;
}
long hs_compile_expression(
long source_size,
char const *source,
char const **error_message,
char const **error_source)
{
struct hs_tokenizer tokenizer;
long expression_index;
long begin_expression_index;
long root_expression_index;
long source_offset;
long result = NONE;
if (source_size < HS_MAXIMUM_DYNAMIC_SOURCE_DATA_BYTES)
{
/* port: a later command must not overwrite a sleeping command's
strings; this bounded storage is restored with its saved threads. */
source_offset = 0;
hs_compile_globals.compiled_source = hs_console_source_acquire(source_size);
if (!hs_compile_globals.compiled_source)
{
*error_message = "console text storage is full or unavailable; finish pending commands or release string globals.";
*error_source = source;
return NONE;
}
memcpy(hs_compile_globals.compiled_source + source_offset, source, source_size);
hs_compile_globals.compiled_source_size = source_offset + source_size;
hs_compile_globals.compiled_source[hs_compile_globals.compiled_source_size] = 0;
tokenizer.cursor = hs_compile_globals.compiled_source + source_offset;
hs_compile_globals.error = NULL;
*error_message = NULL;
*error_source = NULL;
hs_compile_globals.error_offset = NONE;
skip_whitespace(&tokenizer.cursor);
if (*tokenizer.cursor)
{
expression_index = hs_tokenize(&tokenizer);
if (!hs_compile_globals.error)
{
root_expression_index = datum_new(hs_syntax_data);
begin_expression_index = datum_new(hs_syntax_data);
if (root_expression_index != NONE && begin_expression_index != NONE)
{
struct hs_syntax_node *root_expression = hs_syntax_get(root_expression_index);
struct hs_syntax_node *begin_expression = hs_syntax_get(begin_expression_index);
root_expression->data = begin_expression_index;
root_expression->next_node_index = NONE;
root_expression->source_offset = hs_syntax_get(expression_index)->source_offset;
root_expression->flags = 0;
begin_expression->next_node_index = expression_index;
begin_expression->source_offset = NONE;
begin_expression->function_index = _hs_function_inspect;
begin_expression->flags = FLAG(_hs_syntax_node_primitive_bit);
begin_expression->type = _hs_function_name;
if (hs_parse(root_expression_index, _hs_type_void))
result = root_expression_index;
}
}
if (result == NONE)
{
*error_message = hs_compile_globals.error;
if (hs_compile_globals.error_offset != NONE)
{
hs_compile_globals.error_offset -= source_offset;
match_assert(
"c:\\halo\\SOURCE\\hs\\hs_compile.c",
0xEB,
hs_compile_globals.error_offset>=0 && hs_compile_globals.error_offset<source_size);
*error_source = source + hs_compile_globals.error_offset;
}
}
}
/* port: the root keeps its text until the command and its values end. */
hs_console_source_finish(hs_compile_globals.compiled_source, result);
}
return result;
}
/* ---------- private code */
static char *hs_compile_add_source(
long source_size,
char const *source)
{
char *result = NULL;
char *compiled_source = match_realloc(
"c:\\halo\\SOURCE\\hs\\hs_compile.c",
0xFD,
hs_compile_globals.compiled_source,
hs_compile_globals.compiled_source_size + source_size + 1);
if (compiled_source)
{
hs_compile_globals.compiled_source = compiled_source;
result = compiled_source + hs_compile_globals.compiled_source_size;
memcpy(result, source, source_size);
hs_compile_globals.compiled_source_size += source_size;
hs_compile_globals.compiled_source[hs_compile_globals.compiled_source_size] = 0;
}
return result;
}