Mailing List Archive

cvs commit: embperl embpcgi.bat embpcgi.pl embpcgi.test.bat embpcgi.test.pl embpexec.bat embpexec.pl epparse.c
richter 00/05/02 13:03:12

Modified: . Tag: Embperl2 embpcgi.bat embpcgi.pl
embpcgi.test.bat embpcgi.test.pl embpexec.bat
embpexec.pl epparse.c
Log:
parser

Revision Changes Path
No revision


No revision


1.7.2.1 +2 -2 embperl/embpcgi.bat

Index: embpcgi.bat
===================================================================
RCS file: /home/cvs/embperl/embpcgi.bat,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- embpcgi.bat 2000/04/13 21:36:53 1.7
+++ embpcgi.bat 2000/05/02 20:03:11 1.7.2.1
@@ -1,9 +1,9 @@
@rem = '--*-Perl-*--
@echo off
-/usr/bin/perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+D:\Perl\5.00502\bin\MSWin32-x86\perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
@rem ';
-#!/usr/bin/perl --
+#!D:\Perl\5.00502\bin\MSWin32-x86\perl --
#line 8
###################################################################################
#



1.7.2.1 +1 -1 embperl/embpcgi.pl

Index: embpcgi.pl
===================================================================
RCS file: /home/cvs/embperl/embpcgi.pl,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- embpcgi.pl 2000/04/13 21:36:53 1.7
+++ embpcgi.pl 2000/05/02 20:03:11 1.7.2.1
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!D:\Perl\5.00502\bin\MSWin32-x86\perl
###################################################################################
#
# Embperl - Copyright (c) 1997-1999 Gerald Richter / ECOS



1.5.2.1 +2 -2 embperl/embpcgi.test.bat

Index: embpcgi.test.bat
===================================================================
RCS file: /home/cvs/embperl/embpcgi.test.bat,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- embpcgi.test.bat 2000/04/13 21:36:53 1.5
+++ embpcgi.test.bat 2000/05/02 20:03:11 1.5.2.1
@@ -1,9 +1,9 @@
@rem = '--*-Perl-*--
@echo off
-/usr/bin/perl -x -T %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+D:\Perl\5.00502\bin\MSWin32-x86\perl -x -T %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
@rem ';
-#!/usr/bin/perl --
+#!D:\Perl\5.00502\bin\MSWin32-x86\perl --
#line 8
###################################################################################
#



1.7.2.1 +1 -1 embperl/embpcgi.test.pl

Index: embpcgi.test.pl
===================================================================
RCS file: /home/cvs/embperl/embpcgi.test.pl,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- embpcgi.test.pl 2000/04/13 21:36:53 1.7
+++ embpcgi.test.pl 2000/05/02 20:03:11 1.7.2.1
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!D:\Perl\5.00502\bin\MSWin32-x86\perl
###################################################################################
#
# Embperl - Copyright (c) 1997-1999 Gerald Richter / ECOS



1.18.2.1 +2 -2 embperl/embpexec.bat

Index: embpexec.bat
===================================================================
RCS file: /home/cvs/embperl/embpexec.bat,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -r1.18 -r1.18.2.1
--- embpexec.bat 2000/04/13 21:36:54 1.18
+++ embpexec.bat 2000/05/02 20:03:11 1.18.2.1
@@ -1,9 +1,9 @@
@rem = '--*-Perl-*--
@echo off
-/usr/bin/perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+D:\Perl\5.00502\bin\MSWin32-x86\perl -x %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
@rem ';
-#!/usr/bin/perl --
+#!D:\Perl\5.00502\bin\MSWin32-x86\perl --
#line 8
###################################################################################
#



1.18.2.1 +1 -1 embperl/embpexec.pl

Index: embpexec.pl
===================================================================
RCS file: /home/cvs/embperl/embpexec.pl,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -r1.18 -r1.18.2.1
--- embpexec.pl 2000/04/13 21:36:54 1.18
+++ embpexec.pl 2000/05/02 20:03:11 1.18.2.1
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!D:\Perl\5.00502\bin\MSWin32-x86\perl
###################################################################################
#
# Embperl - Copyright (c) 1997-1999 Gerald Richter / ECOS



1.1.2.2 +50 -22 embperl/Attic/epparse.c

Index: epparse.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epparse.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- epparse.c 2000/05/02 14:28:19 1.1.2.1
+++ epparse.c 2000/05/02 20:03:11 1.1.2.2
@@ -28,10 +28,19 @@
struct tTokenTable
{
unsigned char cStartChars [256/sizeof(unsigned char)] ;
+ unsigned char cAllChars [256/sizeof(unsigned char)] ;
struct tToken * pTokens ;
int numTokens ;
} ;

