Permalink
Browse files

Generalization work

  • Loading branch information...
1 parent d39c2cf commit 6b4c369164e638afcc916a3d6693547a1d5140a8 @zsuraski zsuraski committed Oct 29, 2000
Showing with 106 additions and 481 deletions.
  1. +3 −3 Zend/Makefile.am
  2. +25 −9 Zend/ZendTS.dsp
  3. +4 −3 Zend/zend_globals.h
  4. +5 −0 Zend/zend_ini.h
  5. +32 −426 Zend/zend_ini_parser.y
  6. +37 −40 Zend/zend_ini_scanner.l
View
@@ -42,13 +42,13 @@ zend_language_parser.c: $(srcdir)/zend_language_parser.y
# INI parser/scanner rules
zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
- $(YACC) -p ini -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c
+ $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c
zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
- $(LEX) -Pini -o$@ -i $(srcdir)/zend_ini_scanner.l
+ $(LEX) -Pini_ -o$@ -i $(srcdir)/zend_ini_scanner.l
zend_ini_scanner_cc.cc: $(srcdir)/zend_ini_scanner.l
- $(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pini -o$@ $(srcdir)/zend_ini_scanner.l
+ $(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pini_ -o$@ $(srcdir)/zend_ini_scanner.l
depend:
View
@@ -163,6 +163,14 @@ SOURCE=.\zend_ini.c
# End Source File
# Begin Source File
+SOURCE=.\zend_ini_parser.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\zend_ini_scanner.cpp
+# End Source File
+# Begin Source File
+
SOURCE=".\zend_language_parser.c"
# End Source File
# Begin Source File
@@ -291,6 +299,14 @@ SOURCE=.\zend_ini.h
# End Source File
# Begin Source File
+SOURCE=.\zend_ini_parser.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\zend_ini_scanner.h
+# End Source File
+# Begin Source File
+
SOURCE=".\zend_language_parser.h"
# End Source File
# Begin Source File
@@ -336,8 +352,8 @@ InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
- if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend_ini zend_ini_parser.y \
- if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend_ini zend_ini_parser.y \
+ if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
+ if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -354,8 +370,8 @@ InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
- if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend_ini zend_ini_parser.y \
- if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend_ini zend_ini_parser.y \
+ if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
+ if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -372,8 +388,8 @@ InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
- if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend_ini zend_ini_parser.y \
- if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend_ini zend_ini_parser.y \
+ if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
+ if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -461,7 +477,7 @@ SOURCE=.\zend_ini_scanner.l
InputPath=.\zend_ini_scanner.l
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -+ -B -i -Sflex.skl -Pzend_ini -ozend_ini_scanner.cpp zend_ini_scanner.l
+ flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
# End Custom Build
@@ -471,7 +487,7 @@ InputPath=.\zend_ini_scanner.l
InputPath=.\zend_ini_scanner.l
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -+ -B -i -Sflex.skl -Pzend_ini -ozend_ini_scanner.cpp zend_ini_scanner.l
+ flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
# End Custom Build
@@ -481,7 +497,7 @@ InputPath=.\zend_ini_scanner.l
InputPath=.\zend_ini_scanner.l
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- flex -+ -B -i -Sflex.skl -Pzend_ini -ozend_ini_scanner.cpp zend_ini_scanner.l
+ flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
# End Custom Build
View
@@ -40,6 +40,7 @@
#ifdef __cplusplus
class ZendFlexLexer;
+class ZendIniFlexLexer;
#endif
BEGIN_EXTERN_C()
@@ -107,12 +108,12 @@ struct _zend_compiler_globals {
zend_bool unclean_shutdown;
zend_llist open_files;
-#ifdef ZTS
-#ifdef __cplusplus
+#if defined(ZTS) && defined(__cplusplus)
ZendFlexLexer *ZFL;
+ ZendIniFlexLexer *ini_scanner;
#else
void *ZFL;
-#endif
+ void *ini_parser;
#endif
};
View
@@ -156,4 +156,9 @@ ZEND_API ZEND_INI_MH(OnUpdateStringUnempty);
#define ZEND_INI_STAGE_DEACTIVATE (1<<3)
#define ZEND_INI_STAGE_RUNTIME (1<<4)
+/* INI parsing engine */
+int zend_parse_ini_file(zend_file_handle *fh, void (*zend_ini_parser_cb)(zval *arg1, zval *arg2, int callback_type));
+#define ZEND_INI_PARSER_ENTRY 1
+#define ZEND_INI_PARSER_SECTION 2
+
#endif /* ZEND_INI_H */
Oops, something went wrong.

0 comments on commit 6b4c369

Please sign in to comment.