forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zend_ini_scanner.c
4735 lines (4663 loc) · 104 KB
/
zend_ini_scanner.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
/* Generated by re2c 0.13.5 */
#line 1 "Zend/zend_ini_scanner.l"
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Zeev Suraski <[email protected]> |
| Jani Taskinen <[email protected]> |
| Marcus Boerger <[email protected]> |
| Nuno Lopes <[email protected]> |
| Scott MacVicar <[email protected]> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <errno.h>
#include "zend.h"
#include "zend_API.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
#ifdef YYDEBUG
#undef YYDEBUG
#endif
#if 0
# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
#else
# define YYDEBUG(s, c)
#endif
#include "zend_ini_scanner_defs.h"
#define YYCTYPE unsigned char
/* allow the scanner to read one null byte after the end of the string (from ZEND_MMAP_AHEAD)
* so that if will be able to terminate to match the current token (e.g. non-enclosed string) */
#define YYFILL(n) { if (YYCURSOR > YYLIMIT) return 0; }
#define YYCURSOR SCNG(yy_cursor)
#define YYLIMIT SCNG(yy_limit)
#define YYMARKER SCNG(yy_marker)
#define YYGETCONDITION() SCNG(yy_state)
#define YYSETCONDITION(s) SCNG(yy_state) = s
#define STATE(name) yyc##name
/* emulate flex constructs */
#define BEGIN(state) YYSETCONDITION(STATE(state))
#define YYSTATE YYGETCONDITION()
#define yytext ((char*)SCNG(yy_text))
#define yyleng SCNG(yy_leng)
#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
yyleng = (unsigned int)x; } while(0)
/* #define yymore() goto yymore_restart */
/* perform sanity check. If this message is triggered you should
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
#define YYMAXFILL 6
#if ZEND_MMAP_AHEAD < (YYMAXFILL + 1)
# error ZEND_MMAP_AHEAD should be greater than YYMAXFILL
#endif
/* How it works (for the core ini directives):
* ===========================================
*
* 1. Scanner scans file for tokens and passes them to parser.
* 2. Parser parses the tokens and passes the name/value pairs to the callback
* function which stores them in the configuration hash table.
* 3. Later REGISTER_INI_ENTRIES() is called which triggers the actual
* registering of ini entries and uses zend_get_configuration_directive()
* to fetch the previously stored name/value pair from configuration hash table
* and registers the static ini entries which match the name to the value
* into EG(ini_directives) hash table.
* 4. PATH section entries are used per-request from down to top, each overriding
* previous if one exists. zend_alter_ini_entry() is called for each entry.
* Settings in PATH section are ZEND_INI_SYSTEM accessible and thus mimics the
* php_admin_* directives used within Apache httpd.conf when PHP is compiled as
* module for Apache.
* 5. User defined ini files (like .htaccess for apache) are parsed for each request and
* stored in separate hash defined by SAPI.
*/
/* TODO: (ordered by importance :-)
* ===============================================================================
*
* - Separate constant lookup totally from plain strings (using CONSTANT pattern)
* - Add #if .. #else .. #endif and ==, !=, <, > , <=, >= operators
* - Add #include "some.ini"
* - Allow variables to refer to options also when using parse_ini_file()
*
*/
/* Globals Macros */
#define SCNG INI_SCNG
#ifdef ZTS
ZEND_API ts_rsrc_id ini_scanner_globals_id;
#else
ZEND_API zend_ini_scanner_globals ini_scanner_globals;
#endif
/* Eat leading whitespace */
#define EAT_LEADING_WHITESPACE() \
while (yyleng) { \
if (yytext[0] == ' ' || yytext[0] == '\t') { \
SCNG(yy_text)++; \
yyleng--; \
} else { \
break; \
} \
}
/* Eat trailing whitespace + extra char */
#define EAT_TRAILING_WHITESPACE_EX(ch) \
while (yyleng && ( \
(ch != 'X' && yytext[yyleng - 1] == ch) || \
yytext[yyleng - 1] == '\n' || \
yytext[yyleng - 1] == '\r' || \
yytext[yyleng - 1] == '\t' || \
yytext[yyleng - 1] == ' ') \
) { \
yyleng--; \
}
/* Eat trailing whitespace */
#define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X')
#define zend_ini_copy_value(retval, str, len) \
ZVAL_NEW_STR(retval, zend_string_init(str, len, 1))
#define RETURN_TOKEN(type, str, len) { \
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
zend_ini_copy_typed_value(ini_lval, type, str, len); \
} else { \
zend_ini_copy_value(ini_lval, str, len); \
} \
return type; \
}
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
{
zend_uchar type;
int overflow;
zend_long lval;
double dval;
if ((type = is_numeric_string_ex(str, str_len, &lval, &dval, 0, &overflow)) != 0) {
if (type == IS_LONG) {
ZVAL_LONG(retval, lval);
return SUCCESS;
} else if (type == IS_DOUBLE && !overflow) {
ZVAL_DOUBLE(retval, dval);
return SUCCESS;
}
}
return FAILURE;
}
static void zend_ini_copy_typed_value(zval *retval, const int type, const char *str, int len)
{
switch (type) {
case BOOL_FALSE:
case BOOL_TRUE:
ZVAL_BOOL(retval, type == BOOL_TRUE);
break;
case NULL_NULL:
ZVAL_NULL(retval);
break;
case TC_NUMBER:
if (convert_to_number(retval, str, len) == SUCCESS) {
break;
}
/* intentional fall-through */
default:
zend_ini_copy_value(retval, str, len);
}
}
static void _yy_push_state(int new_state)
{
zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION());
YYSETCONDITION(new_state);
}
#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
static void yy_pop_state(void)
{
int *stack_state = zend_stack_top(&SCNG(state_stack));
YYSETCONDITION(*stack_state);
zend_stack_del_top(&SCNG(state_stack));
}
static void yy_scan_buffer(char *str, unsigned int len)
{
YYCURSOR = (YYCTYPE*)str;
SCNG(yy_start) = YYCURSOR;
YYLIMIT = YYCURSOR + len;
}
#define ini_filename SCNG(filename)
/* {{{ init_ini_scanner()
*/
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh)
{
/* Sanity check */
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
zend_error(E_WARNING, "Invalid scanner mode");
return FAILURE;
}
SCNG(lineno) = 1;
SCNG(scanner_mode) = scanner_mode;
SCNG(yy_in) = fh;
if (fh != NULL) {
ini_filename = zend_strndup(fh->filename, strlen(fh->filename));
} else {
ini_filename = NULL;
}
zend_stack_init(&SCNG(state_stack), sizeof(int));
BEGIN(INITIAL);
return SUCCESS;
}
/* }}} */
/* {{{ shutdown_ini_scanner()
*/
void shutdown_ini_scanner(void)
{
zend_stack_destroy(&SCNG(state_stack));
if (ini_filename) {
free(ini_filename);
}
}
/* }}} */
/* {{{ zend_ini_scanner_get_lineno()
*/
ZEND_COLD int zend_ini_scanner_get_lineno(void)
{
return SCNG(lineno);
}
/* }}} */
/* {{{ zend_ini_scanner_get_filename()
*/
ZEND_COLD char *zend_ini_scanner_get_filename(void)
{
return ini_filename ? ini_filename : "Unknown";
}
/* }}} */
/* {{{ zend_ini_open_file_for_scanning()
*/
int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode)
{
char *buf;
size_t size;
if (zend_stream_fixup(fh, &buf, &size) == FAILURE) {
return FAILURE;
}
if (init_ini_scanner(scanner_mode, fh) == FAILURE) {
zend_file_handle_dtor(fh);
return FAILURE;
}
yy_scan_buffer(buf, (unsigned int)size);
return SUCCESS;
}
/* }}} */
/* {{{ zend_ini_prepare_string_for_scanning()
*/
int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode)
{
int len = (int)strlen(str);
if (init_ini_scanner(scanner_mode, NULL) == FAILURE) {
return FAILURE;
}
yy_scan_buffer(str, len);
return SUCCESS;
}
/* }}} */
/* {{{ zend_ini_escape_string()
*/
static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type)
{
register char *s, *t;
char *end;
zend_ini_copy_value(lval, str, len);
/* convert escape sequences */
s = t = Z_STRVAL_P(lval);
end = s + Z_STRLEN_P(lval);
while (s < end) {
if (*s == '\\') {
s++;
if (s >= end) {
*t++ = '\\';
continue;
}
switch (*s) {
case '"':
if (*s != quote_type) {
*t++ = '\\';
*t++ = *s;
break;
}
case '\\':
case '$':
*t++ = *s;
Z_STRLEN_P(lval)--;
break;
default:
*t++ = '\\';
*t++ = *s;
break;
}
} else {
*t++ = *s;
}
if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
SCNG(lineno)++;
}
s++;
}
*t = 0;
}
/* }}} */
int ini_lex(zval *ini_lval)
{
restart:
SCNG(yy_text) = YYCURSOR;
/* yymore_restart: */
/* detect EOF */
if (YYCURSOR >= YYLIMIT) {
if (YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW)) {
BEGIN(INITIAL);
return END_OF_LINE;
}
return 0;
}
/* Eat any UTF-8 BOM we find in the first 3 bytes */
if (YYCURSOR == SCNG(yy_start) && YYCURSOR + 3 < YYLIMIT) {
if (memcmp(YYCURSOR, "\xef\xbb\xbf", 3) == 0) {
YYCURSOR += 3;
goto restart;
}
}
#line 385 "Zend/zend_ini_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if (YYGETCONDITION() < 4) {
if (YYGETCONDITION() < 2) {
if (YYGETCONDITION() < 1) {
goto yyc_INITIAL;
} else {
goto yyc_ST_OFFSET;
}
} else {
if (YYGETCONDITION() < 3) {
goto yyc_ST_SECTION_VALUE;
} else {
goto yyc_ST_VALUE;
}
}
} else {
if (YYGETCONDITION() < 6) {
if (YYGETCONDITION() < 5) {
goto yyc_ST_SECTION_RAW;
} else {
goto yyc_ST_DOUBLE_QUOTES;
}
} else {
if (YYGETCONDITION() < 7) {
goto yyc_ST_VARNAME;
} else {
goto yyc_ST_RAW;
}
}
}
/* *********************************** */
yyc_INITIAL:
{
static const unsigned char yybm[] = {
144, 144, 144, 144, 144, 144, 144, 144,
144, 160, 0, 144, 144, 0, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
240, 128, 128, 144, 128, 144, 128, 144,
128, 128, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 128, 144, 128, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 128, 144, 144, 128, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 128, 128, 128, 128, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
144, 144, 144, 144, 144, 144, 144, 144,
};
YYDEBUG(0, *YYCURSOR);
YYFILL(5);
yych = *YYCURSOR;
YYDEBUG(-1, yych);
switch (yych) {
case '\t': goto yy4;
case '\n': goto yy6;
case '\r': goto yy8;
case ' ': goto yy9;
case '!':
case '"':
case '$':
case '&':
case '(':
case ')':
case '^':
case '{':
case '|':
case '}':
case '~': goto yy10;
case '%':
case '\'':
case '*':
case '+':
case ',':
case '-':
case '.':
case '/':
case ':':
case '<':
case '>':
case '?':
case '@':
case ']': goto yy12;
case ';': goto yy13;
case '=': goto yy15;
case 'F':
case 'f': goto yy17;
case 'N':
case 'n': goto yy18;
case 'O':
case 'o': goto yy19;
case 'T':
case 't': goto yy20;
case 'Y':
case 'y': goto yy21;
case '[': goto yy22;
default: goto yy2;
}
yy2:
YYDEBUG(2, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
goto yy25;
yy3:
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 481 "Zend/zend_ini_scanner.l"
{ /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
/* Eat trailing whitespace */
EAT_TRAILING_WHITESPACE();
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
}
#line 523 "Zend/zend_ini_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
goto yy63;
yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 627 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
#line 537 "Zend/zend_ini_scanner.c"
yy6:
YYDEBUG(6, *YYCURSOR);
++YYCURSOR;
yy7:
YYDEBUG(7, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 632 "Zend/zend_ini_scanner.l"
{
SCNG(lineno)++;
return END_OF_LINE;
}
#line 549 "Zend/zend_ini_scanner.c"
yy8:
YYDEBUG(8, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == '\n') goto yy66;
goto yy7;
yy9:
YYDEBUG(9, *YYCURSOR);
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x1F) {
if (yych <= '\n') {
if (yych <= 0x08) goto yy25;
if (yych <= '\t') goto yy62;
goto yy66;
} else {
if (yych == '\r') goto yy67;
goto yy25;
}
} else {
if (yych <= ';') {
if (yych <= ' ') goto yy64;
if (yych <= ':') goto yy25;
goto yy57;
} else {
if (yych == '=') goto yy55;
goto yy25;
}
}
yy10:
YYDEBUG(10, *YYCURSOR);
++YYCURSOR;
YYDEBUG(11, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 555 "Zend/zend_ini_scanner.l"
{ /* Disallow these chars outside option values */
return yytext[0];
}
#line 587 "Zend/zend_ini_scanner.c"
yy12:
YYDEBUG(12, *YYCURSOR);
yych = *++YYCURSOR;
goto yy25;
yy13:
YYDEBUG(13, *YYCURSOR);
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
goto yy58;
YYDEBUG(14, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 648 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 603 "Zend/zend_ini_scanner.c"
yy15:
YYDEBUG(15, *YYCURSOR);
++YYCURSOR;
yych = *YYCURSOR;
goto yy56;
yy16:
YYDEBUG(16, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 491 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
yy_push_state(ST_RAW);
} else {
yy_push_state(ST_VALUE);
}
return '=';
}
#line 621 "Zend/zend_ini_scanner.c"
yy17:
YYDEBUG(17, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'A') goto yy52;
if (yych == 'a') goto yy52;
goto yy25;
yy18:
YYDEBUG(18, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'U') {
if (yych == 'O') goto yy43;
if (yych <= 'T') goto yy25;
goto yy44;
} else {
if (yych <= 'o') {
if (yych <= 'n') goto yy25;
goto yy43;
} else {
if (yych == 'u') goto yy44;
goto yy25;
}
}
yy19:
YYDEBUG(19, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= 'N') {
if (yych == 'F') goto yy37;
if (yych <= 'M') goto yy25;
goto yy30;
} else {
if (yych <= 'f') {
if (yych <= 'e') goto yy25;
goto yy37;
} else {
if (yych == 'n') goto yy30;
goto yy25;
}
}
yy20:
YYDEBUG(20, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'R') goto yy35;
if (yych == 'r') goto yy35;
goto yy25;
yy21:
YYDEBUG(21, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy26;
if (yych == 'e') goto yy26;
goto yy25;
yy22:
YYDEBUG(22, *YYCURSOR);
++YYCURSOR;
YYDEBUG(23, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 406 "Zend/zend_ini_scanner.l"
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
yy_push_state(ST_SECTION_RAW);
} else {
yy_push_state(ST_SECTION_VALUE);
}
return TC_SECTION;
}
#line 687 "Zend/zend_ini_scanner.c"
yy24:
YYDEBUG(24, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
yy25:
YYDEBUG(25, *YYCURSOR);
if (yybm[0+yych] & 16) {
goto yy24;
}
if (yych == '[') goto yy27;
goto yy3;
yy26:
YYDEBUG(26, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'S') goto yy30;
if (yych == 's') goto yy30;
goto yy25;
yy27:
YYDEBUG(27, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(28, *YYCURSOR);
if (yybm[0+yych] & 32) {
goto yy27;
}
YYDEBUG(29, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 431 "Zend/zend_ini_scanner.l"
{ /* Start of option with offset */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
/* Eat trailing whitespace and [ */
EAT_TRAILING_WHITESPACE_EX('[');
/* Enter offset lookup state */
yy_push_state(ST_OFFSET);
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
#line 730 "Zend/zend_ini_scanner.c"
yy30:
YYDEBUG(30, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(31, *YYCURSOR);
if (yybm[0+yych] & 64) {
goto yy30;
}
if (yych <= '\'') {
if (yych <= ' ') {
if (yych <= '\n') {
if (yych <= 0x08) goto yy24;
if (yych <= '\t') goto yy33;
} else {
if (yych != '\r') goto yy24;
}
} else {
if (yych <= '$') {
if (yych == '#') goto yy24;
} else {
if (yych != '&') goto yy24;
}
}
} else {
if (yych <= 'Z') {
if (yych <= ';') {
if (yych <= ')') goto yy32;
if (yych <= ':') goto yy24;
} else {
if (yych != '=') goto yy24;
}
} else {
if (yych <= '^') {
if (yych <= '[') goto yy27;
if (yych <= ']') goto yy24;
} else {
if (yych <= 'z') goto yy24;
if (yych >= 0x7F) goto yy24;
}
}
}
yy32:
YYDEBUG(32, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 469 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
#line 780 "Zend/zend_ini_scanner.c"
yy33:
YYDEBUG(33, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(34, *YYCURSOR);
if (yych == '\t') goto yy33;
if (yych == ' ') goto yy33;
goto yy32;
yy35:
YYDEBUG(35, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'U') goto yy36;
if (yych != 'u') goto yy25;
yy36:
YYDEBUG(36, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy30;
if (yych == 'e') goto yy30;
goto yy25;
yy37:
YYDEBUG(37, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'F') goto yy38;
if (yych != 'f') goto yy25;
yy38:
YYDEBUG(38, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(39, *YYCURSOR);
if (yych <= '&') {
if (yych <= 0x1F) {
if (yych <= '\n') {
if (yych <= 0x08) goto yy24;
if (yych <= '\t') goto yy41;
} else {
if (yych != '\r') goto yy24;
}
} else {
if (yych <= '#') {
if (yych <= ' ') goto yy38;
if (yych >= '#') goto yy24;
} else {
if (yych == '%') goto yy24;
}
}
} else {
if (yych <= '=') {
if (yych <= ':') {
if (yych <= '\'') goto yy24;
if (yych >= '*') goto yy24;
} else {
if (yych == '<') goto yy24;
}
} else {
if (yych <= ']') {
if (yych == '[') goto yy27;
goto yy24;
} else {
if (yych <= '^') goto yy40;
if (yych <= 'z') goto yy24;
if (yych >= 0x7F) goto yy24;
}
}
}
yy40:
YYDEBUG(40, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 473 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
#line 854 "Zend/zend_ini_scanner.c"
yy41:
YYDEBUG(41, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(42, *YYCURSOR);
if (yych == '\t') goto yy41;
if (yych == ' ') goto yy41;
goto yy40;
yy43:
YYDEBUG(43, *YYCURSOR);
yych = *++YYCURSOR;
if (yych <= '\'') {
if (yych <= 0x1F) {
if (yych <= '\n') {
if (yych <= 0x08) goto yy25;
if (yych <= '\t') goto yy41;
goto yy40;
} else {
if (yych == '\r') goto yy40;
goto yy25;
}
} else {
if (yych <= '#') {
if (yych <= ' ') goto yy38;
if (yych <= '"') goto yy40;
goto yy25;
} else {
if (yych == '%') goto yy25;
if (yych <= '&') goto yy40;
goto yy25;
}
}
} else {
if (yych <= 'N') {
if (yych <= ';') {
if (yych <= ')') goto yy40;
if (yych <= ':') goto yy25;
goto yy40;
} else {
if (yych == '=') goto yy40;
if (yych <= 'M') goto yy25;
goto yy51;
}
} else {
if (yych <= 'm') {
if (yych == '^') goto yy40;
goto yy25;
} else {
if (yych <= 'n') goto yy51;
if (yych <= 'z') goto yy25;
if (yych <= '~') goto yy40;
goto yy25;
}
}
}
yy44:
YYDEBUG(44, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'L') goto yy45;
if (yych != 'l') goto yy25;
yy45:
YYDEBUG(45, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'L') goto yy46;
if (yych != 'l') goto yy25;
yy46:
YYDEBUG(46, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(47, *YYCURSOR);
if (yych <= '&') {
if (yych <= 0x1F) {
if (yych <= '\n') {
if (yych <= 0x08) goto yy24;
if (yych <= '\t') goto yy49;
} else {
if (yych != '\r') goto yy24;
}
} else {
if (yych <= '#') {
if (yych <= ' ') goto yy46;
if (yych >= '#') goto yy24;
} else {
if (yych == '%') goto yy24;
}
}
} else {
if (yych <= '=') {
if (yych <= ':') {
if (yych <= '\'') goto yy24;
if (yych >= '*') goto yy24;
} else {
if (yych == '<') goto yy24;
}
} else {
if (yych <= ']') {
if (yych == '[') goto yy27;
goto yy24;
} else {
if (yych <= '^') goto yy48;
if (yych <= 'z') goto yy24;
if (yych >= 0x7F) goto yy24;
}
}
}
yy48:
YYDEBUG(48, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 477 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(NULL_NULL, "", 0);
}
#line 969 "Zend/zend_ini_scanner.c"
yy49:
YYDEBUG(49, *YYCURSOR);
++YYCURSOR;
YYFILL(1);
yych = *YYCURSOR;
YYDEBUG(50, *YYCURSOR);
if (yych == '\t') goto yy49;
if (yych == ' ') goto yy49;
goto yy48;
yy51:
YYDEBUG(51, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy38;
if (yych == 'e') goto yy38;
goto yy25;
yy52:
YYDEBUG(52, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'L') goto yy53;
if (yych != 'l') goto yy25;
yy53:
YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'S') goto yy54;
if (yych != 's') goto yy25;
yy54:
YYDEBUG(54, *YYCURSOR);
yych = *++YYCURSOR;
if (yych == 'E') goto yy38;
if (yych == 'e') goto yy38;
goto yy25;
yy55: