summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/rgbparser.tcl
blob: 686f53660e2be22f4d2b70a89b874fbbece0e027 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
package provide DS9 1.0

######
# Begin autogenerated taccle (version 1.3) routines.
# Although taccle itself is protected by the GNU Public License (GPL)
# all user-supplied functions are protected by their respective
# author's license.  See http://mini.net/tcl/taccle for other details.
######

namespace eval rgb {
    variable yylval {}
    variable table
    variable rules
    variable token {}
    variable yycnt 0
    variable yyerr 0
    variable save_state 0

    namespace export yylex
}

proc rgb::YYABORT {} {
    return -code return 1
}

proc rgb::YYACCEPT {} {
    return -code return 0
}

proc rgb::YYERROR {} {
    variable yyerr
    set yyerr 1
}

proc rgb::yyclearin {} {
    variable token
    variable yycnt
    set token {}
    incr yycnt -1
}

proc rgb::yyerror {s} {
    puts stderr $s
}

proc rgb::setupvalues {stack pointer numsyms} {
    upvar 1 1 y
    set y {}
    for {set i 1} {$i <= $numsyms} {incr i} {
        upvar 1 $i y
        set y [lindex $stack $pointer]
        incr pointer
    }
}

proc rgb::unsetupvalues {numsyms} {
    for {set i 1} {$i <= $numsyms} {incr i} {
        upvar 1 $i y
        unset y
    }
}