+
+struct tTokenCmp
+ {
+ char * pStart ;
+ char * pCurr ;
+ int nLen ;
+ } ;
+
/* ------------------------------------------------------------------------ */
/* compare tokens */
/* ------------------------------------------------------------------------ */
@@ -59,16 +68,18 @@


{
- HV * pTokenHash ;
- SV * pToken ;
- HE * pEntry ;
- char * pKey ;
- int numTokens ;
+ HV * pTokenHash ;
+ SV * pToken ;
+ HE * pEntry ;
+ char * pKey ;
+ char * c ;
+ int numTokens ;
struct tToken * pTable ;
- IV l ;
- int n ;
- unsigned char * pStartChars = pTokenTable -> cStartChars ;
struct tToken * p ;
+ IV l ;
+ int n ;
+ unsigned char * pStartChars = pTokenTable -> cStartChars ;
+ unsigned char * pAllChars = pTokenTable -> cAllChars ;

memset (pStartChars, 0, sizeof (pTokenTable -> cStartChars)) ;

@@ -80,19 +91,19 @@

numTokens = 1 ;
hv_iterinit (pTokenHash) ;
- while ((pEntry = hv_iternext (pTokenHash)))
- {
- pKey = hv_iterkey (pEntry, &l) ;
- pToken = hv_iterval (pTokenHash, pEntry) ;
- numTokens++ ;
- }
+ while ((pEntry = hv_iternext (pTokenHash)))
+ {
+ pKey = hv_iterkey (pEntry, &l) ;
+ pToken = hv_iterval (pTokenHash, pEntry) ;
+ numTokens++ ;
+ }

if ((pTable = _malloc (r, sizeof (struct tToken) * numTokens)) == NULL)
return rcOutOfMemory ;

n = 0 ;
hv_iterinit (pTokenHash) ;
- while ((pEntry = hv_iternext (pTokenHash)))
+ while ((pEntry = hv_iternext (pTokenHash)))
{
HV * pHash ;

@@ -102,7 +113,7 @@
if (SvTYPE (pToken) != SVt_RV)
{
strncpy (r -> errdat1, "BuildTokenHash", sizeof (r -> errdat1)) ;
- sprintf (r -> errdat2, "%s, Entry no %d", n + 1) ;
+ sprintf (r -> errdat2, "%s, Entry no %d => %s", n + 1, pKey) ;
LogError (r, rcNotHashRef) ;
return 1 ;
}
@@ -115,7 +126,14 @@
p -> pFollowedBy = NULL ;
p -> pInside = NULL ;

- pStartChars [(*p -> sText) >> 3] |= 1 << (*p -> sText & 7) ;
+ c = p -> sText ;
+ pStartChars [*c >> 3] |= 1 << (*c & 7) ;
+
+ while (*c)
+ {
+ pAllChars [*c >> 3] |= 1 << (*c & 7) ;
+ c++ ;
+ }

if (r -> bDebug & dbgBuildToken)
lprintf (r, "[%d]TOKEN: %s ... %s\n", r -> nPid, p -> sText, p -> sEndText) ;
@@ -148,7 +166,10 @@
/*in*/ const void * p2)

{
- return strncmp (*((const char * *)p1), *((const char * *)p2), ((struct tToken *)p2) -> nTextLen) ;
+ struct tTokenCmp * c = (struct tTokenCmp *)p1 ;
+ printf ("strncmp (%s, %s, %d)\n", c -> pStart, *((const char * *)p2), c -> nLen) ;
+ if (c -> nLen ==
+ return strncmp (c -> pStart, *((const char * *)p2), c -> nLen) ;
}


@@ -169,20 +190,27 @@
struct tToken * pTokenTab = pTokenTable -> pTokens ;
int numTokens = pTokenTable -> numTokens ;
unsigned char * pStartChars = pTokenTable -> cStartChars ;
+ unsigned char * pAllChars = pTokenTable -> cAllChars ;
+ struct tTokenCmp c ;


-
while (pCurr < pEnd)
{
if (pStartChars [*pCurr >> 3] & 1 << (*pCurr & 7))
{
- char * pStart = pCurr ;
- struct tToken * pToken = NULL ;
+ struct tToken * pToken = NULL ;
struct tToken * pNext ;

+ c.pCurr = pCurr ;
+ c.pStart = pCurr ;
+
do
{
- if (pToken = (struct tToken *)bsearch (&pCurr, pTokenTab, numTokens, sizeof (struct tToken), CmpTokenN))
+ while (pAllChars [*c.pCurr >> 3] & 1 << (*c.pCurr & 7))
+ c.pCurr++ ;
+
+ c.nLen = c.pCurr - c.pStart ;
+ if (pToken = (struct tToken *)bsearch (&c, pTokenTab, numTokens, sizeof (struct tToken), CmpTokenN))
{
pNext = pToken + 1;