-
Notifications
You must be signed in to change notification settings - Fork 2
/
forth2m4.sh
1302 lines (1044 loc) · 59 KB
/
forth2m4.sh
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
#!/bin/bash
# Protection against: sed 's#^\([^;{]*\s\|^\)COLON(\([^_a-zA-Z[.ch.][.CH.]]\)#\1COLON(xxx_\2#gi'
# and then error messages for non-Czech settings
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
TMPFILE=$(mktemp)
TMPFILE2=$(mktemp)
TMPFILE3=$(mktemp)
# : new_word ... ; --> : new_word ... SEMICOLON
# / line end comment --> ;# line end comment
cat $1 | sed 's#\(\s\|^\);\(\s\|$\)#\1SEMICOLON\2#gi'| sed 's#\(\s\|^\)\\\(\s\|$\)#\1;\#\2#gi' > $TMPFILE
# ( comment1) ... ( comment2)( comment3) ... -->
# ;#( comment1)
# ...
# ;#( comment2)
# ;#( comment3)
# ...
while :
do
# [^\s] not work! --> [^[:space:]] or [^ ]
cat $TMPFILE |
sed -e 's#^\([^;{(]*\s\)(\(\s\+[^)]*\))[[:space:]]*\([^[:space:]]\+.*\)$#\1\n;\#(\2)\n\3#g' |
sed -e 's#^\([^;{(]*\s\)(\(\s\+[^)]*\))[[:space:]]*$#\1\n;\#(\2)#g' |
sed -e 's#^(\(\s\+[^)]*\))[[:space:]]*\([^[:space:]]\+.*\)$#;\#(\1)\n\2#g' |
sed -e 's#^(\(\s\+[^)]*\))[[:space:]]*$#;\#(\1)#g' > $TMPFILE2
# ( comment1 ( 5+5)) ( comment2 ( 10+10))
# sed -e 's#^\([^;{]*\s\|^\)(\(\s\+[^()]*\))\(\s\+\|$\)$#\1;\#(\2)#' |
# sed -e 's#^\([^;{]*\s\|^\)(\(\s\+[^()]*([^()]*)[^()]*\))\(\s\+\|$\)$#\1;(\2)#' |
# sed -e 's#^\([^;{]*\s\|^\)(\(\s\+[^()]*\))\s\+\([^ ].*\)$#\1;(\2)\n\3#' |
# sed -e 's#^\([^;{]*\s\|^\)(\(\s\+[^()]*([^()]*)[^()]*\))\s\+\([^ ].*\)$#\1;(\2)\n\3#' > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
# .( string) ... ." string" ... s" string"
while :
do
cat $TMPFILE |
# "... .( Hello Word)..."
sed -e 's#^\([^;{(]*\s\)\.(\s\([^)]*\))[[:space:]]*\([^[:space:]]\+.*\)$#\1\nPRINT_Z({"\2"})\n\3#g' |
# "... .( Hello Word) "
sed -e 's#^\([^;{(]*\s\)\.(\s\([^)]*\))[[:space:]]*$#\1\nPRINT_Z({"\2"})#g' |
# ".( Hello Word)..."
sed -e 's#^\.(\s\([^)]*\))[[:space:]]*\([^[:space:]]\+.*\)$#PRINT_Z({"\1"})\n\2#g' |
# ".( Hello Word) "
sed -e 's#^\.(\s\([^)]*\))[[:space:]]*$#PRINT_Z({"\1"})#g' |
sed -e 's#^\([^;{(]*\s\)\."\s\([^"]*\)"[[:space:]]*\([^[:space:]]\+.*\)$#\1\nPRINT_Z({"\2"})\n\3#g' |
sed -e 's#^\([^;{(]*\s\)\."\s\([^"]*\)"[[:space:]]*$#\1\nPRINT_Z({"\2"})#g' |
sed -e 's#^\."\s\([^"]*\)"[[:space:]]*\([^[:space:]]\+.*\)$#PRINT_Z({"\1"})\n\2#g' |
sed -e 's#^\."\s\([^"]*\)"[[:space:]]*$#PRINT_Z({"\1"})#g' |
sed -e 's#^\([^;{(]*\s\)[Ss]"\s\([^"]*\)"[[:space:]]*\([^[:space:]]\+.*\)$#\1\nSTRING_Z({"\2"})\n\3#g' |
sed -e 's#^\([^;{(]*\s\)[Ss]"\s\([^"]*\)"[[:space:]]*$#\1\nSTRING_Z({"\2"})#g' |
sed -e 's#^[Ss]"\s\([^"]*\)"[[:space:]]*\([^[:space:]]\+.*\)$#STRING_Z({"\1"})\n\2#g' |
sed -e 's#^[Ss]"\s\([^"]*\)"[[:space:]]*$#STRING_Z({"\1"})#g' > $TMPFILE2
# cat $TMPFILE |
# # s" Hello Word" whitespace EOL
# sed -e 's#^\([^;{]*\s\|^\)[Ss]"\s\([^"]*\)"\(\s\+\|$\)$#\1STRING({"\2"})#' |
# # s" Hello Word" whitespace Other Words
# sed -e 's#^\([^;{]*\s\|^\)[Ss]"\s\([^"]*\)"\s\+\([^ ].*\)$#\1STRING({"\2"})\n\3#' |
# # ." Hello Word" whitespace EOL
# sed -e 's#^\([^;{]*\s\|^\)\."\s\([^"]*\)"\(\s\+\|$\)$#\1PRINT_Z({"\2"})#' |
# # ." Hello Word" whitespace Other Words
# sed -e 's#^\([^;{]*\s\|^\)\."\s\([^"]*\)"\s\+\([^ ].*\)$#\1PRINT_Z({"\2"})\n\3#' |
# # .( Hello Word) whitespace EOL
# sed -e 's#^\([^;{]*\s\|^\)\.(\s\([^()]*\))\(\s\+\|$\)$#\1PRINT_Z({"\2"})#' |
# # .( Hel(lo) Word) whitespace EOL
# # This is probably not legal, according to https://www.tutorialspoint.com/execute_forth_online.php
# sed -e 's#^\([^;{]*\s\|^\)\.(\s\([^()]*([^()]*)[^()]*\))\(\s\+\|$\)$#\1PRINT_Z({"\2"})#' |
# # .( Hello Word) whitespace Other Words
# sed -e 's#^\([^;{]*\s\|^\)\.(\s\([^()]*\))\s\+\([^ ].*\)$#\1PRINT_Z({"\2"})\n\3#' |
# # .( Hel(lo) Word) whitespace Other Words
# # This is probably not legal, according to https://www.tutorialspoint.com/execute_forth_online.php
# sed -e 's#^\([^;{]*\s\|^\)\.(\s\([^()]*([^()]*)[^()]*\))\s\(\s*[^ ].*\)$#\1PRINT_Z({"\2"}) \3#' > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
# : name ; : name2 ;
while :
do
cat $TMPFILE | sed 's#^\([^;{]*\s\|^\):\s\+\([^ ]\+\)\([^;]\+\)\(\s\+\);\(\s\|$\)#\1\COLON(\2)\3\4SEMICOLON\5#gi' > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
# .( string )
while :
do
cat $TMPFILE | sed 's#^\([^;{]*\s\|^\):\s\+\([^ ]\+\)\([^;]\+\)\(\s\+\);\(\s\|$\)#\1\COLON(\2)\3\4SEMICOLON\5#gi' > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
if [ "$2" == "-ZXROM" ]
then
while :
do
# set -x
cat $TMPFILE |
sed 's#^\([^;{]*\s\|^\)d>f\(\s\|$\)#\1ZX48D_TO_F\2#gi' |
sed 's#^\([^;{]*\s\|^\)f>d\(\s\|$\)#\1ZX48F_TO_D\2#gi' |
sed 's#^\([^;{]*\s\|^\)s>f\(\s\|$\)#\1ZX48S_TO_F\2#gi' |
sed 's#^\([^;{]*\s\|^\)f>s\(\s\|$\)#\1ZX48F_TO_S\2#gi' |
sed 's#^\([^;{]*\s\|^\)\([+-]*[0-9]\+\)\s\+ZX48S_TO_F\(\s\|$\)#\1PUSH_ZX48S_TO_F(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)\([+]*[0-9]\+\)\s\+fpick\(\s\|$\)#\1PUSH_ZX48FPICK(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)fabs\(\s\|$\)#\1ZX48FABS\2#gi' |
sed 's#^\([^;{]*\s\|^\)f+\(\s\|$\)#\1ZX48FADD\2#gi' |
sed 's#^\([^;{]*\s\|^\)facos\(\s\|$\)#\1ZX48FACOS\2#gi' |
sed 's#^\([^;{]*\s\|^\)fasin\(\s\|$\)#\1ZX48FASIN\2#gi' |
sed 's#^\([^;{]*\s\|^\)fatan\(\s\|$\)#\1ZX48FATAN\2#gi' |
sed 's#^\([^;{]*\s\|^\)fcos\(\s\|$\)#\1ZX48FCOS\2#gi' |
sed 's#^\([^;{]*\s\|^\)fsin\(\s\|$\)#\1ZX48FSIN\2#gi' |
sed 's#^\([^;{]*\s\|^\)ftan\(\s\|$\)#\1ZX48FTAN\2#gi' |
sed 's#^\([^;{]*\s\|^\)f/\(\s\|$\)#\1ZX48FDIV\2#gi' |
sed 's#^\([^;{]*\s\|^\)f\.\(\s\|$\)#\1ZX48FDOT\2#gi' |
sed 's#^\([^;{]*\s\|^\)fdrop\(\s\|$\)#\1ZX48FDROP\2#gi' |
sed 's#^\([^;{]*\s\|^\)fdup\(\s\|$\)#\1ZX48FDUP\2#gi' |
sed 's#^\([^;{]*\s\|^\)fexp\(\s\|$\)#\1ZX48FEXP\2#gi' |
sed 's#^\([^;{]*\s\|^\)f\@\(\s\|$\)#\1ZX48FFETCH\2#gi' |
sed 's#^\([^;{]*\s\|^\)fint\(\s\|$\)#\1ZX48FINT\2#gi' |
sed 's#^\([^;{]*\s\|^\)fln\(\s\|$\)#\1ZX48FLN\2#gi' |
sed 's#^\([^;{]*\s\|^\)f\*\(\s\|$\)#\1ZX48FMUL\2#gi' |
sed 's#^\([^;{]*\s\|^\)f\*\*\(\s\|$\)#\1ZX48FMULMUL\2#gi' |
sed 's#^\([^;{]*\s\|^\)fnegate\(\s\|$\)#\1ZX48FNEGATE\2#gi' |
sed 's#^\([^;{]*\s\|^\)fover\(\s\|$\)#\1ZX48FOVER\2#gi' |
sed 's#^\([^;{]*\s\|^\)frot\(\s\|$\)#\1ZX48FROT\2#gi' |
sed 's#^\([^;{]*\s\|^\)fsqrt\(\s\|$\)#\1ZX48FSQRT\2#gi' |
sed 's#^\([^;{]*\s\|^\)f!\(\s\|$\)#\1ZX48FSTORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)f-\(\s\|$\)#\1ZX48FSUB\2#gi' |
sed 's#^\([^;{]*\s\|^\)fswap\(\s\|$\)#\1ZX48FSWAP\2#gi' |
sed 's#^\([^;{]*\s\|^\)fvariable\s\+\([^ ]\+\)\(\s\|$\)#\1FVARIABLE(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)f<=\(\s\|$\)#\1ZX48FGE\2#gi' |
sed 's#^\([^;{]*\s\|^\)f>=\(\s\|$\)#\1ZX48FLE\2#gi' |
sed 's#^\([^;{]*\s\|^\)f<>\(\s\|$\)#\1ZX48FNE\2#gi' |
sed 's#^\([^;{]*\s\|^\)f=\(\s\|$\)#\1ZX48FEQ\2#gi' |
sed 's#^\([^;{]*\s\|^\)f<\(\s\|$\)#\1ZX48FLT\2#gi' |
sed 's#^\([^;{]*\s\|^\)f>\(\s\|$\)#\1ZX48FGT\2#gi' |
sed 's#^\([^;{]*\s\|^\)f0<\(\s\|$\)#\1ZX48F0LT\2#gi' |
sed 's#^\([^;{]*\s\|^\)f0=\(\s\|$\)#\1ZX48F0EQ\2#gi' |
sed 's#^\([^;{]*\s\|^\)float+\(\s\|$\)#\1ZX48FLOATADD\2#gi' |
# +123.567e+45
# -1.567E-5
# 565e4
# -.123e+560
# \+ ...1 or more
# \? ...0 or 1
# * ...0 or more
sed 's#^\([^;{]*\s\|^\)\([+-]\?[0-9]*\.\?[0-9]\+[Ee][+-]\?[0-9]\+\)\(\s\|$\)#\1PUSH_ZX48F(\2)\3#gi' |
# +123.567e
# -1.567E
# 565e
# -.123e
sed 's#^\([^;{]*\s\|^\)\([+-]\?[0-9]*\.\?[0-9]\+[Ee]\)\(\s\|$\)#\1PUSH_ZX48F(\2+0)\3#gi' > $TMPFILE2
# set +x
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
fi
# POZOR!!! pokud ignorujeme velka a mala pismena pres parametr ...#gi
# a slovo se sklada pouze s pismen, ktera menime na velka tak tam nesmi byt to "i"
# protoze pokud je na radku vice techto slov tak to zmeni jen posledni...
# "echo "pick pick" | "sed "s#pick#PICK#gi" --> "pick PICK"
# "echo "pick pick" | "sed "s#[Pp]ick#PICK#g" --> "PICK PICK"
while :
do
cat $TMPFILE |
sed "s#^\([^;{]*\s\|^\)\[char\]\s\+\([^[:space:]]\)[^[:space:]]*\(\s\|$\)#\1PUSH(\'\2\')\3#g" |
sed 's#^\([^;{]*\s\|^\)h[Ee][Rr][Ee]\(\s\|$\)#\1HERE\2#g' |
sed 's#^\([^;{]*\s\|^\)[Hh]e[Rr][Ee]\(\s\|$\)#\1HERE\2#g' |
sed 's#^\([^;{]*\s\|^\)[Hh][Ee]r[Ee]\(\s\|$\)#\1HERE\2#g' |
sed 's#^\([^;{]*\s\|^\)[Hh][Ee][Rr]e\(\s\|$\)#\1HERE\2#g' |
sed 's#^\([^;{]*\s\|^\)\([+-]*[0-9]\+\)\s\+allot\(\s\|$\)#\1PUSH_ALLOT(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)\(0x[0-9A-F]\+\)\s\+allot\(\s\|$\)#\1PUSH_ALLOT(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\),\(\s\|$\)#\1\COMMA\2#gi' |
sed 's#^\([^;{]*\s\|^\)\([+-]*[0-9]\+\)\s\+COMMA\(\s\|$\)#\1PUSH_COMMA(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)\(0x[0-9A-F]\+\)\s\+COMMA\(\s\|$\)#\1PUSH_COMMA(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)PUSH_COMMA(\([^)]*\))\s\+PUSH_COMMA(\([^)]*\))\(\s\|$\)#\1PUSHS_COMMA(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)PUSH_COMMA(\([^)]*\))\s\+PUSHS_COMMA(\([^)]*\))\(\s\|$\)#\1PUSHS_COMMA(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)PUSHS_COMMA(\([^)]*\))\s\+PUSH_COMMA(\([^)]*\))\(\s\|$\)#\1PUSHS_COMMA(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)PUSHS_COMMA(\([^)]*\))\s\+PUSHS_COMMA(\([^)]*\))\(\s\|$\)#\1PUSHS_COMMA(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)create\s\+\([^ ]\+\)\(\s\|$\)#\1\CREATE(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\):\s\+\([^ ]\+\)\(\s\|$\)#\1\COLON(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)?\(\s\|$\)#\1!\ .\2#gi' |
# 0 = --> 0=
sed 's#^\([^;{]*\s\|^\)[-+]*[0]\+\s\+=\(\s\|$\)#\1_0EQ\2#gi' |
sed 's#^\([^;{]*\s\|^\)0=\(\s\|$\)#\1_0EQ\2#gi' |
# 0 < --> 0<
sed 's#^\([^;{]*\s\|^\)[-+]*[0]\+\s\+<\(\s\|$\)#\1_0LT\2#gi' |
sed 's#^\([^;{]*\s\|^\)0<\(\s\|$\)#\1_0LT\2#gi' |
# 0 > --> 0>
sed 's#^\([^;{]*\s\|^\)[-+]*[0]\+\s\+>=\(\s\|$\)#\1_0GE\2#gi' |
sed 's#^\([^;{]*\s\|^\)0>=\(\s\|$\)#\1_0GE\2#gi' |
sed 's#^\([^;{]*\s\|^\)[Pp]ick\(\s\|$\)#\1PICK\2#g' |
sed 's#^\([^;{]*\s\|^\)+!\(\s\|$\)#\1ADDSTORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)!\(\s\|$\)#\1STORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)TUCK\s\+STORE\(\s\|$\)#\1TUCK_STORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)TUCK_STORE\s\+_2ADD\(\s\|$\)#\1TUCK_STORE_2ADD\2#gi' |
sed 's#^\([^;{]*\s\|^\)OVER_SWAP\s\+STORE\(\s\|$\)#\1OVER_SWAP_STORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)_2DUP\s\+STORE\(\s\|$\)#\1_2DUP_STORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)_2DUP_STORE\s\+2+\(\s\|$\)#\1_2DUP_STORE_2ADD\2#gi' |
sed 's#^\([^;{]*\s\|^\)DUP\s\+\([+-]*[0-9]\+\)\s\+SWAP\s\+STORE\(\s\|$\)#\1PUSH_OVER_STORE(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)DUP\s\+\(0x[0-9A-F]\+\)\s\+SWAP\s\+STORE\(\s\|$\)#\1PUSH_OVER_STORE(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)PUSH_OVER_STORE(\([^)]\+\))\s\+2+\(\s\|$\)#\1PUSH_OVER_STORE_2ADD(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)@\(\s\|$\)#\1FETCH\2#gi' |
sed 's#^\([^;{]*\s\|^\)DUP\s\+FETCH\(\s\|$\)#\1DUP_FETCH\2#gi' |
sed 's#^\([^;{]*\s\|^\)DUP_FETCH\s\+SWAP\(\s\|$\)#\1DUP_FETCH_SWAP\2#gi' |
sed 's#^\([^;{]*\s\|^\)c!\(\s\|$\)#\1CSTORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)c@\(\s\|$\)#\1CFETCH\2#gi' |
sed 's#^\([^;{]*\s\|^\)DUP\s\+CFETCH\(\s\|$\)#\1DUP_CFETCH\2#gi' |
sed 's#^\([^;{]*\s\|^\)DUP_CFETCH\s\+SWAP\(\s\|$\)#\1DUP_CFETCH_SWAP\2#gi' |
sed 's#^\([^;{]*\s\|^\)2!\(\s\|$\)#\1_2STORE\2#gi' |
sed 's#^\([^;{]*\s\|^\)2@\(\s\|$\)#\1_2FETCH\2#gi' |
sed 's#^\([^;{]*\s\|^\)2>r\(\s\|$\)#\1_2TO_R\2#gi' |
sed 's#^\([^;{]*\s\|^\)2r>\(\s\|$\)#\1_2R_FROM\2#gi' |
sed 's#^\([^;{]*\s\|^\)2r@\(\s\|$\)#\1_2R_FETCH\2#gi' |
sed 's#^\([^;{]*\s\|^\)2[Rr][Dd]rop\(\s\|$\)#\1_2RDROP\2#g' |
sed 's#^\([^;{]*\s\|^\)>r\(\s\|$\)#\1TO_R\2#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DUP\2#gi' |
sed 's#^\([^;{]*\s\|^\)over\s\+over\(\s\|$\)#\1_2DUP\2#gi' |
sed 's#^\([^;{]*\s\|^\)[Dd]rop\(\s\|$\)#\1DROP\2#g' |
sed 's#^\([^;{]*\s\|^\)2DROP\(\s\|$\)#\1_2DROP\2#gi' |
sed 's#^\([^;{]*\s\|^\)drop\s\+drop\(\s\|$\)#\1_2DROP\2#gi' |
sed 's#^\([^;{]*\s\|^\)_2DROP\s\+drop\(\s\|$\)#\1_3DROP\2#gi' |
sed 's#^\([^;{]*\s\|^\)[Nn]ip\(\s\|$\)#\1NIP\2#g' |
sed 's#^\([^;{]*\s\|^\)swap\s\+drop\(\s\|$\)#\1NIP\2#gi' |
sed 's#^\([^;{]*\s\|^\)2NIP\(\s\|$\)#\1_2NIP\2#gi' |
sed 's#^\([^;{]*\s\|^\)_2SWAP\s\+_2DROP\(\s\|$\)#\1_2NIP\2#g' |
sed 's#^\([^;{]*\s\|^\)[Tt]uck\(\s\|$\)#\1TUCK\2#g' |
sed 's#^\([^;{]*\s\|^\)swap\s\+over\(\s\|$\)#\1TUCK\2#gi' |
sed 's#^\([^;{]*\s\|^\)2TUCK\(\s\|$\)#\1_2TUCK\2#gi' |
sed 's#^\([^;{]*\s\|^\)2swap\s\+2over\(\s\|$\)#\1_2TUCK\2#gi' |
sed 's#^\([^;{]*\s\|^\)[Oo]ver\(\s\|$\)#\1OVER\2#g' |
sed 's#^\([^;{]*\s\|^\)OVER\s\+SWAP\(\s\|$\)#\1OVER_SWAP\2#gi' |
sed 's#^\([^;{]*\s\|^\)2OVER\(\s\|$\)#\1_2OVER\2#gi' |
sed 's#^\([^;{]*\s\|^\)_2OVER\s\+_2OVER\(\s\|$\)#\1_4DUP\2#gi' |
sed 's#^\([^;{]*\s\|^\)_2OVER\s\+NIP\(\s\|$\)#\1_2OVER_NIP\2#gi' |
sed 's#^\([^;{]*\s\|^\)[+]*[0]*3\s\+PICK\s\+[+]*[0]*3\s\+PICK\s\+[+]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^ ]\+\))\(\s\|$\)#\1PUSH_VALUE(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)2value\s\+\([^ ]\+\)\(\s\|$\)#\1\DVALUE(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)\([+-]*[0-9]\+\)\.\s\+DVALUE(\([^ ]\+\))\(\s\|$\)#\1PUSHDOT_DVALUE(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)\(0x[0-9A-F]\+\)\.\s\+DVALUE(\([^ ]\+\))\(\s\|$\)#\1PUSHDOT_DVALUE(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)variable\s\+\([^ ]\+\)\(\s\|$\)#\1VARIABLE(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)2variable\s\+\([^ ]\+\)\(\s\|$\)#\1DVARIABLE(\2)\3#gi' |
sed 's#^\([^;{]*\s\|^\)[Ee]xit\(\s\|$\)#\1EXIT\2#g' |
sed 's#^\([^;{]*\s\|^\)[Ff]alse\(\s\|$\)#\1FALSE\2#g' |
sed 's#^\([^;{]*\s\|^\)[Tt]rue\(\s\|$\)#\1TRUE\2#g' |
sed 's#^\([^;{]*\s\|^\)[Ii]nvert\(\s\|$\)#\1INVERT\2#g' |
sed 's#^\([^;{]*\s\|^\)[Ww]ithin\(\s\|$\)#\1WITHIN\2#g' |
sed 's#^\([^;{]*\s\|^\)[Aa]bs\(\s\|$\)#\1ABS\2#g' |
sed 's#^\([^;{]*\s\|^\)[Xx]or\(\s\|$\)#\1XOR\2#g' |
sed 's#^\([^;{]*\s\|^\)[Oo]r\(\s\|$\)#\1OR\2#g' |
sed 's#^\([^;{]*\s\|^\)[Aa]nd\(\s\|$\)#\1AND\2#g' |
sed 's#^\([^;{]*\s\|^\)[Mm]ax\(\s\|$\)#\1MAX\2#g' |
sed 's#^\([^;{]*\s\|^\)[Mm]in\(\s\|$\)#\1MIN\2#g' |
sed 's#^\([^;{]*\s\|^\)[Nn]egate\(\s\|$\)#\1NEGAT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#^\([^;{]*\s\|^\)_2OVER\s\+NIP\s\+_2OVER\s\+NIP\s\+SWAP\(\s\|$\)#\1STACK_CBABC\2#gi' |
sed 's#^\([^;{]*\s\|^\)OVER\s\+3\s\+PICK\(\s\|$\)#\1STACK_CBABC\2#gi' |
sed 's#^\([^;{]*\s\|^\)2\s\+PICK\s\+2\s\+PICK\s\+SWAP\(\s\|$\)#\1STACK_CBABC\2#gi' |
sed 's#^\([^;{]*\s\|^\)T{\(\s\|$\)#\1TEST_START\2#gi' |
sed 's#^\([^;{]*\s\|^\)->\(\s\|$\)#\1TEST_EQ\2#gi' |
sed 's#^\([^;{]*\s\|^\)\}T\(\s\|$\)#\1TEST_END\2#gi' |
sed 's#^\([^;{]*\s\|^\)[Rr]andom\(\s\|$\)#\1RANDOM\2#g' |
sed 's#^\([^;{]*\s\|^\)[Rr]nd\(\s\|$\)#\1RND\2#g' > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
oddelovac="`printf "\a"`"
# 'x' --> 0000000000xxx
CHAR=`cat $TMPFILE | grep "^\([^;{]*\s\|^\)\('.'\)\(\s.*\|\s*\|$\)$" | sed "s%^\([^;{]*\s\|^\)\('.'\)\(\s.*\|\s*\|$\)$%\2%g"`
NUM="0"
for x in $CHAR
do
NUM="$(($NUM+1))"
name="0000000000$NUM"
while :
do
cat $TMPFILE | sed "s${oddelovac}^\([^;{]*\s\|^\)${x}\(\s\|$\)${oddelovac}\1${name}\2${oddelovac}g" > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
done
# variable --> 0000000000xxx
VAR=""
VAR="$VAR `cat $TMPFILE | grep '^\([^;{]*\s\|^\)CREATE(\([^,)]\+\)[,)].*' | sed 's#^\([^;{]*\s\|^\)CREATE(\([^,)]\+\)[,)].*#\2#g'`"
VAR="$VAR `cat $TMPFILE | grep '^\([^;{]*\s\|^\)DVARIABLE(\([^,)]\+\)[,)].*' | sed 's#^\([^;{]*\s\|^\)DVARIABLE(\([^,)]\+\)[,)].*#\2#g'`"
VAR="$VAR `cat $TMPFILE | grep '^\([^;{]*\s\|^\)VARIABLE(\([^,)]\+\)[,)].*' | sed 's#^\([^;{]*\s\|^\)VARIABLE(\([^,)]\+\)[,)].*#\2#g'`"
VAR="$VAR `cat $TMPFILE | grep '^\([^;{]*\s\|^\)CONSTANT(\([^,)]\+\)[,)].*' | sed 's#^\([^;{]*\s\|^\)CONSTANT(\([^,)]\+\)[,)].*#\2#g'`"
oddelovac="`printf "\a"`"
for x in $VAR
do
NUM="$(($NUM+1))"
name="0000000000$NUM"
while :
do
cat $TMPFILE | sed "s${oddelovac}^\([^;{]*\)(${x}\([,)]\)${oddelovac}\1(${name}\2${oddelovac}g" > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
while :
do
cat $TMPFILE | sed "s${oddelovac}^\([^;{]*\s\|^\)${x}\(\s\|$\)${oddelovac}\1${name}\2${oddelovac}g" > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
done
# value --> 0000000000xxx
VAL=""
VAL="$VAL `cat $TMPFILE | grep '^\([^;{]*\s\|^\)VALUE(\([^,)]\+\)[,)].*' | sed 's#^\([^;{]*\s\|^\)VALUE(\([^,)]\+\)[,)].*#\2#g'`"
VAL="$VAL `cat $TMPFILE | grep '^\([^;{]*\s\|^\)DVALUE(\([^,)]\+\)[,)].*' | sed 's#^\([^;{]*\s\|^\)DVALUE(\([^,)]\+\)[,)].*#\2#g'`"
VAL="$VAL `cat $TMPFILE | grep '^\([^;{]*\s\|^\)PUSH_VALUE([^,)]\+,\([_a-zA-Z][0-9_a-zA-Z]*\)).*' | sed 's#^\([^;{]*\s\|^\)PUSH_VALUE([^,)]\+,\([_a-zA-Z][0-9_a-zA-Z]*\)).*#\2#g'`"
VAL="$VAL `cat $TMPFILE | grep '^\([^;{]*\s\|^\)PUSHDOT_DVALUE([^,)]\+,\([_a-zA-Z][0-9_a-zA-Z]*\)).*' | sed 's#^\([^;{]*\s\|^\)PUSHDOT_DVALUE([^,)]\+,\([_a-zA-Z][0-9_a-zA-Z]*\)).*#\2#g'`"
oddelovac="`printf "\a"`"
for x in $VAL
do
NUM="$(($NUM+1))"
name="0000000000$NUM"
while :
do
cat $TMPFILE | sed "s${oddelovac}^\([^;{]*[(,]\)${x}\([,)]\)${oddelovac}\1${name}\2${oddelovac}g" > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
while :
do
cat $TMPFILE | sed "s${oddelovac}^\([^;{]*\s\|^\)${x}\(\s\|$\)${oddelovac}\1${name}\2${oddelovac}g" > $TMPFILE2
diff $TMPFILE $TMPFILE2 > /dev/null 2>&1
error=$?
cat $TMPFILE2 > $TMPFILE
[ $error -gt 1 ] && exit
[ $error -eq 0 ] && break
done
done
# optimize
while :
do
cat $TMPFILE |
# stupidni co nikdo neudela
sed 's#^\([^;{]*\s\|^\)SWAP\s\+SWAP\(\s\|$\)#\1\2#gi' |
sed 's#^\([^;{]*\s\|^\)DUP\s\+\([+-]*[0-9]\+\)\s\+\([+-]*[0-9]\+\)\s\+WITHIN\s\+IF\(\s\|$\)#\1DUP_PUSH2_WITHIN_IF(\2,\3)\4#gi' |
sed 's#^\([^;{]*\s\|^\)DUP\s\+\([+-]*[0-9]\+\)\s\+\([+-]*[0-9]\+\)\s\+WITHIN\s\+UNTIL\(\s\|$\)#\1DUP_PUSH2_WITHIN_UNTIL(\2,\3)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