array set rgb::table {
  21:289 reduce
  23:286,target 58
  60:290 reduce
  59:290 reduce
  30:290,target 6
  29:290,target 5
  27:0 reduce
  9:302,target 7
  48:0 reduce
  0:296,target 3
  30:290 reduce
  29:290 reduce
  9:302 shift
  18:289,target 56
  5:305,target 22
  9:294 shift
  6:0,target 39
  8:266,target 34
  17:285,target 57
  24:288,target 59
  9:299 shift
  56:0,target 32
  53:289,target 60
  53:290,target 28
  38:290 reduce
  24:0 reduce
  23:284,target 58
  48:0,target 24
  41:0,target 17
  45:0 reduce
  33:0,target 9
  9:314 goto
  25:0,target 1
  0:294,target 1
  17:0,target 57
  42:290,target 18
  10:0,target 0
  18:287,target 56
  47:290 reduce
  17:284 reduce
  5:303,target 20
  5:293,target 17
  17:285 reduce
  8:264,target 32
  17:286 reduce
  24:286,target 57
  17:287 reduce
  4:288,target 47
  31:290,target 7
  17:288 reduce
  21:0 reduce
  17:289 reduce
  53:287,target 58
  56:290 reduce
  42:0 reduce
  20:289,target 54
  19:289,target 50
  0:302,target 7
  8:283,target 51
  63:0 reduce
  6:290 reduce
  26:290 reduce
  18:285,target 56
  5:291,target 15
  8:262,target 30
  54:290,target 63
  24:284,target 55
  4:286,target 47
  17:0 reduce
  53:285,target 56
  14:288,target 49
  38:0 reduce
  35:290 reduce
  43:290,target 19
  60:0 reduce
  59:0 reduce
  20:287,target 54
  19:287,target 50
  0:300,target 5
  0:290,target 38
  3:0,target 40
  8:281,target 49
  61:0,target 43
  53:0,target 28
  44:290 reduce
  32:290,target 8
  14:284 reduce
  8:259,target 27
  8:260,target 28
  45:0,target 21
  14:285 reduce
  9:314,target 53
  37:0,target 13
  14:286 reduce
  14:0 reduce
  4:284,target 47
  53:284 shift
  30:0,target 6
  29:0,target 5
  14:287 reduce
  53:285 shift
  22:0,target 51
  14:288 reduce
  8:309,target 52
  53:286 shift
  35:0 reduce
  14:289 reduce
  14:286,target 49
  14:0,target 49
  53:287 shift
  21:289,target 55
  53:288 shift
  56:0 reduce
  53:289 shift
  53:290 reduce
  23:284 reduce
  23:285 reduce
  20:285,target 54
  19:285,target 50
  8:278,target 46
  23:286 reduce
  23:287 reduce
  3:290 reduce
  23:288 reduce
  55:290,target 29
  23:289 reduce
  8:257,target 25
  11:0 reduce
  62:290 reduce
  15:288,target 53
  53:310 goto
  2:294,target 1
  32:0 reduce
  44:290,target 20
  14:284,target 49
  8:257 shift
  21:287,target 55
  1:290,target 48
  1:289,target 48
  8:258 shift
  53:0 reduce
  32:290 reduce
  8:259 shift
  8:260 shift
  5:315,target 24
  8:261 shift
  8:262 shift
  8:276,target 44
  8:263 shift
  33:290,target 9
  8:264 shift
  8:265 shift
  6:0 reduce
  8:266 shift
  53:310,target 62
  8:267 shift
  41:290 reduce
  8:268 shift
  9:299,target 4
  15:286,target 53
  8:269 shift
  8:270 shift
  28:0 reduce
  22:289,target 51
  2:302,target 7
  7:0,target 46
  8:271 shift
  0:314,target 12
  0:0,target 38
  8:272 shift
  8:273 shift
  50:0 reduce
  49:0 reduce
  21:285,target 55
  1:287,target 48
  8:274 shift
  11:290 reduce
  8:275 shift
  57:0,target 30
  8:276 shift
  50:290 reduce
  50:0,target 26
  49:290 reduce
  49:0,target 25
  20:284 reduce
  19:284 reduce
  8:274,target 42
  8:277 shift
  11:290,target 36
  56:290,target 32
  42:0,target 18
  20:285 reduce
  19:285 reduce
  8:278 shift
  34:0,target 10
  20:286 reduce
  19:286 reduce
  8:279 shift
  8:280 shift
  26:0,target 2
  20:287 reduce
  19:287 reduce
  0:300 shift
  0:290 reduce
  3:0 reduce
  8:281 shift
  20:288 reduce
  19:288 reduce
  18:0,target 56
  16:288,target 52
  0:301 shift
  8:282 shift
  20:289 reduce
  19:289 reduce
  0:302 shift
  8:283 shift
  11:0,target 35
  45:290,target 21
  25:0 reduce
  15:284,target 53
  0:294 shift
  58:290 reduce
  22:287,target 51
  0:295 shift
  11:312 goto
  0:296 shift
  46:0 reduce
  0:307 shift
  1:285,target 48
  0:308 shift
  5:257 shift
  0:299 shift
  7:288,target 46
  34:290,target 10
  28:290 reduce
  0:311 goto
  8:272,target 40
  0:313 goto
  0:314 goto
  0:0 reduce
  16:286,target 52
  23:289,target 58
  22:0 reduce
  8:309 goto
  37:290 reduce
  22:285,target 51
  43:0 reduce
  0:299,target 4
  12:290,target 41
  57:290,target 30
  7:286,target 46
  5:298,target 19
  8:269,target 37
  8:270,target 38
  46:290 reduce
  17:288,target 57
  16:284 reduce
  16:285 reduce
  16:286 reduce
  4:0,target 47
  46:290,target 22
  16:287 reduce
  16:284,target 52
  23:287,target 58
  18:0 reduce
  16:288 reduce
  3:290,target 40
  16:289 reduce
  62:0,target 45
  40:0 reduce
  39:0 reduce
  55:290 reduce
  46:0,target 22
  0:307,target 8
  38:0,target 14
  35:290,target 11
  61:0 reduce
  31:0,target 7
  23:0,target 58
  7:284,target 46
  15:0,target 53
  5:291 shift
  5:306,target 23
  25:290 reduce
  5:292 shift
  8:267,target 35
  17:286,target 57
  5:303 shift
  5:293 shift
  24:289,target 60
  24:290,target 28
  5:304 shift
  2:314,target 13
  5:305 shift
  15:0 reduce
  5:306 shift
  23:285,target 58
  5:297 shift
  5:298 shift
  36:0 reduce
  34:290 reduce
  13:290,target 42
  58:290,target 33
  0:295,target 2
  11:312,target 54
  57:0 reduce
  18:288,target 56
  5:315 goto
  5:304,target 21
  8:265,target 33
  47:290,target 23
  17:284,target 57
  43:290 reduce
  24:287,target 58
  4:289,target 47
  4:290,target 47
  12:0 reduce
  53:288,target 59
  33:0 reduce
  36:290,target 12
  13:290 reduce
  52:290 reduce
  22:284 reduce
  22:285 reduce
  22:286 reduce
  18:286,target 56
  1:0,target 48
  25:290,target 1
  22:287 reduce
  5:292,target 16
  22:288 reduce
  8:263,target 31
  22:289 reduce
  2:302 shift
  7:0 reduce
  58:0,target 33
  24:285,target 56
  4:287,target 47
  51:0,target 27
  2:299,target 4
  2:294 shift
  61:290 reduce
  43:0,target 19
  53:286,target 57
  35:0,target 11
  30:0 reduce
  29:0 reduce
  14:289,target 49
  60:290,target 34
  59:290,target 31
  27:0,target 3
  20:0,target 54
  19:0,target 50
  51:0 reduce
  2:299 shift
  12:0,target 41
  31:290 reduce
  20:288,target 54
  19:288,target 50
  0:301,target 6
  8:282,target 50
  48:290,target 24
  18:284,target 56
  2:314 goto
  4:0 reduce
  8:261,target 29
  4:285,target 47
  40:290 reduce
  39:290 reduce
  37:290,target 13
  26:0 reduce
  53:284,target 55
  14:287,target 49
  47:0 reduce
  20:286,target 54
  19:286,target 50
  8:279,target 47
  8:280,target 48
  26:290,target 2
  48:290 reduce
  18:284 reduce
  18:285 reduce
  18:286 reduce
  1:0 reduce
  18:287 reduce
  8:258,target 26
  18:288 reduce
  18:289 reduce
  15:289,target 53
  61:290,target 43
  23:0 reduce
  7:284 reduce
  7:285 reduce
  57:290 reduce
  14:285,target 49
  7:286 reduce
  44:0 reduce
  21:288,target 55
  7:287 reduce
  7:288 reduce
  7:289 reduce
  7:290 reduce
  50:290,target 26
  49:290,target 25
  20:284,target 54
  19:284,target 50
  8:277,target 45
  63:0,target 37
  27:290 reduce
  6:290,target 39
  55:0,target 29
  24:310,target 61
  47:0,target 23
  40:0,target 16
  39:0,target 15
  32:0,target 8
  38:290,target 14
  24:0,target 28
  20:0 reduce
  19:0 reduce
  16:0,target 52
  15:287,target 53
  36:290 reduce
  41:0 reduce
  21:286,target 55
  1:288,target 48
  27:290,target 3
  62:0 reduce
  8:275,target 43
  45:290 reduce
  15:284 reduce
  16:289,target 52
  15:285 reduce
  62:290,target 45
  15:286 reduce
  16:0 reduce
  15:287 reduce
  15:288 reduce
  15:285,target 53
  22:288,target 51
  15:289 reduce
  37:0 reduce
  0:313,target 11
  4:284 reduce
  4:285 reduce
  54:290 shift
  51:290,target 27
  24:284 shift
  21:284,target 55
  1:286,target 48
  4:286 reduce
  58:0 reduce
  24:285 shift
  4:287 reduce
  7:289,target 46
  7:290,target 46
  24:286 shift
  4:288 reduce
  24:287 shift
  4:289 reduce
  4:290 reduce
  8:273,target 41
  24:288 shift
  24:289 shift
  24:290 reduce
  40:290,target 16
  39:290,target 15
  16:287,target 52
  13:0 reduce
  34:0 reduce
  22:286,target 51
  28:290,target 4
  0:311,target 10
  60:0,target 34
  59:0,target 31
  33:290 reduce
  55:0 reduce
  52:0,target 44
  24:310 goto
  1:284,target 48
  44:0,target 20
  7:287,target 46
  36:0,target 12
  28:0,target 4
  8:271,target 39
  21:0,target 55
  17:289,target 57
  13:0,target 42
  42:290 reduce
  16:285,target 52
  10:0 accept
  23:288,target 58
  9:294,target 1
  31:0 reduce
  52:290,target 44
  22:284,target 51
  0:308,target 9
  5:257,target 14
  12:290 reduce
  52:0 reduce
  1:284 reduce
  1:285 reduce
  51:290 reduce
  21:284 reduce
  1:286 reduce
  7:285,target 46
  21:285 reduce
  1:287 reduce
  5:297,target 18
  41:290,target 17
  21:286 reduce
  1:288 reduce
  8:268,target 36
  21:287 reduce
  17:287,target 57
  1:290 reduce
  1:289 reduce
  21:288 reduce
}

