-
Notifications
You must be signed in to change notification settings - Fork 0
/
pikchr.c
7893 lines (7628 loc) · 265 KB
/
pikchr.c
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
/* This file is automatically generated by Lemon from input grammar
** source file "pikchr.y". */
/*
** Zero-Clause BSD license:
**
** Copyright (C) 2020-09-01 by D. Richard Hipp <drh@sqlite.org>
**
** Permission to use, copy, modify, and/or distribute this software for
** any purpose with or without fee is hereby granted.
**
****************************************************************************
**
** This software translates a PIC-inspired diagram language into SVG.
**
** PIKCHR (pronounced like "picture") is *mostly* backwards compatible
** with legacy PIC, though some features of legacy PIC are removed
** (for example, the "sh" command is removed for security) and
** many enhancements are added.
**
** PIKCHR is designed for use in an internet facing web environment.
** In particular, PIKCHR is designed to safely generate benign SVG from
** source text that provided by a hostile agent.
**
** This code was originally written by D. Richard Hipp using documentation
** from prior PIC implementations but without reference to prior code.
** All of the code in this project is original.
**
** This file implements a C-language subroutine that accepts a string
** of PIKCHR language text and generates a second string of SVG output that
** renders the drawing defined by the input. Space to hold the returned
** string is obtained from malloc() and should be freed by the caller.
** NULL might be returned if there is a memory allocation error.
**
** If there are errors in the PIKCHR input, the output will consist of an
** error message and the original PIKCHR input text (inside of <pre>...</pre>).
**
** The subroutine implemented by this file is intended to be stand-alone.
** It uses no external routines other than routines commonly found in
** the standard C library.
**
****************************************************************************
** COMPILING:
**
** The original source text is a mixture of C99 and "Lemon"
** (See https://sqlite.org/src/file/doc/lemon.html). Lemon is an LALR(1)
** parser generator program, similar to Yacc. The grammar of the
** input language is specified in Lemon. C-code is attached. Lemon
** runs to generate a single output file ("pikchr.c") which is then
** compiled to generate the Pikchr library. This header comment is
** preserved in the Lemon output, so you might be reading this in either
** the generated "pikchr.c" file that is output by Lemon, or in the
** "pikchr.y" source file that is input into Lemon. If you make changes,
** you should change the input source file "pikchr.y", not the
** Lemon-generated output file.
**
** Basic compilation steps:
**
** lemon pikchr.y
** cc pikchr.c -o pikchr.o
**
** Add -DPIKCHR_SHELL to add a main() routine that reads input files
** and sends them through Pikchr, for testing. Add -DPIKCHR_FUZZ for
** -fsanitizer=fuzzer testing.
**
****************************************************************************
** IMPLEMENTATION NOTES (for people who want to understand the internal
** operation of this software, perhaps to extend the code or to fix bugs):
**
** Each call to pikchr() uses a single instance of the Pik structure to
** track its internal state. The Pik structure lives for the duration
** of the pikchr() call.
**
** The input is a sequence of objects or "statements". Each statement is
** parsed into a PObj object. These are stored on an extensible array
** called PList. All parameters to each PObj are computed as the
** object is parsed. (Hence, the parameters to a PObj may only refer
** to prior statements.) Once the PObj is completely assembled, it is
** added to the end of a PList and never changes thereafter - except,
** PObj objects that are part of a "[...]" block might have their
** absolute position shifted when the outer [...] block is positioned.
** But apart from this repositioning, PObj objects are unchanged once
** they are added to the list. The order of statements on a PList does
** not change.
**
** After all input has been parsed, the top-level PList is walked to
** generate output. Sub-lists resulting from [...] blocks are scanned
** as they are encountered. All input must be collected and parsed ahead
** of output generation because the size and position of statements must be
** known in order to compute a bounding box on the output.
**
** Each PObj is on a "layer". (The common case is that all PObj's are
** on a single layer, but multiple layers are possible.) A separate pass
** is made through the list for each layer.
**
** After all output is generated, the Pik object and all the PList
** and PObj objects are deallocated and the generated output string is
** returned. Upon any error, the Pik.nErr flag is set, processing quickly
** stops, and the stack unwinds. No attempt is made to continue reading
** input after an error.
**
** Most statements begin with a class name like "box" or "arrow" or "move".
** There is a class named "text" which is used for statements that begin
** with a string literal. You can also specify the "text" class.
** A Sublist ("[...]") is a single object that contains a pointer to
** its substatements, all gathered onto a separate PList object.
**
** Variables go into PVar objects that form a linked list.
**
** Each PObj has zero or one names. Input constructs that attempt
** to assign a new name from an older name, for example:
**
** Abc: Abc + (0.5cm, 0)
**
** Statements like these generate a new "noop" object at the specified
** place and with the given name. As place-names are searched by scanning
** the list in reverse order, this has the effect of overriding the "Abc"
** name when referenced by subsequent objects.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <assert.h>
#define count(X) (sizeof(X)/sizeof(X[0]))
#ifndef M_PI
# define M_PI 3.1415926535897932385
#endif
/* Tag intentionally unused parameters with this macro to prevent
** compiler warnings with -Wextra */
#define UNUSED_PARAMETER(X) (void)(X)
typedef struct Pik Pik; /* Complete parsing context */
typedef struct PToken PToken; /* A single token */
typedef struct PObj PObj; /* A single diagram object */
typedef struct PList PList; /* A list of diagram objects */
typedef struct PClass PClass; /* Description of statements types */
typedef double PNum; /* Numeric value */
typedef struct PRel PRel; /* Absolute or percentage value */
typedef struct PPoint PPoint; /* A position in 2-D space */
typedef struct PVar PVar; /* script-defined variable */
typedef struct PBox PBox; /* A bounding box */
typedef struct PMacro PMacro; /* A "define" macro */
/* Compass points */
#define CP_N 1
#define CP_NE 2
#define CP_E 3
#define CP_SE 4
#define CP_S 5
#define CP_SW 6
#define CP_W 7
#define CP_NW 8
#define CP_C 9 /* .center or .c */
#define CP_END 10 /* .end */
#define CP_START 11 /* .start */
/* Heading angles corresponding to compass points */
static const PNum pik_hdg_angle[] = {
/* none */ 0.0,
/* N */ 0.0,
/* NE */ 45.0,
/* E */ 90.0,
/* SE */ 135.0,
/* S */ 180.0,
/* SW */ 225.0,
/* W */ 270.0,
/* NW */ 315.0,
/* C */ 0.0,
};
/* Built-in functions */
#define FN_ABS 0
#define FN_COS 1
#define FN_INT 2
#define FN_MAX 3
#define FN_MIN 4
#define FN_SIN 5
#define FN_SQRT 6
/* Text position and style flags. Stored in PToken.eCode so limited
** to 15 bits. */
#define TP_LJUST 0x0001 /* left justify...... */
#define TP_RJUST 0x0002 /* ...Right justify */
#define TP_JMASK 0x0003 /* Mask for justification bits */
#define TP_ABOVE2 0x0004 /* Position text way above PObj.ptAt */
#define TP_ABOVE 0x0008 /* Position text above PObj.ptAt */
#define TP_CENTER 0x0010 /* On the line */
#define TP_BELOW 0x0020 /* Position text below PObj.ptAt */
#define TP_BELOW2 0x0040 /* Position text way below PObj.ptAt */
#define TP_VMASK 0x007c /* Mask for text positioning flags */
#define TP_BIG 0x0100 /* Larger font */
#define TP_SMALL 0x0200 /* Smaller font */
#define TP_XTRA 0x0400 /* Amplify TP_BIG or TP_SMALL */
#define TP_SZMASK 0x0700 /* Font size mask */
#define TP_ITALIC 0x1000 /* Italic font */
#define TP_BOLD 0x2000 /* Bold font */
#define TP_FMASK 0x3000 /* Mask for font style */
#define TP_ALIGN 0x4000 /* Rotate to align with the line */
/* An object to hold a position in 2-D space */
struct PPoint {
PNum x, y; /* X and Y coordinates */
};
static const PPoint cZeroPoint = {0.0,0.0};
/* A bounding box */
struct PBox {
PPoint sw, ne; /* Lower-left and top-right corners */
};
/* An Absolute or a relative distance. The absolute distance
** is stored in rAbs and the relative distance is stored in rRel.
** Usually, one or the other will be 0.0. When using a PRel to
** update an existing value, the computation is usually something
** like this:
**
** value = PRel.rAbs + value*PRel.rRel
**
*/
struct PRel {
PNum rAbs; /* Absolute value */
PNum rRel; /* Value relative to current value */
};
/* A variable created by the ID = EXPR construct of the PIKCHR script
**
** PIKCHR (and PIC) scripts do not use many varaibles, so it is reasonable
** to store them all on a linked list.
*/
struct PVar {
const char *zName; /* Name of the variable */
PNum val; /* Value of the variable */
PVar *pNext; /* Next variable in a list of them all */
};
/* A single token in the parser input stream
*/
struct PToken {
const char *z; /* Pointer to the token text */
unsigned int n; /* Length of the token in bytes */
short int eCode; /* Auxiliary code */
unsigned char eType; /* The numeric parser code */
unsigned char eEdge; /* Corner value for corner keywords */
};
/* Return negative, zero, or positive if pToken is less than, equal to
** or greater than the zero-terminated string z[]
*/
static int pik_token_eq(PToken *pToken, const char *z){
int c = strncmp(pToken->z,z,pToken->n);
if( c==0 && z[pToken->n]!=0 ) c = -1;
return c;
}
/* Extra token types not generated by LEMON but needed by the
** tokenizer
*/
#define T_PARAMETER 253 /* $1, $2, ..., $9 */
#define T_WHITESPACE 254 /* Whitespace of comments */
#define T_ERROR 255 /* Any text that is not a valid token */
/* Directions of movement */
#define DIR_RIGHT 0
#define DIR_DOWN 1
#define DIR_LEFT 2
#define DIR_UP 3
#define ValidDir(X) ((X)>=0 && (X)<=3)
#define IsUpDown(X) (((X)&1)==1)
#define IsLeftRight(X) (((X)&1)==0)
/* Bitmask for the various attributes for PObj. These bits are
** collected in PObj.mProp and PObj.mCalc to check for constraint
** errors. */
#define A_WIDTH 0x0001
#define A_HEIGHT 0x0002
#define A_RADIUS 0x0004
#define A_THICKNESS 0x0008
#define A_DASHED 0x0010 /* Includes "dotted" */
#define A_FILL 0x0020
#define A_COLOR 0x0040
#define A_ARROW 0x0080
#define A_FROM 0x0100
#define A_CW 0x0200
#define A_AT 0x0400
#define A_TO 0x0800 /* one or more movement attributes */
#define A_FIT 0x1000
/* A single graphics object */
struct PObj {
const PClass *type; /* Object type or class */
PToken errTok; /* Reference token for error messages */
PPoint ptAt; /* Reference point for the object */
PPoint ptEnter, ptExit; /* Entry and exit points */
PList *pSublist; /* Substructure for [...] objects */
char *zName; /* Name assigned to this statement */
PNum w; /* "width" property */
PNum h; /* "height" property */
PNum rad; /* "radius" property */
PNum sw; /* "thickness" property. (Mnemonic: "stroke width")*/
PNum dotted; /* "dotted" property. <=0.0 for off */
PNum dashed; /* "dashed" property. <=0.0 for off */
PNum fill; /* "fill" property. Negative for off */
PNum color; /* "color" property */
PPoint with; /* Position constraint from WITH clause */
char eWith; /* Type of heading point on WITH clause */
char cw; /* True for clockwise arc */
char larrow; /* Arrow at beginning (<- or <->) */
char rarrow; /* Arrow at end (-> or <->) */
char bClose; /* True if "close" is seen */
char bChop; /* True if "chop" is seen */
unsigned char nTxt; /* Number of text values */
unsigned mProp; /* Masks of properties set so far */
unsigned mCalc; /* Values computed from other constraints */
PToken aTxt[5]; /* Text with .eCode holding TP flags */
int iLayer; /* Rendering order */
int inDir, outDir; /* Entry and exit directions */
int nPath; /* Number of path points */
PPoint *aPath; /* Array of path points */
PBox bbox; /* Bounding box */
};
/* A list of graphics objects */
struct PList {
int n; /* Number of statements in the list */
int nAlloc; /* Allocated slots in a[] */
PObj **a; /* Pointers to individual objects */
};
/* A macro definition */
struct PMacro {
PMacro *pNext; /* Next in the list */
PToken macroName; /* Name of the macro */
PToken macroBody; /* Body of the macro */
int inUse; /* Do not allow recursion */
};
/* Each call to the pikchr() subroutine uses an instance of the following
** object to pass around context to all of its subroutines.
*/
struct Pik {
unsigned nErr; /* Number of errors seen */
PToken sIn; /* Input Pikchr-language text */
char *zOut; /* Result accumulates here */
unsigned int nOut; /* Bytes written to zOut[] so far */
unsigned int nOutAlloc; /* Space allocated to zOut[] */
unsigned char eDir; /* Current direction */
unsigned int mFlags; /* Flags passed to pikchr() */
PObj *cur; /* Object under construction */
PList *list; /* Object list under construction */
PMacro *pMacros; /* List of all defined macros */
PVar *pVar; /* Application-defined variables */
PBox bbox; /* Bounding box around all statements */
/* Cache of layout values. <=0.0 for unknown... */
PNum rScale; /* Multiply to convert inches to pixels */
PNum fontScale; /* Scale fonts by this percent */
PNum charWidth; /* Character width */
PNum charHeight; /* Character height */
PNum wArrow; /* Width of arrowhead at the fat end */
PNum hArrow; /* Ht of arrowhead - dist from tip to fat end */
char bLayoutVars; /* True if cache is valid */
char thenFlag; /* True if "then" seen */
char samePath; /* aTPath copied by "same" */
const char *zClass; /* Class name for the <svg> */
int wSVG, hSVG; /* Width and height of the <svg> */
int fgcolor; /* fgcolor value, or -1 for none */
/* Paths for lines are constructed here first, then transferred into
** the PObj object at the end: */
int nTPath; /* Number of entries on aTPath[] */
int mTPath; /* For last entry, 1: x set, 2: y set */
PPoint aTPath[1000]; /* Path under construction */
/* Error contexts */
unsigned int nCtx; /* Number of error contexts */
PToken aCtx[10]; /* Nested error contexts */
};
/* Include PIKCHR_PLAINTEXT_ERRORS among the bits of mFlags on the 3rd
** argument to pikchr() in order to cause error message text to come out
** as text/plain instead of as text/html
*/
#define PIKCHR_PLAINTEXT_ERRORS 0x0001
/* Include PIKCHR_DARK_MODE among the mFlag bits to invert colors.
*/
#define PIKCHR_DARK_MODE 0x0002
/*
** The behavior of an object class is defined by an instance of
** this structure. This is the "virtual method" table.
*/
struct PClass {
const char *zName; /* Name of class */
char isLine; /* True if a line class */
char eJust; /* Use box-style text justification */
void (*xInit)(Pik*,PObj*); /* Initializer */
void (*xNumProp)(Pik*,PObj*,PToken*); /* Value change notification */
void (*xCheck)(Pik*,PObj*); /* Checks to do after parsing */
PPoint (*xChop)(Pik*,PObj*,PPoint*); /* Chopper */
PPoint (*xOffset)(Pik*,PObj*,int); /* Offset from .c to edge point */
void (*xFit)(Pik*,PObj*,PNum w,PNum h); /* Size to fit text */
void (*xRender)(Pik*,PObj*); /* Render */
};
/* Forward declarations */
static void pik_append(Pik*, const char*,int);
static void pik_append_text(Pik*,const char*,int,int);
static void pik_append_num(Pik*,const char*,PNum);
static void pik_append_point(Pik*,const char*,PPoint*);
static void pik_append_x(Pik*,const char*,PNum,const char*);
static void pik_append_y(Pik*,const char*,PNum,const char*);
static void pik_append_xy(Pik*,const char*,PNum,PNum);
static void pik_append_dis(Pik*,const char*,PNum,const char*);
static void pik_append_arc(Pik*,PNum,PNum,PNum,PNum);
static void pik_append_clr(Pik*,const char*,PNum,const char*,int);
static void pik_append_style(Pik*,PObj*,int);
static void pik_append_txt(Pik*,PObj*, PBox*);
static void pik_draw_arrowhead(Pik*,PPoint*pFrom,PPoint*pTo,PObj*);
static void pik_chop(PPoint*pFrom,PPoint*pTo,PNum);
static void pik_error(Pik*,PToken*,const char*);
static void pik_elist_free(Pik*,PList*);
static void pik_elem_free(Pik*,PObj*);
static void pik_render(Pik*,PList*);
static PList *pik_elist_append(Pik*,PList*,PObj*);
static PObj *pik_elem_new(Pik*,PToken*,PToken*,PList*);
static void pik_set_direction(Pik*,int);
static void pik_elem_setname(Pik*,PObj*,PToken*);
static void pik_set_var(Pik*,PToken*,PNum,PToken*);
static PNum pik_value(Pik*,const char*,int,int*);
static PNum pik_lookup_color(Pik*,PToken*);
static PNum pik_get_var(Pik*,PToken*);
static PNum pik_atof(PToken*);
static void pik_after_adding_attributes(Pik*,PObj*);
static void pik_elem_move(PObj*,PNum dx, PNum dy);
static void pik_elist_move(PList*,PNum dx, PNum dy);
static void pik_set_numprop(Pik*,PToken*,PRel*);
static void pik_set_clrprop(Pik*,PToken*,PNum);
static void pik_set_dashed(Pik*,PToken*,PNum*);
static void pik_then(Pik*,PToken*,PObj*);
static void pik_add_direction(Pik*,PToken*,PRel*);
static void pik_move_hdg(Pik*,PRel*,PToken*,PNum,PToken*,PToken*);
static void pik_evenwith(Pik*,PToken*,PPoint*);
static void pik_set_from(Pik*,PObj*,PToken*,PPoint*);
static void pik_add_to(Pik*,PObj*,PToken*,PPoint*);
static void pik_close_path(Pik*,PToken*);
static void pik_set_at(Pik*,PToken*,PPoint*,PToken*);
static short int pik_nth_value(Pik*,PToken*);
static PObj *pik_find_nth(Pik*,PObj*,PToken*);
static PObj *pik_find_byname(Pik*,PObj*,PToken*);
static PPoint pik_place_of_elem(Pik*,PObj*,PToken*);
static int pik_bbox_isempty(PBox*);
static void pik_bbox_init(PBox*);
static void pik_bbox_addbox(PBox*,PBox*);
static void pik_bbox_add_xy(PBox*,PNum,PNum);
static void pik_bbox_addellipse(PBox*,PNum x,PNum y,PNum rx,PNum ry);
static void pik_add_txt(Pik*,PToken*,int);
static int pik_text_length(const PToken *pToken);
static void pik_size_to_fit(Pik*,PToken*,int);
static int pik_text_position(int,PToken*);
static PNum pik_property_of(PObj*,PToken*);
static PNum pik_func(Pik*,PToken*,PNum,PNum);
static PPoint pik_position_between(PNum x, PPoint p1, PPoint p2);
static PPoint pik_position_at_angle(PNum dist, PNum r, PPoint pt);
static PPoint pik_position_at_hdg(PNum dist, PToken *pD, PPoint pt);
static void pik_same(Pik *p, PObj*, PToken*);
static PPoint pik_nth_vertex(Pik *p, PToken *pNth, PToken *pErr, PObj *pObj);
static PToken pik_next_semantic_token(PToken *pThis);
static void pik_compute_layout_settings(Pik*);
static void pik_behind(Pik*,PObj*);
static PObj *pik_assert(Pik*,PNum,PToken*,PNum);
static PObj *pik_position_assert(Pik*,PPoint*,PToken*,PPoint*);
static PNum pik_dist(PPoint*,PPoint*);
static void pik_add_macro(Pik*,PToken *pId,PToken *pCode);
#line 504 "pikchr.c"
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols.
***************** Begin token definitions *************************************/
#ifndef T_ID
#define T_ID 1
#define T_EDGEPT 2
#define T_OF 3
#define T_PLUS 4
#define T_MINUS 5
#define T_STAR 6
#define T_SLASH 7
#define T_PERCENT 8
#define T_UMINUS 9
#define T_EOL 10
#define T_ASSIGN 11
#define T_PLACENAME 12
#define T_COLON 13
#define T_ASSERT 14
#define T_LP 15
#define T_EQ 16
#define T_RP 17
#define T_DEFINE 18
#define T_CODEBLOCK 19
#define T_FILL 20
#define T_COLOR 21
#define T_THICKNESS 22
#define T_PRINT 23
#define T_STRING 24
#define T_COMMA 25
#define T_CLASSNAME 26
#define T_LB 27
#define T_RB 28
#define T_UP 29
#define T_DOWN 30
#define T_LEFT 31
#define T_RIGHT 32
#define T_CLOSE 33
#define T_CHOP 34
#define T_FROM 35
#define T_TO 36
#define T_THEN 37
#define T_HEADING 38
#define T_GO 39
#define T_AT 40
#define T_WITH 41
#define T_SAME 42
#define T_AS 43
#define T_FIT 44
#define T_BEHIND 45
#define T_UNTIL 46
#define T_EVEN 47
#define T_DOT_E 48
#define T_HEIGHT 49
#define T_WIDTH 50
#define T_RADIUS 51
#define T_DIAMETER 52
#define T_DOTTED 53
#define T_DASHED 54
#define T_CW 55
#define T_CCW 56
#define T_LARROW 57
#define T_RARROW 58
#define T_LRARROW 59
#define T_INVIS 60
#define T_THICK 61
#define T_THIN 62
#define T_SOLID 63
#define T_CENTER 64
#define T_LJUST 65
#define T_RJUST 66
#define T_ABOVE 67
#define T_BELOW 68
#define T_ITALIC 69
#define T_BOLD 70
#define T_ALIGNED 71
#define T_BIG 72
#define T_SMALL 73
#define T_AND 74
#define T_LT 75
#define T_GT 76
#define T_ON 77
#define T_WAY 78
#define T_BETWEEN 79
#define T_THE 80
#define T_NTH 81
#define T_VERTEX 82
#define T_TOP 83
#define T_BOTTOM 84
#define T_START 85
#define T_END 86
#define T_IN 87
#define T_DOT_U 88
#define T_LAST 89
#define T_NUMBER 90
#define T_FUNC1 91
#define T_FUNC2 92
#define T_DIST 93
#define T_DOT_XY 94
#define T_X 95
#define T_Y 96
#define T_DOT_L 97
#endif
/**************** End token definitions ***************************************/
/* The next sections is a series of control #defines.
** various aspects of the generated parser.
** YYCODETYPE is the data type used to store the integer codes
** that represent terminal and non-terminal symbols.
** "unsigned char" is used if there are fewer than
** 256 symbols. Larger types otherwise.
** YYNOCODE is a number of type YYCODETYPE that is not used for
** any terminal or nonterminal symbol.
** YYFALLBACK If defined, this indicates that one or more tokens
** (also known as: "terminal symbols") have fall-back
** values which should be used if the original symbol
** would not parse. This permits keywords to sometimes
** be used as identifiers, for example.
** YYACTIONTYPE is the data type used for "action codes" - numbers
** that indicate what to do in response to the next
** token.
** pik_parserTOKENTYPE is the data type used for minor type for terminal
** symbols. Background: A "minor type" is a semantic
** value associated with a terminal or non-terminal
** symbols. For example, for an "ID" terminal symbol,
** the minor type might be the name of the identifier.
** Each non-terminal can have a different minor type.
** Terminal symbols all have the same minor type, though.
** This macros defines the minor type for terminal
** symbols.
** YYMINORTYPE is the data type used for all minor types.
** This is typically a union of many types, one of
** which is pik_parserTOKENTYPE. The entry in the union
** for terminal symbols is called "yy0".
** YYSTACKDEPTH is the maximum depth of the parser's stack. If
** zero the stack is dynamically sized using realloc()
** pik_parserARG_SDECL A static variable declaration for the %extra_argument
** pik_parserARG_PDECL A parameter declaration for the %extra_argument
** pik_parserARG_PARAM Code to pass %extra_argument as a subroutine parameter
** pik_parserARG_STORE Code to store %extra_argument into yypParser
** pik_parserARG_FETCH Code to extract %extra_argument from yypParser
** pik_parserCTX_* As pik_parserARG_ except for %extra_context
** YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing.
** YYNSTATE the combined number of states.
** YYNRULE the number of rules in the grammar
** YYNTOKEN Number of terminal symbols
** YY_MAX_SHIFT Maximum value for shift actions
** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
** YY_ERROR_ACTION The yy_action[] code for syntax error
** YY_ACCEPT_ACTION The yy_action[] code for accept
** YY_NO_ACTION The yy_action[] code for no-op
** YY_MIN_REDUCE Minimum value for reduce actions
** YY_MAX_REDUCE Maximum value for reduce actions
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned char
#define YYNOCODE 134
#define YYACTIONTYPE unsigned short int
#define pik_parserTOKENTYPE PToken
typedef union {
int yyinit;
pik_parserTOKENTYPE yy0;
PObj* yy38;
PPoint yy43;
short int yy44;
PList* yy119;
PRel yy200;
PNum yy265;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define pik_parserARG_SDECL
#define pik_parserARG_PDECL
#define pik_parserARG_PARAM
#define pik_parserARG_FETCH
#define pik_parserARG_STORE
#define pik_parserCTX_SDECL Pik *p;
#define pik_parserCTX_PDECL ,Pik *p
#define pik_parserCTX_PARAM ,p
#define pik_parserCTX_FETCH Pik *p=yypParser->p;
#define pik_parserCTX_STORE yypParser->p=p;
#define YYFALLBACK 1
#define YYNSTATE 164
#define YYNRULE 155
#define YYNRULE_WITH_ACTION 115
#define YYNTOKEN 98
#define YY_MAX_SHIFT 163
#define YY_MIN_SHIFTREDUCE 286
#define YY_MAX_SHIFTREDUCE 440
#define YY_ERROR_ACTION 441
#define YY_ACCEPT_ACTION 442
#define YY_NO_ACTION 443
#define YY_MIN_REDUCE 444
#define YY_MAX_REDUCE 598
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
** Applications can choose to define yytestcase() in the %include section
** to a macro that can assist in verifying code coverage. For production
** code the yytestcase() macro should be turned off. But it is useful
** for testing.
*/
#ifndef yytestcase
# define yytestcase(X)
#endif
/* Next are the tables used to determine what action to take based on the
** current state and lookahead token. These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.
**
** Suppose the action integer is N. Then the action is determined as
** follows
**
** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead
** token onto the stack and goto state N.
**
** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then
** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE.
**
** N == YY_ERROR_ACTION A syntax error has occurred.
**
** N == YY_ACCEPT_ACTION The parser accepts its input.
**
** N == YY_NO_ACTION No such action. Denotes unused
** slots in the yy_action[] table.
**
** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
** and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either:
**
** (A) N = yy_action[ yy_shift_ofst[S] + X ]
** (B) N = yy_default[S]
**
** The (A) formula is preferred. The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formulas above are for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
** yy_action[] A single table containing all actions.
** yy_lookahead[] A table containing the lookahead for each entry in
** yy_action. Used to detect hash collisions.
** yy_shift_ofst[] For each state, the offset into yy_action for
** shifting terminals.
** yy_reduce_ofst[] For each state, the offset into yy_action for
** shifting non-terminals after a reduce.
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (1263)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 572, 493, 161, 119, 25, 450, 29, 74, 129, 148,
/* 10 */ 572, 490, 161, 119, 451, 113, 120, 161, 119, 528,
/* 20 */ 425, 426, 338, 556, 81, 30, 557, 558, 572, 64,
/* 30 */ 63, 62, 61, 321, 322, 9, 8, 33, 149, 32,
/* 40 */ 7, 71, 127, 38, 334, 66, 48, 37, 28, 338,
/* 50 */ 338, 338, 338, 423, 424, 339, 340, 341, 342, 343,
/* 60 */ 344, 345, 346, 347, 472, 526, 161, 119, 574, 77,
/* 70 */ 574, 73, 374, 148, 472, 531, 161, 119, 112, 113,
/* 80 */ 120, 161, 119, 128, 425, 426, 338, 305, 81, 376,
/* 90 */ 158, 76, 472, 529, 161, 119, 31, 321, 322, 9,
/* 100 */ 8, 33, 149, 32, 7, 71, 127, 329, 334, 66,
/* 110 */ 576, 83, 36, 338, 338, 338, 338, 423, 424, 339,
/* 120 */ 340, 341, 342, 343, 344, 345, 346, 347, 392, 433,
/* 130 */ 309, 59, 60, 409, 410, 411, 412, 107, 84, 374,
/* 140 */ 65, 108, 2, 46, 401, 162, 120, 161, 119, 117,
/* 150 */ 476, 80, 118, 307, 79, 133, 35, 126, 439, 438,
/* 160 */ 298, 123, 122, 402, 403, 404, 406, 80, 152, 307,
/* 170 */ 79, 327, 409, 410, 411, 412, 392, 54, 51, 59,
/* 180 */ 60, 64, 63, 62, 61, 312, 3, 102, 378, 157,
/* 190 */ 42, 432, 446, 452, 29, 300, 301, 302, 448, 304,
/* 200 */ 62, 61, 64, 63, 62, 61, 297, 47, 106, 163,
/* 210 */ 434, 435, 436, 437, 27, 389, 117, 391, 155, 154,
/* 220 */ 153, 392, 433, 49, 59, 60, 64, 63, 62, 61,
/* 230 */ 532, 69, 374, 396, 397, 2, 376, 158, 356, 296,
/* 240 */ 156, 156, 156, 67, 392, 433, 13, 59, 60, 4,
/* 250 */ 107, 439, 438, 377, 159, 374, 106, 5, 2, 120,
/* 260 */ 161, 119, 131, 449, 117, 391, 155, 154, 153, 392,
/* 270 */ 532, 6, 59, 60, 439, 438, 532, 444, 422, 532,
/* 280 */ 374, 152, 421, 42, 432, 1, 395, 36, 156, 156,
/* 290 */ 156, 11, 12, 355, 64, 63, 62, 61, 430, 118,
/* 300 */ 14, 106, 138, 434, 435, 436, 437, 432, 428, 117,
/* 310 */ 391, 155, 154, 153, 16, 69, 142, 140, 64, 63,
/* 320 */ 62, 61, 139, 18, 106, 15, 434, 435, 436, 437,
/* 330 */ 45, 44, 117, 391, 155, 154, 153, 358, 19, 55,
/* 340 */ 64, 63, 62, 61, 20, 147, 146, 68, 114, 106,
/* 350 */ 23, 382, 43, 26, 425, 426, 338, 117, 391, 155,
/* 360 */ 154, 153, 392, 57, 58, 59, 60, 390, 380, 375,
/* 370 */ 381, 17, 160, 374, 70, 39, 42, 443, 443, 443,
/* 380 */ 443, 22, 21, 338, 338, 338, 338, 423, 424, 24,
/* 390 */ 443, 145, 141, 429, 142, 140, 64, 63, 62, 61,
/* 400 */ 392, 471, 443, 59, 60, 443, 443, 132, 130, 389,
/* 410 */ 443, 374, 443, 443, 42, 443, 443, 55, 443, 64,
/* 420 */ 63, 62, 61, 147, 146, 392, 143, 443, 59, 60,
/* 430 */ 43, 443, 389, 443, 443, 443, 374, 471, 443, 42,
/* 440 */ 52, 443, 106, 443, 392, 144, 443, 59, 60, 443,
/* 450 */ 117, 391, 155, 154, 153, 374, 443, 443, 42, 22,
/* 460 */ 21, 121, 445, 452, 29, 443, 443, 24, 448, 145,
/* 470 */ 141, 429, 142, 140, 64, 63, 62, 61, 443, 163,
/* 480 */ 106, 443, 392, 442, 27, 59, 60, 443, 117, 391,
/* 490 */ 155, 154, 153, 374, 443, 55, 42, 443, 443, 443,
/* 500 */ 443, 147, 146, 443, 443, 106, 443, 392, 43, 443,
/* 510 */ 59, 60, 443, 117, 391, 155, 154, 153, 102, 443,
/* 520 */ 74, 42, 148, 443, 106, 443, 443, 124, 113, 120,
/* 530 */ 161, 119, 117, 391, 155, 154, 153, 22, 21, 392,
/* 540 */ 443, 443, 59, 60, 443, 24, 443, 145, 141, 429,
/* 550 */ 374, 149, 392, 40, 443, 59, 60, 443, 85, 443,
/* 560 */ 443, 443, 106, 374, 443, 443, 41, 120, 161, 119,
/* 570 */ 117, 391, 155, 154, 153, 349, 349, 349, 349, 349,
/* 580 */ 349, 349, 349, 349, 349, 443, 443, 106, 443, 152,
/* 590 */ 443, 443, 88, 443, 443, 117, 391, 155, 154, 153,
/* 600 */ 443, 120, 161, 119, 72, 443, 148, 10, 477, 477,
/* 610 */ 443, 125, 113, 120, 161, 119, 443, 443, 443, 106,
/* 620 */ 443, 443, 433, 152, 443, 443, 443, 117, 391, 155,
/* 630 */ 154, 153, 106, 443, 443, 149, 64, 63, 62, 61,
/* 640 */ 117, 391, 155, 154, 153, 443, 74, 443, 148, 354,
/* 650 */ 107, 439, 438, 495, 113, 120, 161, 119, 443, 120,
/* 660 */ 161, 119, 443, 461, 443, 74, 443, 148, 75, 443,
/* 670 */ 78, 78, 494, 113, 120, 161, 119, 149, 74, 443,
/* 680 */ 148, 152, 443, 443, 432, 488, 113, 120, 161, 119,
/* 690 */ 74, 443, 148, 443, 443, 443, 149, 482, 113, 120,
/* 700 */ 161, 119, 88, 434, 435, 436, 437, 443, 443, 149,
/* 710 */ 443, 120, 161, 119, 443, 74, 443, 148, 110, 110,
/* 720 */ 443, 149, 481, 113, 120, 161, 119, 443, 443, 443,
/* 730 */ 74, 443, 148, 152, 443, 443, 443, 478, 113, 120,
/* 740 */ 161, 119, 443, 74, 443, 148, 149, 443, 443, 443,
/* 750 */ 134, 113, 120, 161, 119, 74, 443, 148, 443, 443,
/* 760 */ 443, 149, 515, 113, 120, 161, 119, 443, 74, 443,
/* 770 */ 148, 443, 443, 443, 149, 137, 113, 120, 161, 119,
/* 780 */ 74, 443, 148, 443, 443, 443, 149, 523, 113, 120,
/* 790 */ 161, 119, 443, 74, 443, 148, 443, 443, 443, 149,
/* 800 */ 525, 113, 120, 161, 119, 443, 74, 443, 148, 443,
/* 810 */ 443, 149, 443, 522, 113, 120, 161, 119, 74, 443,
/* 820 */ 148, 86, 443, 443, 149, 524, 113, 120, 161, 119,
/* 830 */ 120, 161, 119, 74, 443, 148, 443, 149, 443, 443,
/* 840 */ 521, 113, 120, 161, 119, 443, 74, 443, 148, 149,
/* 850 */ 443, 443, 152, 520, 113, 120, 161, 119, 74, 443,
/* 860 */ 148, 443, 443, 443, 149, 519, 113, 120, 161, 119,
/* 870 */ 443, 74, 443, 148, 443, 443, 443, 149, 518, 113,
/* 880 */ 120, 161, 119, 74, 443, 148, 443, 443, 443, 149,
/* 890 */ 517, 113, 120, 161, 119, 433, 74, 443, 148, 443,
/* 900 */ 443, 443, 149, 150, 113, 120, 161, 119, 443, 74,
/* 910 */ 443, 148, 443, 443, 149, 443, 151, 113, 120, 161,
/* 920 */ 119, 74, 443, 148, 439, 438, 443, 149, 136, 113,
/* 930 */ 120, 161, 119, 443, 443, 443, 74, 443, 148, 443,
/* 940 */ 149, 443, 443, 135, 113, 120, 161, 119, 443, 88,
/* 950 */ 443, 443, 149, 443, 443, 443, 443, 432, 120, 161,
/* 960 */ 119, 443, 443, 443, 443, 82, 443, 149, 443, 443,
/* 970 */ 443, 443, 464, 443, 34, 443, 434, 435, 436, 437,
/* 980 */ 152, 107, 109, 445, 452, 29, 443, 443, 443, 448,
/* 990 */ 120, 161, 119, 443, 461, 443, 443, 88, 443, 443,
/* 1000 */ 163, 443, 566, 443, 443, 27, 120, 161, 119, 88,
/* 1010 */ 443, 443, 152, 111, 111, 443, 443, 443, 120, 161,
/* 1020 */ 119, 98, 443, 443, 89, 473, 443, 90, 152, 443,
/* 1030 */ 120, 161, 119, 120, 161, 119, 120, 161, 119, 87,
/* 1040 */ 152, 443, 443, 64, 63, 62, 61, 443, 120, 161,
/* 1050 */ 119, 443, 152, 443, 443, 152, 443, 443, 152, 443,
/* 1060 */ 443, 443, 99, 443, 50, 443, 443, 443, 100, 443,
/* 1070 */ 152, 120, 161, 119, 443, 101, 443, 120, 161, 119,
/* 1080 */ 91, 443, 443, 443, 120, 161, 119, 103, 443, 120,
/* 1090 */ 161, 119, 92, 152, 443, 443, 120, 161, 119, 152,
/* 1100 */ 443, 120, 161, 119, 443, 93, 152, 443, 443, 443,
/* 1110 */ 104, 152, 443, 443, 120, 161, 119, 94, 152, 120,
/* 1120 */ 161, 119, 105, 152, 443, 443, 120, 161, 119, 443,
/* 1130 */ 443, 120, 161, 119, 95, 443, 152, 443, 443, 443,
/* 1140 */ 96, 152, 443, 120, 161, 119, 443, 443, 152, 120,
/* 1150 */ 161, 119, 97, 152, 443, 443, 443, 443, 546, 443,
/* 1160 */ 443, 120, 161, 119, 443, 152, 443, 120, 161, 119,
/* 1170 */ 443, 152, 443, 443, 443, 545, 443, 443, 443, 443,
/* 1180 */ 443, 544, 443, 152, 120, 161, 119, 543, 443, 152,
/* 1190 */ 120, 161, 119, 115, 443, 443, 120, 161, 119, 116,
/* 1200 */ 443, 443, 120, 161, 119, 443, 152, 443, 120, 161,
/* 1210 */ 119, 443, 152, 64, 63, 62, 61, 443, 152, 64,
/* 1220 */ 63, 62, 61, 443, 152, 443, 353, 443, 443, 443,
/* 1230 */ 152, 64, 63, 62, 61, 64, 63, 62, 61, 443,
/* 1240 */ 53, 443, 443, 443, 394, 64, 63, 62, 61, 64,
/* 1250 */ 63, 62, 61, 443, 443, 443, 56, 443, 393, 443,
/* 1260 */ 443, 443, 389,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 0, 111, 112, 113, 132, 100, 101, 102, 104, 104,
/* 10 */ 10, 111, 112, 113, 109, 110, 111, 112, 113, 104,
/* 20 */ 20, 21, 22, 103, 24, 124, 106, 107, 28, 4,
/* 30 */ 5, 6, 7, 33, 34, 35, 36, 37, 133, 39,
/* 40 */ 40, 41, 42, 103, 44, 45, 106, 107, 105, 49,
/* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
/* 60 */ 60, 61, 62, 63, 0, 111, 112, 113, 128, 129,
/* 70 */ 130, 102, 12, 104, 10, 111, 112, 113, 109, 110,
/* 80 */ 111, 112, 113, 104, 20, 21, 22, 25, 24, 26,
/* 90 */ 27, 48, 28, 111, 112, 113, 126, 33, 34, 35,
/* 100 */ 36, 37, 133, 39, 40, 41, 42, 2, 44, 45,
/* 110 */ 131, 114, 10, 49, 50, 51, 52, 53, 54, 55,
/* 120 */ 56, 57, 58, 59, 60, 61, 62, 63, 1, 2,
/* 130 */ 28, 4, 5, 29, 30, 31, 32, 102, 114, 12,
/* 140 */ 97, 81, 15, 38, 1, 82, 111, 112, 113, 89,
/* 150 */ 115, 24, 89, 26, 27, 12, 127, 14, 31, 32,
/* 160 */ 19, 18, 1, 20, 21, 22, 23, 24, 133, 26,
/* 170 */ 27, 2, 29, 30, 31, 32, 1, 4, 5, 4,
/* 180 */ 5, 4, 5, 6, 7, 8, 16, 12, 26, 27,
/* 190 */ 15, 64, 99, 100, 101, 20, 21, 22, 105, 24,
/* 200 */ 6, 7, 4, 5, 6, 7, 17, 38, 81, 116,
/* 210 */ 83, 84, 85, 86, 121, 17, 89, 90, 91, 92,
/* 220 */ 93, 1, 2, 25, 4, 5, 4, 5, 6, 7,
/* 230 */ 48, 3, 12, 95, 96, 15, 26, 27, 17, 17,
/* 240 */ 20, 21, 22, 43, 1, 2, 25, 4, 5, 15,
/* 250 */ 102, 31, 32, 26, 27, 12, 81, 40, 15, 111,
/* 260 */ 112, 113, 47, 115, 89, 90, 91, 92, 93, 1,
/* 270 */ 88, 40, 4, 5, 31, 32, 94, 0, 41, 97,
/* 280 */ 12, 133, 41, 15, 64, 13, 17, 10, 20, 21,
/* 290 */ 22, 25, 74, 17, 4, 5, 6, 7, 79, 89,
/* 300 */ 3, 81, 78, 83, 84, 85, 86, 64, 79, 89,
/* 310 */ 90, 91, 92, 93, 3, 87, 2, 3, 4, 5,
/* 320 */ 6, 7, 80, 3, 81, 35, 83, 84, 85, 86,
/* 330 */ 16, 38, 89, 90, 91, 92, 93, 76, 3, 25,
/* 340 */ 4, 5, 6, 7, 3, 31, 32, 3, 94, 81,
/* 350 */ 25, 28, 38, 15, 20, 21, 22, 89, 90, 91,
/* 360 */ 92, 93, 1, 15, 15, 4, 5, 17, 28, 12,
/* 370 */ 28, 35, 88, 12, 3, 11, 15, 134, 134, 134,
/* 380 */ 134, 67, 68, 49, 50, 51, 52, 53, 54, 75,
/* 390 */ 134, 77, 78, 79, 2, 3, 4, 5, 6, 7,
/* 400 */ 1, 2, 134, 4, 5, 134, 134, 46, 47, 17,
/* 410 */ 134, 12, 134, 134, 15, 134, 134, 25, 134, 4,
/* 420 */ 5, 6, 7, 31, 32, 1, 2, 134, 4, 5,
/* 430 */ 38, 134, 17, 134, 134, 134, 12, 38, 134, 15,
/* 440 */ 25, 134, 81, 134, 1, 2, 134, 4, 5, 134,
/* 450 */ 89, 90, 91, 92, 93, 12, 134, 134, 15, 67,
/* 460 */ 68, 98, 99, 100, 101, 134, 134, 75, 105, 77,
/* 470 */ 78, 79, 2, 3, 4, 5, 6, 7, 134, 116,
/* 480 */ 81, 134, 1, 120, 121, 4, 5, 134, 89, 90,
/* 490 */ 91, 92, 93, 12, 134, 25, 15, 134, 134, 134,
/* 500 */ 134, 31, 32, 134, 134, 81, 134, 1, 38, 134,
/* 510 */ 4, 5, 134, 89, 90, 91, 92, 93, 12, 134,
/* 520 */ 102, 15, 104, 134, 81, 134, 134, 109, 110, 111,
/* 530 */ 112, 113, 89, 90, 91, 92, 93, 67, 68, 1,
/* 540 */ 134, 134, 4, 5, 134, 75, 134, 77, 78, 79,
/* 550 */ 12, 133, 1, 15, 134, 4, 5, 134, 102, 134,
/* 560 */ 134, 134, 81, 12, 134, 134, 15, 111, 112, 113,
/* 570 */ 89, 90, 91, 92, 93, 64, 65, 66, 67, 68,
/* 580 */ 69, 70, 71, 72, 73, 134, 134, 81, 134, 133,
/* 590 */ 134, 134, 102, 134, 134, 89, 90, 91, 92, 93,
/* 600 */ 134, 111, 112, 113, 102, 134, 104, 117, 118, 119,
/* 610 */ 134, 109, 110, 111, 112, 113, 134, 134, 134, 81,
/* 620 */ 134, 134, 2, 133, 134, 134, 134, 89, 90, 91,
/* 630 */ 92, 93, 81, 134, 134, 133, 4, 5, 6, 7,
/* 640 */ 89, 90, 91, 92, 93, 134, 102, 134, 104, 17,
/* 650 */ 102, 31, 32, 109, 110, 111, 112, 113, 134, 111,
/* 660 */ 112, 113, 134, 115, 134, 102, 134, 104, 48, 134,
/* 670 */ 122, 123, 109, 110, 111, 112, 113, 133, 102, 134,
/* 680 */ 104, 133, 134, 134, 64, 109, 110, 111, 112, 113,
/* 690 */ 102, 134, 104, 134, 134, 134, 133, 109, 110, 111,
/* 700 */ 112, 113, 102, 83, 84, 85, 86, 134, 134, 133,
/* 710 */ 134, 111, 112, 113, 134, 102, 134, 104, 118, 119,
/* 720 */ 134, 133, 109, 110, 111, 112, 113, 134, 134, 134,
/* 730 */ 102, 134, 104, 133, 134, 134, 134, 109, 110, 111,
/* 740 */ 112, 113, 134, 102, 134, 104, 133, 134, 134, 134,
/* 750 */ 109, 110, 111, 112, 113, 102, 134, 104, 134, 134,
/* 760 */ 134, 133, 109, 110, 111, 112, 113, 134, 102, 134,
/* 770 */ 104, 134, 134, 134, 133, 109, 110, 111, 112, 113,
/* 780 */ 102, 134, 104, 134, 134, 134, 133, 109, 110, 111,
/* 790 */ 112, 113, 134, 102, 134, 104, 134, 134, 134, 133,
/* 800 */ 109, 110, 111, 112, 113, 134, 102, 134, 104, 134,
/* 810 */ 134, 133, 134, 109, 110, 111, 112, 113, 102, 134,
/* 820 */ 104, 102, 134, 134, 133, 109, 110, 111, 112, 113,
/* 830 */ 111, 112, 113, 102, 134, 104, 134, 133, 134, 134,
/* 840 */ 109, 110, 111, 112, 113, 134, 102, 134, 104, 133,
/* 850 */ 134, 134, 133, 109, 110, 111, 112, 113, 102, 134,
/* 860 */ 104, 134, 134, 134, 133, 109, 110, 111, 112, 113,
/* 870 */ 134, 102, 134, 104, 134, 134, 134, 133, 109, 110,
/* 880 */ 111, 112, 113, 102, 134, 104, 134, 134, 134, 133,
/* 890 */ 109, 110, 111, 112, 113, 2, 102, 134, 104, 134,
/* 900 */ 134, 134, 133, 109, 110, 111, 112, 113, 134, 102,
/* 910 */ 134, 104, 134, 134, 133, 134, 109, 110, 111, 112,
/* 920 */ 113, 102, 134, 104, 31, 32, 134, 133, 109, 110,
/* 930 */ 111, 112, 113, 134, 134, 134, 102, 134, 104, 134,
/* 940 */ 133, 134, 134, 109, 110, 111, 112, 113, 134, 102,
/* 950 */ 134, 134, 133, 134, 134, 134, 134, 64, 111, 112,
/* 960 */ 113, 134, 134, 134, 134, 118, 134, 133, 134, 134,
/* 970 */ 134, 134, 125, 134, 127, 134, 83, 84, 85, 86,
/* 980 */ 133, 102, 98, 99, 100, 101, 134, 134, 134, 105,
/* 990 */ 111, 112, 113, 134, 115, 134, 134, 102, 134, 134,
/* 1000 */ 116, 134, 123, 134, 134, 121, 111, 112, 113, 102,
/* 1010 */ 134, 134, 133, 118, 119, 134, 134, 134, 111, 112,
/* 1020 */ 113, 102, 134, 134, 102, 118, 134, 102, 133, 134,
/* 1030 */ 111, 112, 113, 111, 112, 113, 111, 112, 113, 102,
/* 1040 */ 133, 134, 134, 4, 5, 6, 7, 134, 111, 112,
/* 1050 */ 113, 134, 133, 134, 134, 133, 134, 134, 133, 134,
/* 1060 */ 134, 134, 102, 134, 25, 134, 134, 134, 102, 134,
/* 1070 */ 133, 111, 112, 113, 134, 102, 134, 111, 112, 113,
/* 1080 */ 102, 134, 134, 134, 111, 112, 113, 102, 134, 111,
/* 1090 */ 112, 113, 102, 133, 134, 134, 111, 112, 113, 133,
/* 1100 */ 134, 111, 112, 113, 134, 102, 133, 134, 134, 134,
/* 1110 */ 102, 133, 134, 134, 111, 112, 113, 102, 133, 111,
/* 1120 */ 112, 113, 102, 133, 134, 134, 111, 112, 113, 134,
/* 1130 */ 134, 111, 112, 113, 102, 134, 133, 134, 134, 134,
/* 1140 */ 102, 133, 134, 111, 112, 113, 134, 134, 133, 111,
/* 1150 */ 112, 113, 102, 133, 134, 134, 134, 134, 102, 134,
/* 1160 */ 134, 111, 112, 113, 134, 133, 134, 111, 112, 113,
/* 1170 */ 134, 133, 134, 134, 134, 102, 134, 134, 134, 134,
/* 1180 */ 134, 102, 134, 133, 111, 112, 113, 102, 134, 133,
/* 1190 */ 111, 112, 113, 102, 134, 134, 111, 112, 113, 102,
/* 1200 */ 134, 134, 111, 112, 113, 134, 133, 134, 111, 112,
/* 1210 */ 113, 134, 133, 4, 5, 6, 7, 134, 133, 4,
/* 1220 */ 5, 6, 7, 134, 133, 134, 17, 134, 134, 134,
/* 1230 */ 133, 4, 5, 6, 7, 4, 5, 6, 7, 134,
/* 1240 */ 25, 134, 134, 134, 17, 4, 5, 6, 7, 4,
/* 1250 */ 5, 6, 7, 134, 134, 134, 25, 134, 17, 134,