-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathngx_esi_parser.c
1891 lines (1805 loc) · 46.2 KB
/
ngx_esi_parser.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
#line 1 "ngx_esi_parser.rl"
/**
* Copyright (c) 2008 Todd A. Fisher
* see LICENSE
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "ngx_esi_parser.h"
#ifdef DEBUG
static void debug_string( const char *msg, const char *str, size_t len )
{
char *pstr = esi_strndup( str, len );
printf( "%s :'%s'\n", msg, pstr );
free( pstr );
}
#else
#define debug_string(m,s,l)
#endif
/* define default callbacks */
static void
esi_parser_default_start_cb( const void *data,
const char *name_start,
size_t name_length,
ESIAttribute *attributes,
void *user_data )
{
}
static void
esi_parser_default_end_cb( const void *data,
const char *name_start,
size_t name_length,
void *user_data )
{
}
static void
esi_parser_default_output_cp(const void *data,
size_t length,
void *user_data)
{
}
/*
* flush output buffer
*/
static void esi_parser_flush_output( ESIParser *parser )
{
if( parser->output_buffer_size > 0 ) {
//debug_string( "esi_parser_flush_output:", parser->output_buffer, parser->output_buffer_size );
parser->output_handler( (void*)parser->output_buffer, parser->output_buffer_size, parser->user_data );
parser->output_buffer_size = 0;
}
}
/* send the character to the output handler marking it
* as ready for consumption, e.g. not an esi tag
*/
static void esi_parser_echo_char( ESIParser *parser, char ch )
{
parser->output_buffer[parser->output_buffer_size++] = ch;
if( parser->output_buffer_size == ESI_OUTPUT_BUFFER_SIZE ) {
// flush the buffer to the consumer
esi_parser_flush_output( parser );
}
}
/* send any buffered characters to the output handler.
* This happens when we enter a case such as <em> where the
* first two characters < and e match the <esi: expression
*/
static void esi_parser_echo_buffer( ESIParser *parser )
{
size_t i = 0, len = parser->echobuffer_index + 1;;
//debug_string( "echobuffer", parser->echobuffer, parser->echobuffer_index+1 );
//parser->output_handler( parser->echobuffer, parser->echobuffer_index+1, parser->user_data );
for( ; i < len; ++i ) {
esi_parser_echo_char( parser, parser->echobuffer[i] );
}
}
/*
* clear the buffer, no buffered characters should be emitted .
* e.g. we matched an esi tag completely and all buffered characters can be tossed out
*/
static void esi_parser_echobuffer_clear( ESIParser *parser )
{
parser->echobuffer_index = -1;
}
/*
* add a character to the echobuffer.
* this happens when we can't determine if the character is allowed to be sent to the client device
* e.g. matching <e it's not yet determined if these characters are safe to send or not
*/
static void esi_parser_concat_to_echobuffer( ESIParser *parser, char ch )
{
parser->echobuffer_index++;
if( parser->echobuffer_allocated <= parser->echobuffer_index ) {
/* double the echobuffer size
* we're getting some crazy input if this case ever happens
*/
parser->echobuffer_allocated *= 2;
parser->echobuffer = (char*)realloc( parser->echobuffer, parser->echobuffer_allocated );
}
parser->echobuffer[parser->echobuffer_index] = ch;
// debug_string( "echo buffer", parser->echobuffer, parser->echobuffer_index+1 );
}
/*
* the mark boundary is not always going to be exactly on the attribute or tag name boundary
* this trims characters from the left to right, advancing *ptr and reducing *len
*/
static void ltrim_pointer( const char **ptr, const char *bounds, size_t *len )
{
// remove any spaces or = at the before the value
while( (isspace( **ptr ) ||
**ptr == '=' ||
**ptr == '"' ||
**ptr == '<' ||
**ptr == '\'' ) && (*len > 0) && (*ptr != bounds) ) {
(*ptr)++;
(*len)--;
}
}
/*
* similar to ltrim_pointer, this walks from bounds to *ptr, reducing *len
*/
static void rtrim_pointer( const char **ptr, const char *bounds, size_t *len )
{
bounds = (*ptr+(*len-1));
// remove any spaces or = at the before the value
while( (isspace( *bounds ) ||
*bounds == '=' ||
*bounds == '"' ||
*bounds == '>' ||
*bounds == '\'') && (*len > 0) && (*ptr != bounds) ){
bounds--;
(*len)--;
}
}
#line 322 "ngx_esi_parser.rl"
#line 147 "ngx_esi_parser.c"
static const char _esi_eof_actions[] = {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 10, 10, 10, 10
};
static const int esi_start = 75;
static const int esi_first_final = 75;
static const int esi_error = -1;
static const int esi_en_main = 75;
#line 325 "ngx_esi_parser.rl"
/* dup the string up to len */
char *esi_strndup( const char *str, size_t len )
{
char *s = (char*)malloc(sizeof(char)*(len+1));
memcpy( s, str, len );
s[len] = '\0';
return s;
}
ESIAttribute *esi_attribute_new( const char *name, size_t name_length, const char *value, size_t value_length )
{
ESIAttribute *attr = (ESIAttribute*)malloc(sizeof(ESIAttribute));
attr->name = esi_strndup(name, name_length);
attr->value = esi_strndup(value, value_length);
attr->next = NULL;
return attr;
}
ESIAttribute *esi_attribute_copy( ESIAttribute *attribute )
{
ESIAttribute *head, *nattr;
if( !attribute ){ return NULL; }
// copy the first attribute
nattr = esi_attribute_new( attribute->name, strlen( attribute->name ),
attribute->value, strlen( attribute->value ) );
// save a pointer for return
head = nattr;
// copy next attributes
attribute = attribute->next;
while( attribute ) {
// set the next attribute
nattr->next = esi_attribute_new( attribute->name, strlen( attribute->name ),
attribute->value, strlen( attribute->value ) );
// next attribute
nattr = nattr->next;
attribute = attribute->next;
}
return head;
}
void esi_attribute_free( ESIAttribute *attribute )
{
ESIAttribute *ptr;
while( attribute ){
free( attribute->name );
free( attribute->value );
ptr = attribute->next;
free( attribute );
attribute = ptr;
}
}
ESIParser *esi_parser_new()
{
ESIParser *parser = (ESIParser*)malloc(sizeof(ESIParser));
parser->cs = esi_start;
parser->mark = NULL;
parser->tag_text = NULL;
parser->attr_key = NULL;
parser->attr_value = NULL;
parser->overflow_data_size = 0;
parser->overflow_data = NULL;
/* allocate ESI_OUTPUT_BUFFER_SIZE bytes for the echobuffer */
parser->echobuffer_allocated = ESI_OUTPUT_BUFFER_SIZE;
parser->echobuffer_index = -1;
parser->echobuffer = (char*)malloc(sizeof(char)*parser->echobuffer_allocated);
parser->attributes = NULL;
parser->last = NULL;
parser->start_tag_handler = esi_parser_default_start_cb;
parser->end_tag_handler = esi_parser_default_end_cb;
parser->output_handler = esi_parser_default_output_cp;
parser->output_buffer_size = 0;
memset( parser->output_buffer, 0, ESI_OUTPUT_BUFFER_SIZE );
return parser;
}
void esi_parser_free( ESIParser *parser )
{
if( parser->overflow_data ){ free( parser->overflow_data ); }
free( parser->echobuffer );
esi_attribute_free( parser->attributes );
free( parser );
}
void esi_parser_output_handler( ESIParser *parser, esi_output_cb output_handler )
{
parser->output_handler = output_handler;
}
int esi_parser_init( ESIParser *parser )
{
int cs;
#line 269 "ngx_esi_parser.c"
{
cs = esi_start;
}
#line 426 "ngx_esi_parser.rl"
parser->prev_state = parser->cs = cs;
return 0;
}
static int compute_offset( const char *mark, const char *data )
{
if( mark ) {
return mark - data;
}
return -1;
}
/*
* scans the data buffer for a start sequence /<$/, /<e$/, /<es$/, /<esi$/, /<esi:$/
* returns index of if start sequence found else returns -1
*/
static int
esi_parser_scan_for_start( ESIParser *parser, const char *data, size_t length )
{
int i, f = -2, s = -2, len = (int)length;
char ch;
for( i = 0; i < len; ++i ) {
ch = data[i];
switch( ch ) {
case '<':
f = s = i;
break;
case '/':
if( s == (i-1) && f != -2 ) { s = i; }
break;
case 'e':
if( s == (i-1) && f != -2 ) { s = i; }
break;
case 's':
if( s == (i-1) && f != -2 ) { s = i; }
break;
case 'i':
if( s == (i-1) && f != -2 ) { s = i; }
break;
case ':':
if( s == (i-1) && f != -2 ) { s = i; return f; }
break;
default:
f = s = -2;
break;
}
}
// if s and f are still valid at end of input return f
if( f != -2 && s != -2 ) {
return f;
}
else {
return -1;
}
}
/* accept an arbitrary length string buffer
* when this methods exits it determines if an end state was reached
* if no end state was reached it saves the full input into an internal buffer
* when invoked next, it reuses that internable buffer copying all pointers into the
* newly allocated buffer. if it exits in a terminal state, e.g. 0 then it will dump these buffers
*/
int esi_parser_execute( ESIParser *parser, const char *data, size_t length )
{
int cs = parser->cs;
const char *p = data;
const char *eof = NULL; // ragel 6.x compat
const char *pe = data + length;
int pindex;
if( length == 0 || data == 0 ){ return cs; }
/* scan data for any '<esi:' start sequences, /<$/, /<e$/, /<es$/, /<esi$/, /<esi:$/ */
if( cs == 0 ) {
pindex = esi_parser_scan_for_start( parser, data, length );
if( pindex == -1 ) {
for( pindex = 0; pindex < (int)length; ++pindex ) {
esi_parser_echo_char( parser, data[pindex] );
}
return cs;
}
}
/* there's an existing overflow buffer data append the new data to the existing data */
if( parser->overflow_data && parser->overflow_data_size > 0 ) {
// recompute mark, tag_text, attr_key, and attr_value since they all exist within overflow_data
int mark_offset = compute_offset( parser->mark, parser->overflow_data );
int tag_text_offset = compute_offset( parser->tag_text, parser->overflow_data );
int attr_key_offset = compute_offset( parser->attr_key, parser->overflow_data );
int attr_value_offset = compute_offset( parser->attr_value, parser->overflow_data );
parser->overflow_data = (char*)realloc( parser->overflow_data, sizeof(char)*(parser->overflow_data_size+length) );
memcpy( parser->overflow_data+parser->overflow_data_size, data, length );
p = parser->overflow_data + parser->overflow_data_size;
// in our new memory space mark will now be
parser->mark = ( mark_offset >= 0 ) ? parser->overflow_data + mark_offset : NULL;
parser->tag_text = ( tag_text_offset >= 0 ) ? parser->overflow_data + tag_text_offset : NULL;
parser->attr_key = ( attr_key_offset >= 0 ) ? parser->overflow_data + attr_key_offset : NULL;
parser->attr_value = ( attr_value_offset >= 0 ) ? parser->overflow_data + attr_value_offset : NULL;
data = parser->overflow_data;
parser->overflow_data_size = length = length + parser->overflow_data_size;
// printf( "grow overflow data: %ld\n", parser->overflow_data_size );
pe = data + length;
}
if( !parser->mark ) {
parser->mark = p;
}
// printf( "cs: %d, ", cs );
#line 393 "ngx_esi_parser.c"
{
if ( p == pe )
goto _test_eof;
_resume:
switch ( cs ) {
case 75:
if ( (*p) == 60 )
goto tr1;
goto tr0;
case 0:
if ( (*p) == 60 )
goto tr1;
goto tr0;
case 1:
switch( (*p) ) {
case 47: goto tr2;
case 60: goto tr1;
case 101: goto tr3;
}
goto tr0;
case 2:
switch( (*p) ) {
case 60: goto tr1;
case 101: goto tr4;
}
goto tr0;
case 3:
switch( (*p) ) {
case 60: goto tr1;
case 115: goto tr5;
}
goto tr0;
case 4:
switch( (*p) ) {
case 60: goto tr1;
case 105: goto tr6;
}
goto tr0;
case 5:
switch( (*p) ) {
case 58: goto tr7;
case 60: goto tr1;
}
goto tr0;
case 6:
if ( (*p) == 60 )
goto tr1;
if ( 97 <= (*p) && (*p) <= 122 )
goto tr8;
goto tr0;
case 7:
switch( (*p) ) {
case 60: goto tr1;
case 62: goto tr9;
}
if ( 97 <= (*p) && (*p) <= 122 )
goto tr8;
goto tr0;
case 8:
switch( (*p) ) {
case 60: goto tr1;
case 115: goto tr10;
}
goto tr0;
case 9:
switch( (*p) ) {
case 60: goto tr1;
case 105: goto tr11;
}
goto tr0;
case 10:
switch( (*p) ) {
case 58: goto tr12;
case 60: goto tr1;
}
goto tr0;
case 11:
if ( (*p) == 60 )
goto tr1;
if ( 97 <= (*p) && (*p) <= 122 )
goto tr13;
goto tr0;
case 12:
switch( (*p) ) {
case 32: goto tr14;
case 60: goto tr1;
case 62: goto tr15;
}
if ( (*p) > 13 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr13;
} else if ( (*p) >= 9 )
goto tr14;
goto tr0;
case 13:
switch( (*p) ) {
case 32: goto tr16;
case 45: goto tr17;
case 47: goto tr18;
case 60: goto tr1;
case 62: goto tr19;
case 95: goto tr17;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr16;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr17;
} else
goto tr17;
goto tr0;
case 14:
switch( (*p) ) {
case 32: goto tr16;
case 45: goto tr17;
case 47: goto tr18;
case 60: goto tr1;
case 95: goto tr17;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr16;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr17;
} else
goto tr17;
goto tr0;
case 15:
switch( (*p) ) {
case 45: goto tr17;
case 60: goto tr1;
case 61: goto tr20;
case 95: goto tr17;
}
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr17;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr17;
} else
goto tr17;
goto tr0;
case 16:
switch( (*p) ) {
case 32: goto tr21;
case 34: goto tr22;
case 39: goto tr23;
case 60: goto tr1;
}
if ( 9 <= (*p) && (*p) <= 13 )
goto tr21;
goto tr0;
case 17:
switch( (*p) ) {
case 34: goto tr24;
case 60: goto tr25;
case 92: goto tr26;
}
goto tr22;
case 18:
switch( (*p) ) {
case 34: goto tr24;
case 47: goto tr27;
case 60: goto tr25;
case 92: goto tr26;
case 101: goto tr28;
}
goto tr22;
case 19:
switch( (*p) ) {
case 34: goto tr24;
case 60: goto tr25;
case 92: goto tr26;
case 101: goto tr29;
}
goto tr22;
case 20:
switch( (*p) ) {
case 34: goto tr30;
case 60: goto tr25;
case 92: goto tr26;
}
goto tr22;
case 21:
switch( (*p) ) {
case 32: goto tr31;
case 34: goto tr24;
case 45: goto tr32;
case 47: goto tr33;
case 60: goto tr25;
case 62: goto tr34;
case 92: goto tr26;
case 95: goto tr32;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr31;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr32;
} else
goto tr32;
goto tr22;
case 22:
switch( (*p) ) {
case 32: goto tr31;
case 34: goto tr24;
case 45: goto tr32;
case 47: goto tr33;
case 60: goto tr25;
case 92: goto tr26;
case 95: goto tr32;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr31;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr32;
} else
goto tr32;
goto tr22;
case 23:
switch( (*p) ) {
case 34: goto tr24;
case 45: goto tr32;
case 60: goto tr25;
case 61: goto tr35;
case 92: goto tr26;
case 95: goto tr32;
}
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr32;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr32;
} else
goto tr32;
goto tr22;
case 24:
switch( (*p) ) {
case 32: goto tr36;
case 34: goto tr30;
case 39: goto tr37;
case 60: goto tr25;
case 92: goto tr26;
}
if ( 9 <= (*p) && (*p) <= 13 )
goto tr36;
goto tr22;
case 25:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 60: goto tr39;
case 92: goto tr40;
}
goto tr37;
case 26:
switch( (*p) ) {
case 32: goto tr41;
case 39: goto tr24;
case 45: goto tr42;
case 47: goto tr43;
case 60: goto tr44;
case 62: goto tr45;
case 92: goto tr46;
case 95: goto tr42;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr41;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr42;
} else
goto tr42;
goto tr23;
case 27:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
}
goto tr23;
case 28:
switch( (*p) ) {
case 39: goto tr24;
case 47: goto tr47;
case 60: goto tr44;
case 92: goto tr46;
case 101: goto tr48;
}
goto tr23;
case 29:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
case 101: goto tr49;
}
goto tr23;
case 30:
switch( (*p) ) {
case 39: goto tr38;
case 60: goto tr44;
case 92: goto tr46;
}
goto tr23;
case 31:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
case 115: goto tr50;
}
goto tr23;
case 32:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
case 105: goto tr51;
}
goto tr23;
case 33:
switch( (*p) ) {
case 39: goto tr24;
case 58: goto tr52;
case 60: goto tr44;
case 92: goto tr46;
}
goto tr23;
case 34:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
}
if ( 97 <= (*p) && (*p) <= 122 )
goto tr53;
goto tr23;
case 35:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 62: goto tr54;
case 92: goto tr46;
}
if ( 97 <= (*p) && (*p) <= 122 )
goto tr53;
goto tr23;
case 36:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
case 115: goto tr55;
}
goto tr23;
case 37:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
case 105: goto tr56;
}
goto tr23;
case 38:
switch( (*p) ) {
case 39: goto tr24;
case 58: goto tr57;
case 60: goto tr44;
case 92: goto tr46;
}
goto tr23;
case 39:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 92: goto tr46;
}
if ( 97 <= (*p) && (*p) <= 122 )
goto tr58;
goto tr23;
case 40:
switch( (*p) ) {
case 32: goto tr59;
case 39: goto tr24;
case 60: goto tr44;
case 62: goto tr60;
case 92: goto tr46;
}
if ( (*p) > 13 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr58;
} else if ( (*p) >= 9 )
goto tr59;
goto tr23;
case 76:
switch( (*p) ) {
case 39: goto tr100;
case 60: goto tr101;
case 92: goto tr102;
}
goto tr99;
case 41:
switch( (*p) ) {
case 32: goto tr41;
case 39: goto tr24;
case 45: goto tr42;
case 47: goto tr43;
case 60: goto tr44;
case 92: goto tr46;
case 95: goto tr42;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr41;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr42;
} else
goto tr42;
goto tr23;
case 42:
switch( (*p) ) {
case 39: goto tr24;
case 45: goto tr42;
case 60: goto tr44;
case 61: goto tr61;
case 92: goto tr46;
case 95: goto tr42;
}
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr42;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr42;
} else
goto tr42;
goto tr23;
case 43:
switch( (*p) ) {
case 32: goto tr62;
case 34: goto tr37;
case 39: goto tr38;
case 60: goto tr44;
case 92: goto tr46;
}
if ( 9 <= (*p) && (*p) <= 13 )
goto tr62;
goto tr23;
case 44:
switch( (*p) ) {
case 39: goto tr24;
case 60: goto tr44;
case 62: goto tr63;
case 92: goto tr46;
}
goto tr23;
case 45:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 47: goto tr64;
case 60: goto tr39;
case 92: goto tr40;
case 101: goto tr65;
}
goto tr37;
case 46:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 60: goto tr39;
case 92: goto tr40;
case 101: goto tr66;
}
goto tr37;
case 47:
switch( (*p) ) {
case 34: goto tr67;
case 39: goto tr67;
case 60: goto tr39;
case 92: goto tr40;
}
goto tr37;
case 48:
switch( (*p) ) {
case 32: goto tr68;
case 34: goto tr38;
case 39: goto tr30;
case 45: goto tr69;
case 47: goto tr70;
case 60: goto tr39;
case 62: goto tr71;
case 92: goto tr40;
case 95: goto tr69;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr68;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr69;
} else
goto tr69;
goto tr37;
case 49:
switch( (*p) ) {
case 32: goto tr68;
case 34: goto tr38;
case 39: goto tr30;
case 45: goto tr69;
case 47: goto tr70;
case 60: goto tr39;
case 92: goto tr40;
case 95: goto tr69;
}
if ( (*p) < 65 ) {
if ( 9 <= (*p) && (*p) <= 13 )
goto tr68;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr69;
} else
goto tr69;
goto tr37;
case 50:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 45: goto tr69;
case 60: goto tr39;
case 61: goto tr72;
case 92: goto tr40;
case 95: goto tr69;
}
if ( (*p) < 65 ) {
if ( 48 <= (*p) && (*p) <= 57 )
goto tr69;
} else if ( (*p) > 90 ) {
if ( 97 <= (*p) && (*p) <= 122 )
goto tr69;
} else
goto tr69;
goto tr37;
case 51:
switch( (*p) ) {
case 32: goto tr73;
case 34: goto tr67;
case 39: goto tr67;
case 60: goto tr39;
case 92: goto tr40;
}
if ( 9 <= (*p) && (*p) <= 13 )
goto tr73;
goto tr37;
case 52:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 60: goto tr39;
case 62: goto tr74;
case 92: goto tr40;
}
goto tr37;
case 77:
switch( (*p) ) {
case 34: goto tr104;
case 39: goto tr105;
case 60: goto tr106;
case 92: goto tr107;
}
goto tr103;
case 53:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 60: goto tr39;
case 92: goto tr40;
case 115: goto tr75;
}
goto tr37;
case 54:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 60: goto tr39;
case 92: goto tr40;
case 105: goto tr76;
}
goto tr37;
case 55:
switch( (*p) ) {
case 34: goto tr38;
case 39: goto tr30;
case 58: goto tr77;
case 60: goto tr39;
case 92: goto tr40;
}
goto tr37;