array set rgb::rules {
  9,l 309
  11,l 309
  32,l 310
  53,l 315
  6,l 309
  28,l 310
  50,l 315
  49,l 315
  3,l 309
  25,l 309
  46,l 314
  0,l 316
  22,l 309
  43,l 313
  18,l 309
  40,l 313
  39,l 313
  15,l 309
  36,l 312
  57,l 315
  12,l 309
  33,l 310
  54,l 315
  7,l 309
  29,l 310
  30,l 310
  51,l 315
  4,l 309
  26,l 309
  47,l 314
  1,l 309
  23,l 309
  44,l 313
  19,l 309
  20,l 309
  41,l 313
  16,l 309
  37,l 311
  58,l 315
  13,l 309
  34,l 310
  55,l 315
  8,l 309
  10,l 309
  31,l 310
  52,l 315
  5,l 309
  27,l 309
  48,l 314
  2,l 309
  24,l 309
  45,l 313
  21,l 309
  42,l 313
  17,l 309
  38,l 313
  14,l 309
  35,l 311
  56,l 315
}

array set rgb::rules {
  12,dc 1
  26,dc 1
  3,dc 1
  41,dc 1
  55,dc 1
  18,dc 1
  33,dc 1
  9,dc 1
  47,dc 1
  11,dc 1
  25,dc 1
  2,dc 1
  40,dc 1
  39,dc 1
  54,dc 1
  17,dc 1
  32,dc 1
  8,dc 1
  46,dc 1
  10,dc 1
  24,dc 1
  1,dc 1
  38,dc 0
  53,dc 1
  16,dc 1
  31,dc 1
  7,dc 1
  45,dc 3
  23,dc 1
  0,dc 1
  37,dc 3
  52,dc 1
  15,dc 1
  29,dc 1
  30,dc 1
  6,dc 1
  44,dc 2
  58,dc 1
  22,dc 1
  36,dc 0
  51,dc 1
  14,dc 1
  28,dc 0
  5,dc 1
  43,dc 3
  57,dc 1
  21,dc 1
  35,dc 1
  50,dc 1
  49,dc 1
  13,dc 1
  27,dc 1
  4,dc 1
  42,dc 2
  56,dc 1
  19,dc 1
  20,dc 1
  34,dc 1
  48,dc 1
}

