summaryrefslogtreecommitdiffstats
path: root/ds9/parsers/wcsparser.tcl
blob: 677dea2b299fa1ac0a63d12f3612293d50b7cdaa (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
1341
1342
1343
1344
1345
1346
1347
1348
1349
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 wcs {
    variable yylval {}
    variable table
    variable rules
    variable token {}
    variable yycnt 0
    variable yyerr 0
    variable save_state 0

    namespace export yylex
}

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

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

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

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

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

proc wcs::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 wcs::unsetupvalues {numsyms} {
    for {set i 1} {$i <= $numsyms} {incr i} {
        upvar 1 $i y
        unset y
    }
}

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

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

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

array set wcs::rules {
  41,line 162
  7,line 126
  37,line 158
  4,line 123
  34,line 154
  1,line 120
  31,line 151
  27,line 147
  24,line 144
  21,line 141
  17,line 137
  14,line 134
  11,line 131
  66,line 196
  63,line 191
  60,line 188
  59,line 185
  56,line 182
  53,line 179
  50,line 176
  49,line 175
  46,line 170
  43,line 165
  9,line 129
  40,line 161
  39,line 160
  6,line 125
  36,line 157
  3,line 122
  33,line 153
  29,line 149
  30,line 150
  26,line 146
  23,line 143
  19,line 139
  20,line 140
  16,line 136
  13,line 133
  10,line 130
  65,line 195
  62,line 190
  58,line 184
  55,line 181
  52,line 178
  48,line 174
  45,line 169
  42,line 164
  8,line 128
  38,line 159
  5,line 124
  35,line 156
  2,line 121
  32,line 152
  28,line 148
  25,line 145
  22,line 142
  45,e 1
  18,line 138
  15,line 135
  12,line 132
  67,line 197
  64,line 194
  61,line 189
  57,line 183
  54,line 180
  51,line 177
  47,line 173
  44,line 169
}

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

array set wcs::token_id_table {
  286 WCSW_
  286,t 0
  287 WCSX_
  292,line 44
  302,line 60
  288 WCSY_
  317,t 1
  265,title WCSB
  289 WCSZ_
  290 FK4_
  300 STRING_
  284,title WCSU
  291 B1950_
  301 ALIGN_
  313,title {}
  292 FK5_
  302 APPEND_
  288,line 39
  293 J2000_
  303 CLOSE_
  294 ICRS_
  304 OPEN_
  305 REPLACE_
  295 GALACTIC_
  306 RESET_
  296 ECLIPTIC_
  307 SKY_
  262,t 0
  297 DEGREES_
  308 SKYFORMAT_
  285,line 36
  298 SEXAGESIMAL_
  310 yesno
  309 SYSTEM_
  299 INT_
  311 wcssys
  283,t 0
  312 skyframe
  313 skyformat
  314,t 1
  314 command
  282,line 33
  315 @PSEUDO1
  316 wcs
  264,title WCSA
  317 replace
  283,title WCST
  318 append
  312,title {}
  319 start'
  278,line 29
  error,line 118
  258,t 0
  275,line 26
  279,t 0
  280,t 0
  311,t 1
  272,line 23
  263,title WCS
  282,title WCSS
  311,title {}
  268,line 19
  276,t 0
  265,line 16
  307,t 0
  297,t 0
  262,line 12
  0,t 0
  0 {$}
  262,title FALSE
  281,title WCSR
  310,title {}
  error,t 0
  309,title SYSTEM
  299,title integer
  258,line 8
  273,t 0
  294,t 0
  304,t 0
  317,line 187
  261,title TRUE
  279,title WCSP
  280,title WCSQ
  308,title SKYFORMAT
  269,t 0
  270,t 0
  298,title SEXAGESIMAL
  314,line 168
  291,t 0
  301,t 0
  311,line 127
  307,line 65
  266,t 0
  260,title OFF
  259,title ON
  297,line 50
  278,title WCSO
  307,title SKY
  297,title DEGREES
  287,t 0
  294,line 46
  304,line 62
  318,t 1
  error,title {}
  291,line 43
  301,line 59
  263,t 0
  258,title NO
  287,line 38
  277,title WCSN
  284,t 0
  306,title RESET
  296,title ECLIPTIC
  315,t 1
  284,line 35
  281,line 32
  260,t 0
  259,t 0
  281,t 0
  257,title YES
  277,line 28
  276,title WCSM
  312,t 1
  305,title REPLACE
  295,title GALACTIC
  274,line 25
  271,line 22
  277,t 0
  308,t 0
  267,line 18
  298,t 0
  275,title WCSL
  294,title ICRS
  304,title OPEN
  264,line 15
  261,line 11
  274,t 0
  305,t 0
  295,t 0
  257,line 7
  274,title WCSK
  293,title J2000
  303,title CLOSE
  319,line 198
  error error
  271,t 0
  292,t 0
  302,t 0
  316,line 172
  273,title WCSJ
  313,line 163
  292,title FK5
  302,title APPEND
  267,t 0
  310,line 119
  309,line 67
  299,line 53
  288,t 0
  319,t 1
  306,line 64
  296,line 48
  272,title WCSI
  291,title B1950
  293,line 45
  301,title ALIGN
  303,line 61
  319,title {}
  264,t 0
  285,t 0
  289,line 40
  290,line 42
  300,line 55
  316,t 1
  286,line 37
  271,title WCSH
  261,t 0
  283,line 34
  289,title WCSZ
  290,title FK4
  300,title string
  318,title {}
  282,t 0
  279,line 30
  280,line 31
  313,t 1
  276,line 27
  257,t 0
  269,title WCSF
  270,title WCSG
  273,line 24
  288,title WCSY
  317,title {}
  278,t 0
  310,t 1
  309,t 0
  299,t 0
  269,line 20
  270,line 21
  266,line 17
  268,title WCSE
  275,t 0
  263,line 14
  287,title WCSX
  316,title {}
  306,t 0
  296,t 0
  260,line 10
  259,line 9
  272,t 0
  267,title WCSD
  257 YES_
  286,title WCSW
  293,t 0
  303,t 0
  315,title {}
  258 NO_
  318,line 193
  260 OFF_
  259 ON_
  261 TRUE_
  262 FALSE_
  263 WCS_
  264 WCSA_
  315,line 169
  265 WCSB_
  266 WCSC_
  267 WCSD_
  268,t 0
  268 WCSE_
  269 WCSF_
  270 WCSG_
  312,line 155
  271 WCSH_
  272 WCSI_
  289,t 0
  290,t 0
  300,t 0
  266,title WCSC
  273 WCSJ_
  274 WCSK_
  285,title WCSV
  314,title {}
  275 WCSL_
  308,line 66
  276 WCSM_
  298,line 51
  277 WCSN_
  278 WCSO_
  279 WCSP_
  280 WCSQ_
  281 WCSR_
  305,line 63
  282 WCSS_
  295,line 47
  265,t 0
  283 WCST_
  284 WCSU_
  285 WCSV_
}

proc wcs::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 _ 1 }
                    2 { set _ 1 }
                    3 { set _ 1 }
                    4 { set _ 1 }
                    5 { set _ 0 }
                    6 { set _ 0 }
                    7 { set _ 0 }
                    8 { set _ wcs }
                    9 { set _ wcsa }
                    10 { set _ wcsb }
                    11 { set _ wcsc }
                    12 { set _ wcsd }
                    13 { set _ wcse }
                    14 { set _ wcsf }
                    15 { set _ wcsg }
                    16 { set _ wcsh }
                    17 { set _ wcsi }
                    18 { set _ wcsj }
                    19 { set _ wcsk }
                    20 { set _ wcsl }
                    21 { set _ wcsm }
                    22 { set _ wcsn }
                    23 { set _ wcso }
                    24 { set _ wcsp }
                    25 { set _ wcsq }
                    26 { set _ wcsr }
                    27 { set _ wcss }
                    28 { set _ wcst }
                    29 { set _ wcsu }
                    30 { set _ wcsv }
                    31 { set _ wcsw }
                    32 { set _ wcsx }
                    33 { set _ wcsy }
                    34 { set _ wcsz }
                    35 { set _ fk4 }
                    36 { set _ fk4 }
                    37 { set _ fk5 }
                    38 { set _ fk5 }
                    39 { set _ icrs }
                    40 { set _ galactic }
                    41 { set _ ecliptic }
                    42 { set _ degrees }
                    43 { set _ sexagesimal }
                    45 { global ds9; if {!$ds9(init)} {YYERROR} else {yyclearin; YYACCEPT} }
                    47 { WCSDialog }
                    48 { WCSDestroyDialog }
                    49 { ProcessCmdSet wcs system $1 UpdateWCS }
                    50 { ProcessCmdSet wcs system $2 UpdateWCS }
                    51 { ProcessCmdSet wcs sky $1 UpdateWCS }
                    52 { ProcessCmdSet wcs sky $2 UpdateWCS }
                    53 { ProcessCmdSet wcs skyformat $1 UpdateWCS }
                    54 { ProcessCmdSet wcs skyformat $2 UpdateWCS }
                    55 { ProcessCmdSet current align $2 AlignWCSFrame }
                    56 { WCSCmdReset 1 }
                    57 { WCSCmdReset $2 }
                    60 { WCSCmdLoad replace 1 }
                    61 { WCSCmdLoad replace $1 }
                    62 { WCSCmdLoadFn replace 1 $1 }
                    63 { WCSCmdLoadFn replace $1 $2 }
                    64 { WCSCmdLoad append 1 }
                    65 { WCSCmdLoad append $1 }
                    66 { WCSCmdLoadFn append 1 $1 }
                    67 { WCSCmdLoadFn append $1 $2 }
                }
                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 wcs::yyerror {msg} {
     variable yycnt
     variable yy_current_buffer
     variable index_

     ParserError $msg $yycnt $yy_current_buffer $index_
}