array set rgb::rules {
  41,line 148
  7,line 110
  37,line 142
  4,line 107
  34,line 138
  1,line 104
  31,line 135
  27,line 130
  24,line 127
  21,line 124
  17,line 120
  14,line 117
  11,line 114
  56,line 167
  36,e 1
  53,line 164
  50,line 161
  49,line 160
  46,line 155
  43,line 150
  9,line 112
  40,line 147
  39,line 146
  6,line 109
  36,line 141
  3,line 106
  33,line 137
  29,line 133
  30,line 134
  26,line 129
  23,line 126
  19,line 122
  20,line 123
  16,line 119
  13,line 116
  10,line 113
  58,line 169
  55,line 166
  52,line 163
  48,line 157
  45,line 152
  42,line 149
  8,line 111
  38,line 145
  5,line 108
  35,line 141
  2,line 105
  32,line 136
  28,line 132
  25,line 128
  22,line 125
  18,line 121
  15,line 118
  12,line 115
  57,line 168
  54,line 165
  51,line 162
  47,line 156
  44,line 151
}

array set rgb::lr1_table {
  66,trans {}
  35 {{11 {0 290} 1}}
  14,trans {}
  36 {{12 {0 290} 1}}
  33,trans {}
  37 {{13 {0 290} 1}}
  52,trans {}
  38 {{14 {0 290} 1}}
  40 {{16 {0 290} 1}}
  39 {{15 {0 290} 1}}
  18,trans {}
  41 {{17 {0 290} 1}}
  1,trans {}
  37,trans {}
  42 {{18 {0 290} 1}}
  56,trans {{284 58} {285 59} {286 60} {287 61} {288 62} {289 63} {310 65}}
  43 {{19 {0 290} 1}}
  44 {{20 {0 290} 1}}
  23,trans {}
  45 {{21 {0 290} 1}}
  5,trans {{257 14} {291 15} {292 16} {293 17} {297 18} {298 19} {303 20} {304 21} {305 22} {306 23} {315 24}}
  42,trans {}
  46 {{22 {0 290} 1}}
  61,trans {}
  47 {{23 {0 290} 1}}
  48 {{24 {0 290} 1}}
  27,trans {}
  9,trans {{294 53} {299 54} {302 55} {314 56}}
  50 {{26 {0 290} 1}}
  49 {{25 {0 290} 1}}
  46,trans {}
  51 {{27 {0 290} 1}}
  65,trans {}
  52 {{44 {0 290} 2}}
  13,trans {}
  53 {{48 {0 284 285 286 287 288 289} 1}}
  32,trans {}
  54 {{47 {0 284 285 286 287 288 289} 1}}
  51,trans {}
  55 {{46 {0 284 285 286 287 288 289} 1}}
  56 {{45 {0 290} 2} {28 {0 290} 0} {29 {0 290} 0} {30 {0 290} 0} {31 {0 290} 0} {32 {0 290} 0} {33 {0 290} 0} {34 {0 290} 0}}
  17,trans {}
  57 {{37 0 2}}
  0,trans {{294 1} {295 2} {296 3} {299 4} {300 5} {301 6} {302 7} {307 8} {308 9} {311 10} {313 11} {314 12}}
  36,trans {}
  58 {{29 {0 290} 1}}
  55,trans {}
  60 {{30 {0 290} 1}}
  59 {{32 {0 290} 1}}
  61 {{33 {0 290} 1}}
  62 {{31 {0 290} 1}}
  22,trans {}
  4,trans {}
  41,trans {}
  63 {{34 {0 290} 1}}
  60,trans {}
  59,trans {}
  64 {{43 {0 290} 3}}
  65 {{45 {0 290} 3}}
  66 {{37 0 3}}
  26,trans {}
  8,trans {{257 25} {258 26} {259 27} {260 28} {261 29} {262 30} {263 31} {264 32} {265 33} {266 34} {267 35} {268 36} {269 37} {270 38} {271 39} {272 40} {273 41} {274 42} {275 43} {276 44} {277 45} {278 46} {279 47} {280 48} {281 49} {282 50} {283 51} {309 52}}
  45,trans {}
  64,trans {}
  12,trans {}
  31,trans {}
  50,trans {}
  49,trans {}
  16,trans {}
  35,trans {}
  54,trans {}
  21,trans {}
  3,trans {}
  40,trans {}
  39,trans {}
  58,trans {}
  10 {{0 0 1}}
  11 {{35 0 1} {37 0 1} {36 290 0}}
  25,trans {}
  12 {{41 {0 290} 1}}
  7,trans {}
  44,trans {}
  13 {{42 {0 290} 2}}
  63,trans {}
  14 {{49 {0 284 285 286 287 288 289} 1}}
  11,trans {{312 57}}
  15 {{53 {0 284 285 286 287 288 289} 1}}
  30,trans {}
  29,trans {}
  16 {{52 {0 284 285 286 287 288 289} 1}}
  48,trans {}
  0 {{0 0 0} {35 0 0} {37 0 0} {38 {0 290} 0} {39 {0 290} 0} {40 {0 290} 0} {41 {0 290} 0} {42 {0 290} 0} {43 {0 290} 0} {44 {0 290} 0} {45 {0 290} 0} {46 {0 290} 0} {47 {0 290} 0} {48 {0 290} 0}}
  17 {{57 {0 284 285 286 287 288 289} 1}}
  1 {{48 {0 290} 1}}
  18 {{56 {0 284 285 286 287 288 289} 1}}
  15,trans {}
  2 {{42 {0 290} 1} {46 {0 290} 0} {47 {0 290} 0} {48 {0 290} 0}}
  19 {{50 {0 284 285 286 287 288 289} 1}}
  20 {{54 {0 284 285 286 287 288 289} 1}}
  34,trans {}
  3 {{40 {0 290} 1}}
  21 {{55 {0 284 285 286 287 288 289} 1}}
  53,trans {}
  4 {{47 {0 290} 1}}
  22 {{51 {0 284 285 286 287 288 289} 1}}
  5 {{43 {0 290} 1} {49 {0 284 285 286 287 288 289} 0} {50 {0 284 285 286 287 288 289} 0} {51 {0 284 285 286 287 288 289} 0} {52 {0 284 285 286 287 288 289} 0} {53 {0 284 285 286 287 288 289} 0} {54 {0 284 285 286 287 288 289} 0} {55 {0 284 285 286 287 288 289} 0} {56 {0 284 285 286 287 288 289} 0} {57 {0 284 285 286 287 288 289} 0} {58 {0 284 285 286 287 288 289} 0}}
  23 {{58 {0 284 285 286 287 288 289} 1}}
  20,trans {}
  19,trans {}
  6 {{39 {0 290} 1}}
  2,trans {{294 1} {299 4} {302 7} {314 13}}
  24 {{43 {0 290} 2} {28 {0 290} 0} {29 {0 290} 0} {30 {0 290} 0} {31 {0 290} 0} {32 {0 290} 0} {33 {0 290} 0} {34 {0 290} 0}}
  38,trans {}
  7 {{46 {0 290} 1}}
  25 {{1 {0 290} 1}}
  57,trans {{290 66}}
  8 {{44 {0 290} 1} {1 {0 290} 0} {2 {0 290} 0} {3 {0 290} 0} {4 {0 290} 0} {5 {0 290} 0} {6 {0 290} 0} {7 {0 290} 0} {8 {0 290} 0} {9 {0 290} 0} {10 {0 290} 0} {11 {0 290} 0} {12 {0 290} 0} {13 {0 290} 0} {14 {0 290} 0} {15 {0 290} 0} {16 {0 290} 0} {17 {0 290} 0} {18 {0 290} 0} {19 {0 290} 0} {20 {0 290} 0} {21 {0 290} 0} {22 {0 290} 0} {23 {0 290} 0} {24 {0 290} 0} {25 {0 290} 0} {26 {0 290} 0} {27 {0 290} 0}}
  26 {{2 {0 290} 1}}
  9 {{45 {0 290} 1} {46 {0 284 285 286 287 288 289} 0} {47 {0 284 285 286 287 288 289} 0} {48 {0 284 285 286 287 288 289} 0}}
  27 {{3 {0 290} 1}}
  24,trans {{284 58} {285 59} {286 60} {287 61} {288 62} {289 63} {310 64}}
  6,trans {}
  28 {{4 {0 290} 1}}
  43,trans {}
  29 {{5 {0 290} 1}}
  30 {{6 {0 290} 1}}
  62,trans {}
  31 {{7 {0 290} 1}}
  10,trans {}
  32 {{8 {0 290} 1}}
  28,trans {}
  33 {{9 {0 290} 1}}
  47,trans {}
  34 {{10 {0 290} 1}}
}

array set rgb::token_id_table {
  286 ON_
  286,t 0
  287 OFF_
  292,line 47
  302,line 57
  288 TRUE_
  265,title WCSH
  289 FALSE_
  290 STRING_
  300 LOCK_
  284,title YES
  291 AXES_
  301 OPEN_
  313,title {}
  292 BIN_
  302 RED_
  288,line 39
  293 BLOCK_
  303 SCALE_
  294 BLUE_
  304 SCALELIMITS_
  305 SLICE_
  295 CHANNEL_
  306 SMOOTH_
  296 CLOSE_
  307 SYSTEM_
  262,t 0
  297 COLORBAR_
  308 VIEW_
  285,line 36
  298 CROP_
  310 yesno
  309 wcssys
  299 GREEN_
  311 command
  283,t 0
  312 @PSEUDO1
  313 rgb
  314,t 1
  314 channel
  282,line 32
  315 lock
  316 start'
  264,title WCSG
  283,title WCSZ
  312,title {}
  278,line 28
  error,line 102
  258,t 0
  275,line 25
  279,t 0
  280,t 0
  311,t 1
  272,line 22
  263,title WCSF
  282,title WCSY
  311,title {}
  268,line 18
  276,t 0
  265,line 15
  307,t 0
  297,t 0
  262,line 12
  0,t 0
  0 {$}
  262,title WCSE
  281,title WCSX
  310,title {}
  309,title {}
  error,t 0
  299,title GREEN
  258,line 8
  273,t 0
  294,t 0
  304,t 0
  261,title WCSD
  279,title WCSV
  280,title WCSW
  308,title VIEW
  269,t 0
  270,t 0
  298,title CROP
  314,line 154
  291,t 0
  301,t 0
  311,line 140
  307,line 62
  266,t 0
  260,title WCSC
  259,title WCSB
  297,line 52
  278,title WCSU
  307,title SYSTEM
  297,title COLORBAR
  287,t 0
  294,line 49
  304,line 59
  error,title {}
  291,line 46
  301,line 56
  263,t 0
  258,title WCSA
  287,line 38
  277,title WCST
  284,t 0
  306,title SMOOTH
  296,title CLOSE
  315,t 1
  284,line 35
  281,line 31
  260,t 0
  259,t 0
  281,t 0
  257,title WCS
  277,line 27
  276,title WCSS
  312,t 1
  305,title SLICE
  295,title CHANNEL
  274,line 24
  271,line 21
  277,t 0
  308,t 0
  267,line 17
  298,t 0
  275,title WCSR
  294,title BLUE
  304,title SCALELIMITS
  264,line 14
  261,line 11
  274,t 0
  305,t 0
  295,t 0
  257,line 7
  274,title WCSQ
  293,title BLOCK
  303,title SCALE
  error error
  271,t 0
  292,t 0
  302,t 0
  316,line 170
  273,title WCSP
  313,line 144
  292,title BIN
  302,title RED
  267,t 0
  310,line 131
  309,line 103
  299,line 54
  288,t 0
  306,line 61
  296,line 51
  272,title WCSO
  291,title AXES
  293,line 48
  301,title OPEN
  303,line 58
  264,t 0
  285,t 0
  289,line 40
  290,line 42
  300,line 55
  316,t 1
  286,line 37
  271,title WCSN
  261,t 0
  283,line 33
  289,title FALSE
  290,title string
  300,title LOCK
  282,t 0
  279,line 29
  280,line 30
  313,t 1
  276,line 26
  257,t 0
  269,title WCSL
  270,title WCSM
  273,line 23
  288,title TRUE
  278,t 0
  310,t 1
  309,t 1
  299,t 0
  269,line 19
  270,line 20
  266,line 16
  268,title WCSK
  275,t 0
  263,line 13
  287,title OFF
  316,title {}
  306,t 0
  296,t 0
  260,line 10
  259,line 9
  272,t 0
  267,title WCSJ
  257 WCS_
  286,title ON
  293,t 0
  303,t 0
  315,title {}
  258 WCSA_
  260 WCSC_
  259 WCSB_
  261 WCSD_
  262 WCSE_
  263 WCSF_
  264 WCSG_
  315,line 159
  265 WCSH_
  266 WCSI_
  267 WCSJ_
  268,t 0
  268 WCSK_
  269 WCSL_
  270 WCSM_
  312,line 141
  271 WCSN_
  272 WCSO_
  289,t 0
  290,t 0
  300,t 0
  266,title WCSI
  273 WCSP_
  274 WCSQ_
  285,title NO
  314,title {}
  275 WCSR_
  308,line 63
  276 WCSS_
  298,line 53
  277 WCST_
  278 WCSU_
  279 WCSV_
  280 WCSW_
  281 WCSX_
  305,line 60
  282 WCSY_
  295,line 50
  265,t 0
  283 WCSZ_
  284 YES_
  285 NO_
}

proc rgb::yyparse {} {
    variable yylval
    variable table
    variable rules
    variable token
    variable yycnt
    variable lr1_table
    variable token_id_table
    variable yyerr
    variable save_state

    set yycnt 0
    set state_stack {0}
    set value_stack {{}}
    set token ""
    set accepted 0
    set yyerr 0
    set save_state 0

    while {$accepted == 0} {
        set state [lindex $state_stack end]
        if {$token == ""} {
            set yylval ""
            set token [yylex]
            set buflval $yylval
	    if {$token>0} {
	        incr yycnt
            }
        }
        if {![info exists table($state:$token)] || $yyerr} {
	    if {!$yyerr} {
	        set save_state $state
	    }
            # pop off states until error token accepted
            while {[llength $state_stack] > 0 && \
                       ![info exists table($state:error)]} {
                set state_stack [lrange $state_stack 0 end-1]
                set value_stack [lrange $value_stack 0 \
                                       [expr {[llength $state_stack] - 1}]]
                set state [lindex $state_stack end]
            }
            if {[llength $state_stack] == 0} {
 
	        set rr { }
                if {[info exists lr1_table($save_state,trans)] && [llength $lr1_table($save_state,trans)] >= 1} {
                    foreach trans $lr1_table($save_state,trans) {
                        foreach {tok_id nextstate} $trans {
			    set ss $token_id_table($tok_id,title)
			    if {$ss != {}} {
			        append rr "$ss, "
                            }
                        }
                    }
                }
		set rr [string trimleft $rr { }]
		set rr [string trimright $rr {, }]
                yyerror "parse error, expecting: $rr"


                return 1
            }
            lappend state_stack [set state $table($state:error,target)]
            lappend value_stack {}
            # consume tokens until it finds an acceptable one
            while {![info exists table($state:$token)]} {
                if {$token == 0} {
                    yyerror "end of file while recovering from error"
                    return 1
                }
                set yylval {}
                set token [yylex]
                set buflval $yylval
            }
            continue
        }
        switch -- $table($state:$token) {
            shift {
                lappend state_stack $table($state:$token,target)
                lappend value_stack $buflval
                set token ""
            }
            reduce {
                set rule $table($state:$token,target)
                set ll $rules($rule,l)
                if {[info exists rules($rule,e)]} {
                    set dc $rules($rule,e)
                } else {
                    set dc $rules($rule,dc)
                }
                set stackpointer [expr {[llength $state_stack]-$dc}]
                setupvalues $value_stack $stackpointer $dc
                set _ $1
                set yylval [lindex $value_stack end]
                switch -- $rule {
                    1 { set _ wcs }
                    2 { set _ wcsa }
                    3 { set _ wcsb }
                    4 { set _ wcsc }
                    5 { set _ wcsd }
                    6 { set _ wcse }
                    7 { set _ wcsf }
                    8 { set _ wcsg }
                    9 { set _ wcsh }
                    10 { set _ wcsi }
                    11 { set _ wcsj }
                    12 { set _ wcsk }
                    13 { set _ wcsl }
                    14 { set _ wcsm }
                    15 { set _ wcsn }
                    16 { set _ wcso }
                    17 { set _ wcsp }
                    18 { set _ wcsq }
                    19 { set _ wcsr }
                    20 { set _ wcss }
                    21 { set _ wcst }
                    22 { set _ wcsu }
                    23 { set _ wcsv }
                    24 { set _ wcsw }
                    25 { set _ wcsx }
                    26 { set _ wcsy }
                    27 { set _ wcsz }
                    28 { set _ 1 }
                    29 { set _ 1 }
                    30 { set _ 1 }
                    31 { set _ 1 }
                    32 { set _ 0 }
                    33 { set _ 0 }
                    34 { set _ 0 }
                    36 { global ds9; if {!$ds9(init)} {YYERROR} else {yyclearin; YYACCEPT} }
                    38 { CreateRGBFrame }
                    40 { RGBDestroyDialog }
                    41 { ProcessCmdSet current rgb $1 RGBChannel }
                    42 { ProcessCmdSet current rgb $2 RGBChannel }
                    43 { ProcessCmdSet rgb $2 $3 }
                    44 { ProcessCmdSet rgb system $2 RGBSystem }
                    45 { ProcessCmdSet rgb $2 $3 RGBView }
                    46 { set _ red }
                    47 { set _ green }
                    48 { set _ blue }
                    49 { set _ lock,wcs }
                    50 { set _ lock,crop }
                    51 { set _ lock,slice }
                    52 { set _ lock,bin }
                    53 { set _ lock,axes }
                    54 { set _ lock,scale }
                    55 { set _ lock,scalelimits }
                    56 { set _ lock,colorbar }
                    57 { set _ lock,block }
                    58 { set _ lock,smooth }
                }
                unsetupvalues $dc
                # pop off tokens from the stack if normal rule
                if {![info exists rules($rule,e)]} {
                    incr stackpointer -1
                    set state_stack [lrange $state_stack 0 $stackpointer]
                    set value_stack [lrange $value_stack 0 $stackpointer]
                }
                # now do the goto transition
                lappend state_stack $table([lindex $state_stack end]:$ll,target)
                lappend value_stack $_
            }
            accept {
                set accepted 1
            }
            goto -
            default {
                puts stderr "Internal parser error: illegal command $table($state:$token)"
                return 2
            }
        }
    }
    return 0
}

######
# end autogenerated taccle functions
######

proc rgb::yyerror {msg} {
     variable yycnt
     variable yy_current_buffer
     variable index_

     ParserError $msg $yycnt $yy_current_buffer $index_
}