You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2001/10/25 10:26:05 UTC
cvs commit: embperl/test/html table.htm
richter 01/10/25 01:26:04
Modified: . Tag: Embperl2c Changes.pod DOM.xs Makefile.PL
embperl.h epcmd2.c epcomp.c epdom.c epdom.h
epeval.c epmain.c test.pl
Embperl Tag: Embperl2c Syntax.pm
Embperl/Syntax Tag: Embperl2c EmbperlHTML.pm
test/html Tag: Embperl2c table.htm
Log:
Embperl 2 - tree structure rewrite
Revision Changes Path
No revision
No revision
1.129.4.31 +4 -0 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.129.4.30
retrieving revision 1.129.4.31
diff -u -r1.129.4.30 -r1.129.4.31
--- Changes.pod 2001/09/20 08:28:56 1.129.4.30
+++ Changes.pod 2001/10/25 08:26:02 1.129.4.31
@@ -17,6 +17,10 @@
versions of Embperl will have the possibility to create custome
recipes to put together a set of processing steps. For now we
only support XSLT. See README.v2 for details.
+ - Add new debug flags dbgOutput, dbgRun, dbgCache, dbgCompile, dbgXML,
+ dbgXSLT, dbgCheckpoint, dbgDOM to have a more fine control what's
+ going into the log file
+ - Removed obsolete debug flags dbgDisableCache and dbgWatchScalar
- Embperl can now be installed as Apache and non Apache version on the
same system. This is neccessary to work on Windows in- and outside of
1.1.2.17 +7 -9 embperl/DOM.xs
Index: DOM.xs
===================================================================
RCS file: /home/cvs/embperl/DOM.xs,v
retrieving revision 1.1.2.16
retrieving revision 1.1.2.17
diff -u -r1.1.2.16 -r1.1.2.17
--- DOM.xs 2001/10/24 14:13:14 1.1.2.16
+++ DOM.xs 2001/10/25 08:26:02 1.1.2.17
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: DOM.xs,v 1.1.2.16 2001/10/24 14:13:14 richter Exp $
+# $Id: DOM.xs,v 1.1.2.17 2001/10/25 08:26:02 richter Exp $
#
###################################################################################
@@ -166,7 +166,6 @@
pDomTree = DomTree_self(pParentNode -> xDomTree) ;
Node_self (pDomTree,pParentNode -> xNode) -> bFlags |= nflgModified | nflgReturn ;
xNewParent = Node_cloneNode (pDomTree, pParentNode -> xNode, 0, 1) ;
- DomTree_selfCheckpoint (pDomTree, pParentNode -> xNode, xNewParent) ;
Node_appendChild (pDomTree, xNewParent, pCurrReq -> nCurrRepeatLevel, nType, 0, sT, nText, 0, 0, NULL) ;
@@ -183,7 +182,6 @@
tDomTree * pDomTree = DomTree_self(xDomTree) ;
Node_self (pDomTree,xParent) -> bFlags |= nflgModified | nflgReturn ;
xNewParent = Node_cloneNode (pDomTree, xParent, 0, 1) ;
- DomTree_selfCheckpoint (pDomTree, xParent, xNewParent) ;
Node_appendChild (pDomTree, xNewParent, pCurrReq -> nCurrRepeatLevel, nType, 0, sT, nText, 0, 0, NULL) ;
@@ -208,18 +206,18 @@
MODULE = XML::Embperl::DOM PACKAGE = XML::Embperl::DOM::Tree PREFIX = embperl_DomTree_
void
-embperl_DomTree_iCheckpoint (xChild)
- int xChild
+embperl_DomTree_iCheckpoint (nCheckpoint)
+ int nCheckpoint
CODE:
pCurrReq -> nCurrEscMode = pCurrReq -> nEscMode ;
pCurrReq -> bEscModeSet = -1 ;
- DomTree_checkpoint (pCurrReq, pCurrReq -> xCurrDomTree, xChild) ;
+ DomTree_checkpoint (pCurrReq, nCheckpoint) ;
void
-embperl_DomTree_iDiscardAfterCheckpoint (xNode)
- int xNode
+embperl_DomTree_iDiscardAfterCheckpoint (nCheckpoint)
+ int nCheckpoint
CODE:
- DomTree_discardAfterCheckpoint (pCurrReq -> xCurrDomTree, xNode, 0) ;
+ DomTree_discardAfterCheckpoint (pCurrReq, nCheckpoint) ;
#void
#Node_parentNode (xChild)
1.31.4.29 +4 -4 embperl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/embperl/Makefile.PL,v
retrieving revision 1.31.4.28
retrieving revision 1.31.4.29
diff -u -r1.31.4.28 -r1.31.4.29
--- Makefile.PL 2001/10/24 14:13:14 1.31.4.28
+++ Makefile.PL 2001/10/25 08:26:02 1.31.4.29
@@ -3,7 +3,7 @@
#
# (C) 1997-2001 G.Richter (richter@dev.ecos.de) / ECOS
#
-# $Id: Makefile.PL,v 1.31.4.28 2001/10/24 14:13:14 richter Exp $
+# $Id: Makefile.PL,v 1.31.4.29 2001/10/25 08:26:02 richter Exp $
#
@@ -627,12 +627,12 @@
$o = '' ;
}
$d = "-DAPACHE" ;
-
+ $EPNOAPACHELIB = 0 ;
}
else
{
$apache = 0 ;
- if ($win32 && ($EPAPACHESRC || $EPNOAPACHELIB))
+ if ($win32 && ($EPAPACHESRC || $EPNOAPACHELIB) && -f 'blib/arch/auto/HTML/Embperl/Embperl.dll')
{
print "\nYou have already build Embperl with support for Apache mod_perl\n" ;
$EPNOAPACHELIB = GetYesNo ("Do you want to build a separate dynamic library for use without Apache?", 'y') ;
@@ -1135,7 +1135,7 @@
'ABSTRACT' => 'Embed Perl code in HTML documents',
'AUTHOR' => 'Gerald Richter <ri...@dev.ecos.de>',
'macro' => $makemacros,
- $EP2?('depend' => { 'Embperl.x' => ['Embperl.xs', 'DOM.xs', 'CMD.xs', 'Syntax.xs'] }):(),
+ $EP2?('depend' => { 'Embperl.c' => 'Embperl.xs DOM.xs CMD.xs Syntax.xs' }):(),
);
1.19.4.8 +5 -3 embperl/embperl.h
Index: embperl.h
===================================================================
RCS file: /home/cvs/embperl/embperl.h,v
retrieving revision 1.19.4.7
retrieving revision 1.19.4.8
diff -u -r1.19.4.7 -r1.19.4.8
--- embperl.h 2001/09/19 10:45:21 1.19.4.7
+++ embperl.h 2001/10/25 08:26:02 1.19.4.8
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: embperl.h,v 1.19.4.7 2001/09/19 10:45:21 richter Exp $
+# $Id: embperl.h,v 1.19.4.8 2001/10/25 08:26:02 richter Exp $
#
###################################################################################*/
@@ -102,9 +102,9 @@
dbgFunc = 4096,
dbgLogLink = 8192,
dbgDefEval = 16384,
- dbgCacheDisable = 0x08000,
+ dbgOutput = 0x08000,
dbgEarlyHttpHeader = 0x10000,
- dbgWatchScalar = 0x20000,
+ dbgRun = 0x20000,
dbgHeadersIn = 0x40000,
dbgShowCleanup = 0x80000,
dbgProfile = 0x100000,
@@ -117,6 +117,8 @@
dbgCompile = 0x8000000,
dbgXML = 0x10000000,
dbgXSLT = 0x20000000,
+ dbgCheckpoint = 0x40000000,
+ dbgDOM = 0x80000000,
dbgAll = -1
} ;
1.4.2.13 +1 -7 embperl/Attic/epcmd2.c
Index: epcmd2.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcmd2.c,v
retrieving revision 1.4.2.12
retrieving revision 1.4.2.13
diff -u -r1.4.2.12 -r1.4.2.13
--- epcmd2.c 2001/10/22 11:59:06 1.4.2.12
+++ epcmd2.c 2001/10/25 08:26:02 1.4.2.13
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epcmd2.c,v 1.4.2.12 2001/10/22 11:59:06 richter Exp $
+# $Id: epcmd2.c,v 1.4.2.13 2001/10/25 08:26:02 richter Exp $
#
###################################################################################*/
@@ -88,8 +88,6 @@
lprintf (r, "[%d]INPU: Has already Attribut: Name: '%*.*s' Value: '%*.*s' Attribute: '%*.*s'\n", r -> nPid, nNameLen, nNameLen, pName, nValLen, nValLen, pVal, nAttrLen, nAttrLen, sAttrName ) ;
if ((pNode -> bFlags & (nflgModified | nflgReturn)) == (nflgModified | nflgReturn) && !bSetInSource)
Element_selfRemoveAttribut (pDomTree, pNode, nRepeatLevel, sAttrName, nAttrLen, 1) ;
- else
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNode -> xNdx) ;
}
else
{
@@ -97,8 +95,6 @@
lprintf (r, "[%d]INPU: No value in %%fdat for Attribut: Name: '%*.*s' Value: '%*.*s' Attribute: '%*.*s'\n", r -> nPid, nNameLen, nNameLen, pName, nValLen, nValLen, pVal, nAttrLen, nAttrLen, sAttrName ) ;
if ((pNode -> bFlags & (nflgModified | nflgReturn)) == (nflgModified | nflgReturn) && bSetInSource)
Element_selfSetAttribut (pDomTree, pNode, nRepeatLevel, sAttrName, nAttrLen, NULL, 0, 1) ;
- else
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNode -> xNdx) ;
}
@@ -203,8 +199,6 @@
pNewNode = pNode ;
pNewNode -> bFlags |= nflgReturn | nflgModified ;
-
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
sArgs = _ep_strdup (r, sArg) ;
if (sArgs && *sArgs != '\0')
1.4.2.62 +32 -24 embperl/Attic/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcomp.c,v
retrieving revision 1.4.2.61
retrieving revision 1.4.2.62
diff -u -r1.4.2.61 -r1.4.2.62
--- epcomp.c 2001/10/22 13:52:16 1.4.2.61
+++ epcomp.c 2001/10/25 08:26:02 1.4.2.62
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epcomp.c,v 1.4.2.61 2001/10/22 13:52:16 richter Exp $
+# $Id: epcomp.c,v 1.4.2.62 2001/10/25 08:26:02 richter Exp $
#
###################################################################################*/
@@ -232,7 +232,7 @@
if (pCmd -> sMayJump && !pInfo -> pEmbperlCmds[nNodeName].sMayJump)
pInfo -> pEmbperlCmds[nNodeName].sMayJump = pCmd -> sMayJump ;
- if (r -> bDebug & dbgParse)
+ if (r -> bDebug & dbgBuildToken)
lprintf (r, "[%d]EPCOMP: InitItem %s (#%d) perlcode=%s (num=%d) perlcodeend=%s compilechilds=%d removenode=%d\n",
r -> nPid, Ndx2String(nNodeName), nNodeName,
pCmd -> sPerlCode?pCmd -> sPerlCode[0]:"",
@@ -794,6 +794,12 @@
int l = sprintf (s, "%u", pDomTree -> xNdx) ;
StringAdd (ppCode, s, l) ;
}
+ else if (*p == 'p')
+ {
+ char s [20] ;
+ int l = sprintf (s, "%u", ArrayGetSize (pDomTree -> pCheckpoints)) ;
+ StringAdd (ppCode, s, l) ;
+ }
}
sPerlCode = q + 1 ;
@@ -949,7 +955,7 @@
int i = l ;
char *p = pCTCode ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d CompileTimeCode: %*.*s\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber, l, l, pCTCode) ;
while (i--)
@@ -983,14 +989,14 @@
char * p = SvPV (r -> pCodeSV, l) ;
StringAdd (r -> pProg, p, l ) ;
StringAdd (r -> pProg, "\n", 1) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Code: %s\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber, p) ;
}
else if (pCode)
{
StringAdd (r -> pProg, pCode, nCodeLen ) ;
StringAdd (r -> pProg, "\n", 1) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Code: %*.*s\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber, nCodeLen, nCodeLen, pCode) ;
}
@@ -1038,7 +1044,7 @@
if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sMayJump, &sStackValue))
{
*bCheckpointPending = -1 ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Set Checkpoint pending\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
@@ -1073,7 +1079,7 @@
{
(*r -> pProg)[nCheckpointCodeOffset] = '#' ;
nCheckpointArrayOffset = ArraySub (&pDomTree -> pCheckpoints, 1) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Remove Checkpoint\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
nCheckpointCodeOffset = 0 ;
*bCheckpointPending = -1 ; /* set checkpoint on next possibility */
@@ -1091,7 +1097,7 @@
l = sprintf (buf, " _ep_cp(%d) ;\n", nCheckpointArrayOffset) ;
nCheckpointCodeOffset = StringAdd (r -> pProg, buf, l) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Checkpoint\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
@@ -1184,7 +1190,7 @@
Ndx2StringLen (pDomTree -> xFilename, sSourcefile, nSourcefile) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d CompileTimeCodeEnd: %*.*s\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber, l, l, pCTCode) ;
while (i--)
@@ -1220,7 +1226,7 @@
{
StringAdd (r -> pProg, p, nCodeLen ) ;
StringAdd (r -> pProg, "\n", 1) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d CodeEnd: %s\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber, p) ;
}
}
@@ -1229,7 +1235,7 @@
{
StringAdd (r -> pProg, pCode, nCodeLen ) ;
StringAdd (r -> pProg, "\n", 1) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d CodeEnd: %*.*s\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber, nCodeLen, nCodeLen, pCode) ;
}
if (nCodeLen == 0)
@@ -1237,7 +1243,7 @@
if (pCmd -> bPerlCodeRemove && nStartCodeOffset)
{
(*r -> pProg)[nStartCodeOffset] = '#' ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Remove Codeblock\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
}
@@ -1245,7 +1251,7 @@
if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sMayJump, &sStackValue))
{
*bCheckpointPending = -1 ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Set Checkpoint pending\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
if (pCmd -> sStackName && (pNode -> nType == ntypStartTag || pNode -> nType == ntypDocument || pNode -> nType == ntypDocumentFraq))
@@ -1269,7 +1275,7 @@
{
r -> pProg = &r -> pProgRun ;
*bCheckpointPending = -1 ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Set Checkpoint pending (switch to ProgRun)\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
}
@@ -1333,7 +1339,7 @@
pCmd = pCmdHead = NULL ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d -------> parent=%d node=%d type=%d text=%s (#%d,%s)\n",
pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber,
Node_parentNode (pDomTree, pNode -> xNdx, 0), pNode -> xNdx,
@@ -1357,7 +1363,7 @@
l = sprintf (buf, " _ep_cp(%d) ;\n", nCheckpointArrayOffset) ;
nCheckpointCodeOffset = StringAdd (r -> pProg, buf, l) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Checkpoint\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
@@ -1473,7 +1479,7 @@
l = sprintf (buf, " _ep_cp(%d) ;\n", nCheckpointArrayOffset) ;
StringAdd (r -> pProg, buf, l) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]EPCOMP: #%d Checkpoint\n", pCurrReq -> nPid, -1) ;
}
@@ -1636,7 +1642,7 @@
r -> nPhase = phRunAfterCompile ;
l = ArrayGetSize (r -> pProgDef) ;
- if (l && pCurrReq -> bDebug & dbgParse)
+ if (l && pCurrReq -> bDebug & dbgCompile)
lprintf (r, "[%d]EPCOMP: AfterCompileTimeCode: %*.*s\n", r -> nPid, l, l, r -> pProgDef) ;
/* pSV = newSVpvf("package %s ; \nmy ($_ep_req, $_ep_DomTree) = @_;\n%*.*s", r -> Buf.sEvalPackage, l,l, r -> pProgDef) ; */
@@ -1813,7 +1819,7 @@
av_push (pSaveAV, newSViv (r -> xCurrNode)) ;
av_push (pSaveAV, newSViv (ArrayGetSize (DomTree_self (xOrgDomTree) -> pOrder))) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgCompile)
lprintf (pCurrReq, "[%d]SUB: Enter from DomTree=%d into DomTree=%d, Source DomTree=%d \n", pCurrReq -> nPid, r -> xCurrDomTree, xOrgDomTree, xDomTree) ;
return r -> xCurrDomTree = xOrgDomTree ;*/ /* DomTree already cloned */
}
@@ -1836,7 +1842,7 @@
sv_setiv (pDomTreeSV, r -> xCurrDomTree) ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgRun)
lprintf (pCurrReq, "[%d]SUB: Enter from DomTree=%d into new DomTree=%d, Source DomTree=%d (org=%d)\n", pCurrReq -> nPid, xOldDomTree, r -> xCurrDomTree, xDomTree, xOrgDomTree) ;
return r -> xCurrDomTree ;
@@ -1867,7 +1873,7 @@
if (AvFILL (pSaveAV) < 1)
return ok ;
- DomTree_checkpoint (r, r -> xCurrDomTree, -1) ;
+ DomTree_checkpoint (r, -1) ;
r -> xCurrDomTree = SvIV (* av_fetch (pSaveAV, 0, 0)) ;
r -> xCurrNode = SvIV (* av_fetch (pSaveAV, 1, 0)) ;
@@ -1879,7 +1885,7 @@
/* Element_selfSetAttribut (pCallerDomTree, Node_self (pCallerDomTree, xDocFraq), NULL, xOrderIndexAttr, NULL, nOrderNdx, 0) ; */
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgRun)
lprintf (pCurrReq, "[%d]SUB: Leave from DomTree=%d back to DomTree=%d\n", pCurrReq -> nPid, xSubDomTree, r -> xCurrDomTree) ;
return ok ;
@@ -1938,9 +1944,9 @@
if (!(r -> xCurrDomTree = DomTree_clone (*pDomTree, &pCurrDomTree, sSubName?1:0)))
return 1 ;
-
av_push (r -> pDomTreeAV, pCurrDomTree -> pDomTreeSV) ;
-
+ pCurrDomTree = DomTree_self (r -> xCurrDomTree) ;
+ ArrayNewZero (&pCurrDomTree -> pCheckpointStatus, ArrayGetSize (pCurrDomTree -> pCheckpoints), sizeof(tDomTreeCheckpointStatus)) ;
if (pCV)
{
@@ -1993,6 +1999,8 @@
sv_setiv (pDomTreeSV, xOldDomTree) ;
}
+
+ ArrayFree (&pCurrDomTree -> pCheckpointStatus) ;
if (rc != ok && rc != rcEvalErr)
return rc ;
1.4.2.57 +158 -154 embperl/Attic/epdom.c
Index: epdom.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epdom.c,v
retrieving revision 1.4.2.56
retrieving revision 1.4.2.57
diff -u -r1.4.2.56 -r1.4.2.57
--- epdom.c 2001/10/24 14:13:15 1.4.2.56
+++ epdom.c 2001/10/25 08:26:02 1.4.2.57
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epdom.c,v 1.4.2.56 2001/10/24 14:13:15 richter Exp $
+# $Id: epdom.c,v 1.4.2.57 2001/10/25 08:26:02 richter Exp $
#
###################################################################################*/
@@ -218,9 +218,27 @@
/* */
/* ArrayNew */
/* */
-/* Create a new dynamic array */
-/* */
-/* ------------------------------------------------------------------------ */
+/*!
+*
+* \_en
+* Create a new dynamic array
+*
+* @param pArray Pointer to pointer that will hold new array
+* @param nAdd Number of items that should be added when array
+* must be extented
+* @param nElementSize Size of one element
+* \endif
+*
+* \_de
+* Erstellt eine neues dynamisches Array
+*
+* @param pArray Zeiger auf den Zeiger der auf das neue Array zeigt
+* @param nAdd Anzahl der Element die hinzugef�gt werden, wenn
+* das Array vergr��ert werden mu�
+* @param nElementSize Gr��e eines Elements
+* \endif
+*
+* ------------------------------------------------------------------------ */
int ArrayNew (/*in*/ const tArray * pArray,
/*in*/ int nAdd,
@@ -245,6 +263,56 @@
/* ------------------------------------------------------------------------ */
/* */
+/* ArrayNewZero */
+/* */
+/*!
+*
+* \_en
+* Create a new dynamic array and set it's content to all zero
+*
+* @param pArray Pointer to pointer that will hold new array
+* @param nAdd Number of items that should be added when array
+* must be extented
+* @param nElementSize Size of one element
+* \endif
+*
+* \_de
+* Erstellt eine neues dynamisches Array und setzt seinen Inhalt auf Null
+*
+* @param pArray Zeiger auf den Zeiger der auf das neue Array zeigt
+* @param nAdd Anzahl der Element die hinzugef�gt werden, wenn
+* das Array vergr��ert werden mu�
+* @param nElementSize Gr��e eines Elements
+* \endif
+*
+* ------------------------------------------------------------------------ */
+
+int ArrayNewZero (/*in*/ const tArray * pArray,
+ /*in*/ int nAdd,
+ /*in*/ int nElementSize)
+
+
+ {
+ struct tArrayCtrl * pNew ;
+
+ if ((pNew = str_malloc (nAdd * nElementSize + sizeof (struct tArrayCtrl))) == NULL)
+ return 0 ;
+
+ memset (pNew, 0, nAdd * nElementSize + sizeof (struct tArrayCtrl)) ;
+ *(void * *)pArray = (struct tArray *)(pNew + 1) ;
+ pNew -> nMax = nAdd ;
+ pNew -> nAdd = nAdd ;
+ pNew -> nFill = 0 ;
+ pNew -> nElementSize = nElementSize ;
+
+ memset (pNew+1, 0, nAdd * nElementSize) ;
+
+ return ok ;
+ }
+
+
+/* ------------------------------------------------------------------------ */
+/* */
/* ArrayFree */
/* */
/* Create a new dynamic array */
@@ -863,12 +931,12 @@
tIndex xDomTree = pDomTree -> xNdx ;
tIndex xNdx ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgDOM)
lprintf (pCurrReq, "[%d]Delete: DomTree = %d SVs=%d\n", pCurrReq -> nPid, pDomTree -> xNdx, sv_count) ;
if (!xDomTree)
{
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgDOM)
lprintf (pCurrReq, "[%d]Delete: Already deleted DomTree = %d SVs=%d\n", pCurrReq -> nPid, pDomTree -> xNdx, sv_count) ;
return ok ;
}
@@ -1040,26 +1108,40 @@
*
* ------------------------------------------------------------------------ */
-void DomTree_checkpoint (tReq * r, tIndex xDomTree, tIndex nRunCheckpoint)
+void DomTree_checkpoint (tReq * r, tIndex nRunCheckpoint)
{
tIndex nCompileCheckpoint = r -> nCurrCheckpoint ;
+ tDomTree * pDomTree = DomTree_self (r -> xCurrDomTree) ;
+ tDomTreeCheckpoint * pCheckpoints = pDomTree -> pCheckpoints ;
+ tDomTreeCheckpointStatus * pCheckpointStatus = &pDomTree -> pCheckpointStatus[nRunCheckpoint] ;
+ pCheckpointStatus -> nRepeatLevel = r -> nCurrRepeatLevel ;
+ pCheckpointStatus -> nCompileCheckpoint = nCompileCheckpoint ;
if (nRunCheckpoint == nCompileCheckpoint)
{
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: ok DomTree=%d %d -> %d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, nRunCheckpoint, sv_count) ;
+ if (pCheckpoints[nCompileCheckpoint].xNode != -1)
+ {
+ tNodeData * pCompileNode = Node_selfLevel (pDomTree, pCheckpoints[nCompileCheckpoint].xNode, r -> nCurrRepeatLevel) ;
+ tNodeData * pPrevNode = Node_selfPreviousSibling (pDomTree, pCompileNode, r -> nCurrRepeatLevel) ;
+
+ if (pPrevNode && pPrevNode -> xNext != pCompileNode -> xNext)
+ {
+ pPrevNode = Node_selfCondCloneNode (pDomTree, pPrevNode, r -> nCurrRepeatLevel) ;
+ pPrevNode -> xNext = pCompileNode -> xNdx ;
+ }
+ }
+
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: ok DomTree=%d %d -> %d SVs=%d\n", pCurrReq -> nPid, r -> xCurrDomTree, nCompileCheckpoint, nRunCheckpoint, sv_count) ;
r -> nCurrCheckpoint++ ;
return ;
}
if (nRunCheckpoint > nCompileCheckpoint)
{
- tDomTree * pDomTree = DomTree_self (xDomTree) ;
- tDomTreeCheckpoint * pCheckpoints = pDomTree -> pCheckpoints ;
-
tNodeData * pCompileNode = Node_selfLevel (pDomTree, pCheckpoints[nCompileCheckpoint].xNode, r -> nCurrRepeatLevel) ;
tNodeData * pRunNode = Node_selfLevel (pDomTree, pCheckpoints[nRunCheckpoint].xNode, r -> nCurrRepeatLevel) ;
tNodeData * pPrevNode = Node_selfPreviousSibling (pDomTree, pCompileNode, r -> nCurrRepeatLevel) ;
@@ -1082,8 +1164,8 @@
pRunNode -> xPrev = pPrevNode -> xNdx ;
pPrevNode -> xNext = pRunNode -> xNdx ;
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: jump forward DomTree=%d Index=%d Node=%d Line=%d -> Index=%d Node=%d Line=%d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunNode -> nLinenumber, sv_count) ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: jump forward DomTree=%d Index=%d Node=%d Line=%d -> Index=%d Node=%d Line=%d SVs=%d\n", pCurrReq -> nPid, r -> xCurrDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunNode -> nLinenumber, sv_count) ;
}
@@ -1118,21 +1200,21 @@
}
pPrevNode -> xNext = Node_selfFirstChild (pDomTree, pCompileParent, r -> nCurrRepeatLevel) -> xNdx ;
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: jump forward2 DomTree=%d Index=%d Node=%d,%d,%d Line=%d -> Index=%d Node=%d,%d,%d Line=%d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pCompileParent -> xNdx, pCompileParent2 -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunParent -> xNdx, pRunParent2 -> xNdx, pRunNode -> nLinenumber, sv_count) ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: jump forward2 DomTree=%d Index=%d Node=%d,%d,%d Line=%d -> Index=%d Node=%d,%d,%d Line=%d SVs=%d\n", pCurrReq -> nPid, r -> xCurrDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pCompileParent -> xNdx, pCompileParent2 -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunParent -> xNdx, pRunParent2 -> xNdx, pRunNode -> nLinenumber, sv_count) ;
}
else
{
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: jump forward2 DomTree=%d Index=%d Node=%d,%d,%d Line=%d -> Index=%d Node=%d,%d,%d Line=%d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pCompileParent -> xNdx, pCompileParent2?pCompileParent2 -> xNdx:-1, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunParent -> xNdx, pRunParent2?pRunParent2 -> xNdx:-1, pRunNode -> nLinenumber, sv_count) ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: jump forward2 DomTree=%d Index=%d Node=%d,%d,%d Line=%d -> Index=%d Node=%d,%d,%d Line=%d SVs=%d\n", pCurrReq -> nPid, r -> xCurrDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pCompileParent -> xNdx, pCompileParent2?pCompileParent2 -> xNdx:-1, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunParent -> xNdx, pRunParent2?pRunParent2 -> xNdx:-1, pRunNode -> nLinenumber, sv_count) ;
mydie ("Unstrutured forward jump") ;
}
}
else
{
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: jump forward DomTree=%d Index=%d Node=%d Line=%d -> Index=%d Node=%d Line=%d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunNode -> nLinenumber, sv_count) ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: jump forward DomTree=%d Index=%d Node=%d Line=%d -> Index=%d Node=%d Line=%d SVs=%d\n", pCurrReq -> nPid, r -> xCurrDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunNode -> nLinenumber, sv_count) ;
mydie ("Unstrutured forward jump (no parents)") ;
}
@@ -1141,9 +1223,6 @@
}
{
- tDomTree * pDomTree = DomTree_self (xDomTree) ;
- tDomTreeCheckpoint * pCheckpoints = pDomTree -> pCheckpoints ;
-
tNodeData * pCompileNode = Node_selfLevel (pDomTree, pCheckpoints[nCompileCheckpoint].xNode, r -> nCurrRepeatLevel) ;
tNodeData * pRunNode = Node_selfLevel (pDomTree, pCheckpoints[nRunCheckpoint].xNode, r -> nCurrRepeatLevel+1) ;
tNodeData * pPrevNode = Node_selfPreviousSibling (pDomTree, pCompileNode, r -> nCurrRepeatLevel) ;
@@ -1168,28 +1247,38 @@
pRunNode -> xPrev = pPrevNode -> xNdx ;
pPrevNode -> xNext = pRunNode -> xNdx ;
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: jump backward DomTree=%d Index=%d Node=%d RepeatLevel=%d Line=%d -> Index=%d Node=%d Line=%d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, pPrevNode -> xNdx, r -> nCurrRepeatLevel, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunNode -> nLinenumber, sv_count) ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: jump backward DomTree=%d Index=%d Node=%d RepeatLevel=%d Line=%d -> Index=%d Node=%d Line=%d SVs=%d\n", pCurrReq -> nPid, r -> xCurrDomTree, nCompileCheckpoint, pPrevNode -> xNdx, r -> nCurrRepeatLevel, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunNode -> nLinenumber, sv_count) ;
}
- else if (pPrevNode -> xNdx == pRunParent -> xNdx)
+ else if (xNode_selfLevelNull(pDomTree,pPrevNode) == xNode_selfLevelNull(pDomTree,pRunParent))
{
pRunNode = Node_selfLastChild (pDomTree, pRunParent, r -> nCurrRepeatLevel) ;
r -> nCurrRepeatLevel++ ;
- Node_selfForceLevel (pDomTree, pPrevNode -> xNdx, r -> nCurrRepeatLevel) ; /* make sure we have a node that points out of the loop */
+ //Node_selfForceLevel (pDomTree, pPrevNode -> xNdx, r -> nCurrRepeatLevel) ; /* make sure we have a node that points out of the loop */
pRunNode = Node_selfCondCloneNode (pDomTree, pRunNode, r -> nCurrRepeatLevel) ;
pRunNode -> xPrev = pPrevNode -> xNdx ;
pPrevNode -> xNext = pRunNode -> xNdx ;
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: jump backward last child DomTree=%d Index=%d Node=%d RepeatLevel=%d Line=%d -> Index=%d Node=%d Line=%d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, pPrevNode -> xNdx, r -> nCurrRepeatLevel, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunNode -> nLinenumber, sv_count) ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: jump backward last child DomTree=%d Index=%d Node=%d(%d) RepeatLevel=%d Line=%d -> Index=%d Node=%d(%d) Line=%d SVs=%d\n",
+ pCurrReq -> nPid, r -> xCurrDomTree,
+ nCompileCheckpoint, pPrevNode -> xNdx, xNode_selfLevelNull(pDomTree,pPrevNode), r -> nCurrRepeatLevel, pPrevNode -> nLinenumber,
+ nRunCheckpoint, pRunNode -> xNdx, xNode_selfLevelNull(pDomTree,pRunNode), pRunNode -> nLinenumber, sv_count) ;
}
else
{
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: jump backward2 DomTree=%d Index=%d Node=%d,%d Line=%d -> Index=%d Node=%d,%d Line=%d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, pPrevNode -> xNdx, pCompileParent -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunParent -> xNdx, pRunNode -> nLinenumber, sv_count) ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: jump backward2 DomTree=%d Index=%d Node=%d(%d),%d(%d) Line=%d -> Index=%d Node=%d(%d),%d(%d) Line=%d SVs=%d\n",
+ pCurrReq -> nPid, r -> xCurrDomTree,
+ nCompileCheckpoint, pPrevNode -> xNdx, xNode_selfLevelNull(pDomTree,pPrevNode),
+ pCompileParent -> xNdx, xNode_selfLevelNull(pDomTree,pCompileParent),
+ pPrevNode -> nLinenumber,
+ nRunCheckpoint, pRunNode -> xNdx, xNode_selfLevelNull(pDomTree,pRunNode),
+ pRunParent -> xNdx, xNode_selfLevelNull(pDomTree,pRunParent),
+ pRunNode -> nLinenumber, sv_count) ;
mydie ("Unstrutured backward jump") ;
}
@@ -1198,109 +1287,52 @@
}
-/* ------------------------------------------------------------------------ */
-/* */
-/* DomTree_selfCheckpoint */
-/* */
-/* Add a new checkpoint to sync the programm execution with the DOM tree */
-/* */
-/* ------------------------------------------------------------------------ */
-
-void DomTree_selfCheckpoint (tDomTree * pDomTree, tNode xFromNode, tNode xToNode)
- {
-#if 0
- if (pCurrReq -> nPhase == phRun || pCurrReq -> nPhase == phTerm)
- {
- int n = ArrayAdd (&pDomTree -> pOrder, 1) ;
- (pDomTree -> pOrder)[n].xFromNode = xFromNode ;
- (pDomTree -> pOrder)[n].xToNode = xToNode ;
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint: DomTree=%d Node=%d -> %d OrderIndex %d SVs=%d\n", pCurrReq -> nPid, pDomTree -> xNdx, xFromNode, xToNode, n, sv_count) ;
- }
-#endif
- }
-
-
-/* ------------------------------------------------------------------------ */
+/*---------------------------------------------------------------------------
/* */
/* DomTree_discardAfterCheckpoint */
/* */
-/* Search for the next checkpoint after xNode and discard all checkpoints */
-/* set after and including that one */
-/* */
-/* ------------------------------------------------------------------------ */
+/*!
+*
+* \_en
+* Discard anything in the tree from the checkpoint given in nRunCheckpoint
+*
+* @param r Embperl request data
+* @param xDomTree current DomTree we are working on
+* @param nRunCheckpoint Number of checkpoint from on which the output should
+* discared
+* \endif
+*
+* \_de
+*
+* Verwrirft alles ab dem in nRunCheckpoint �bergebenen Punkt
+*
+* @param r Embperl Requestdaten
+* @param xDomTree akuteller DomTree der bearbeitet wird
+* @param nRunCheckpoint Nummer des Checkpoints ab dem aller Output
+* verworfen wird
+* \endif
+*
+* ------------------------------------------------------------------------ */
-int DomTree_selfDiscardAfterCheckpoint (/*in*/ tDomTree * pDomTree,
- /*in*/ tNodeData * pNode,
- /*in*/ tNodeData * pArgNode,
- /*in*/ tRepeatLevel nRepeatLevel)
+void DomTree_discardAfterCheckpoint (tReq * r, tIndex nRunCheckpoint)
{
- tNode xNode ;
- tNodeData * pChild ;
- tDomTreeOrder * pOrder ;
- int n ;
- int o ;
-
-
- return 1 ;
-
- if (!pArgNode)
- {
- pArgNode = pNode ;
- pNode = Node_selfFirstChild (pDomTree, pNode, nRepeatLevel) ;
- if (!pNode)
- pNode = Node_selfNextSibling (pDomTree, pArgNode, nRepeatLevel) ;
- }
-
- while (pNode && (pNode -> bFlags & nflgCheckpoint) == 0)
- {
- pChild = Node_selfFirstChild (pDomTree, pNode, nRepeatLevel) ;
- if (pChild)
- if (DomTree_selfDiscardAfterCheckpoint (pDomTree, pChild, pArgNode, nRepeatLevel))
- return 1 ;
-
- pNode = Node_selfNextSibling (pDomTree, pNode, nRepeatLevel) ;
- }
+ tIndex xDomTree = r -> xCurrDomTree ;
+ tDomTree * pDomTree = DomTree_self (xDomTree) ;
+ tDomTreeCheckpointStatus * pCheckpointStatus = &pDomTree -> pCheckpointStatus[nRunCheckpoint] ;
- if (pNode == NULL)
- return 0 ;
+ r -> nCurrRepeatLevel = pCheckpointStatus -> nRepeatLevel ;
+ r -> nCurrCheckpoint = pCheckpointStatus -> nCompileCheckpoint ;
- xNode = pNode -> xNdx ;
+ if (pCurrReq -> bDebug & dbgCheckpoint)
+ lprintf (pCurrReq, "[%d]Checkpoint: discard all from checkpoint=%d DomTree=%d new RepeatLevel=%d new Checkpoint=%d\n",
+ pCurrReq -> nPid, nRunCheckpoint, r -> xCurrDomTree, r -> nCurrRepeatLevel, r -> nCurrCheckpoint) ;
- //mydie ("DomTree_selfDiscardAfterCheckpoint missing") ;
-#if 0
- pOrder = pDomTree -> pOrder ;
- o = n = ArrayGetSize (pOrder) ;
- while (--n >= 0)
- {
- if (pOrder[n].xFromNode == xNode)
- break ;
- }
- ArraySetSize (&pDomTree -> pOrder, n) ;
-#endif
- if (pCurrReq -> bDebug & dbgParse)
- lprintf (pCurrReq, "[%d]Checkpoint Discard: Node=%d Checkpoint=%d OrderIndex %d -> %d\n", pCurrReq -> nPid, pArgNode -> xNdx, xNode, o, n) ;
-
- return 1 ;
}
-
-
-
-int DomTree_discardAfterCheckpoint (/*in*/ tIndex xDomTree,
- /*in*/ tNode xNode,
- /*in*/ tRepeatLevel nRepeatLevel)
-
-
- {
- tDomTree * pDomTree = DomTree_self (xDomTree) ;
- tNodeData * pNode = Node_selfLevel (pDomTree, xNode, nRepeatLevel) ;
- return DomTree_selfDiscardAfterCheckpoint (pDomTree, pNode, NULL, nRepeatLevel) ;
- }
/* ------------------------------------------------------------------------
@@ -1609,6 +1641,7 @@
return NULL ;
pLookupLevelNode -> nMask = 7 ;
pLookupLevelNode -> numItems = 8 ;
+ pLookupLevelNode -> xNullNode = pNode -> xNdx ;
memset (pLookupLevelNode -> items, 0, sizeof (*pLookupLevelNodeLevel) * 8) ;
}
pLookup[pNew -> xNdx].pLookupLevel = pLookupLevelNode ;
@@ -2191,8 +2224,6 @@
pAttr -> bFlags = aflgOK ; /* reset string value flag */
}
- DomTree_selfCheckpoint (pOldChildDomTree, xOrgChild, xOldChild) ;
-
return xOldChild ;
}
@@ -2258,8 +2289,6 @@
else
xOrgNode = pNxtNode -> xNdx ;
- DomTree_selfCheckpoint (pRefNodeDomTree, xOrgNode, pNewNode -> xNdx) ;
-
if (pNewNode -> nType == ntypDocument)
{
pNewNode -> nType = ntypDocumentFraq ;
@@ -2377,8 +2406,6 @@
pOldChild = Node_selfCondCloneNode (pDomTree, Node_selfLevel (pDomTree, xOldChild, nRepeatLevel), nRepeatLevel) ;
- xCheckpointCache[nCheckpointCache++] = xOldChild ;
-
if (pOldChild -> bFlags & nflgModified)
{
pOldChild -> bFlags |= bFlags ;
@@ -2387,12 +2414,6 @@
}
/* *** lprintf (pCurrReq, "rp2--> DomTree New=%d\n", Node_selfDomTree (pOldChild)) ; */
- DomTree_selfCheckpoint (pDomTree, xOrgChild, xOldChild) ;
-
- xCheckpointCache[nCheckpointCache++] = xOldChild ;
- nCheckpointCache &= nCheckpointCacheMask ;
- xCheckpointCache[nCheckpointCache] = 0 ;
-
if (nEscMode != -1)
{
@@ -2688,7 +2709,7 @@
pDomTree = DomTree_self (Element_selfGetAttribut (pDomTree, pNode, NULL, xDomTreeAttr) -> xValue) ;
if (pOrderIndex)
nOrderNdx = pOrderIndex -> xValue ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgOutput)
lprintf (r, "[%d]toString: ** Switch from DomTree=%d to new DomTree=%d (OrderIndex is now %d)\n", r -> nPid, o, pDomTree -> xNdx, nOrderNdx) ;
}
@@ -2712,7 +2733,7 @@
tNodeData * pParent2 = NULL ;
tNodeData * pParent ;
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgOutput)
lprintf (r, "[%d]toString: ** Skip Node=%d to Node=%d (OrderIndex %d)\n", r -> nPid, pNode -> xNdx, xNextNode, nOrderNdx) ;
if (xNextNode == -1)
@@ -2782,7 +2803,7 @@
{
if ((xNextNode = pOrder[i].xToNode) != pNode -> xNdx && xNextNode)
{
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgOutput)
lprintf (r, "[%d]toString: ** Replace Node=%d with Node=%d (OrderIndex %d, initial %d)\n", r -> nPid, pNode -> xNdx, xNextNode, i, nOrderNdx) ;
pSavedNode = pNode ;
pNode = Node_selfLevel (pDomTree, xNextNode, nRepeatLevel) ;
@@ -2795,7 +2816,7 @@
}
else
{
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgOutput)
{
lprintf (r, "[%d]toString: Failed to Replace Node=%d DomTree=%d (initial OrderIndex %d, max = %d)\n", r -> nPid, pNode -> xNdx, pDomTree -> xNdx, nOrderNdx, n-1) ;
/* for (i = nOrderNdx; i < n; i++) */
@@ -2809,7 +2830,7 @@
}
#endif
- if (pCurrReq -> bDebug & dbgParse)
+ if (pCurrReq -> bDebug & dbgOutput)
lprintf (r, "[%d]toString: Node=%d RepeatLevel=%d type=%d flags=%x text=>%s<= (#%d) SVs=%d\n", r -> nPid, pNode -> xNdx, nRepeatLevel, pNode -> nType, pNode -> bFlags, Ndx2String (pNode -> nText), pNode -> nText, sv_count) ;
if (pNode -> bFlags & nflgIgnore)
@@ -3202,11 +3223,7 @@
{
pNewNode = Node_selfCloneNode (pDomTree, pNode, nRepeatLevel, 1) ;
pAttr = Element_selfGetAttribut (pDomTree, pNewNode, sAttrName, nAttrNameLen) ;
-
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
}
- else
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNode -> xNdx) ;
pNode -> bFlags |= nflgReturn | nflgModified ;
}
@@ -3223,11 +3240,6 @@
else
pNewNode = pNode ;
- if (bClone)
- {
- pNode -> bFlags |= nflgReturn | nflgModified ;
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
- }
xAttr = Node_appendChild (pDomTree, pNewNode -> xNdx, nRepeatLevel, ntypAttr, 0, sAttrName, nAttrNameLen, 0, pNewNode -> nLinenumber, NULL) ;
Node_appendChild (pDomTree, xAttr, nRepeatLevel, ntypAttrValue, 0, sNewValue, nNewValueLen, 0, pNewNode -> nLinenumber, NULL) ;
@@ -3264,14 +3276,6 @@
pNewNode = Node_selfCloneNode (pDomTree, pNode, nRepeatLevel, 1) ;
//???? pAttr = Element_selfGetAttribut (pDomTree, pNewNode, sAttrName, nAttrNameLen) ;
-
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNewNode -> xNdx) ;
- }
- else
- {
- pNode -> bFlags |= nflgReturn | nflgModified ;
-
- DomTree_selfCheckpoint (pDomTree, pNode -> xNdx, pNode -> xNdx) ;
}
}
1.4.2.34 +35 -22 embperl/Attic/epdom.h
Index: epdom.h
===================================================================
RCS file: /home/cvs/embperl/Attic/epdom.h,v
retrieving revision 1.4.2.33
retrieving revision 1.4.2.34
diff -u -r1.4.2.33 -r1.4.2.34
--- epdom.h 2001/10/24 14:13:15 1.4.2.33
+++ epdom.h 2001/10/25 08:26:02 1.4.2.34
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epdom.h,v 1.4.2.33 2001/10/24 14:13:15 richter Exp $
+# $Id: epdom.h,v 1.4.2.34 2001/10/25 08:26:02 richter Exp $
#
###################################################################################*/
@@ -166,7 +166,15 @@
typedef struct tDomTreeCheckpoint tDomTreeCheckpoint ;
+struct tDomTreeCheckpointStatus
+ {
+ tRepeatLevel nRepeatLevel ; /**< Repeatlevel when last passed this checkpoint */
+ tIndex nCompileCheckpoint ; /**< r -> nCurrCheckpoint when last passed this checkpoint */
+ } ;
+
+typedef struct tDomTreeCheckpointStatus tDomTreeCheckpointStatus ;
+
struct tRepeatLevelLookupItem
{
tNodeData * pNode ; /* pointer to actual node data */
@@ -196,16 +204,23 @@
struct tDomTree
{
- tLookupItem * pLookup ; /* table for converting tNode and tAttr to pointers */
- tDomTreeCheckpoint * pCheckpoints ; /* checkpoints in the code, to check against execution order when running */
- tIndex xNdx ; /* Index of Dom Tree */
- tNode xDocument ; /* root document node */
- tNode xLastNode ; /* last node that was compiled */
- tNode xCurrNode ; /* curr node that is compiled */
- tIndex xFilename ; /* name of source file */
- SV * pSV ; /* general purpose SV */
- SV * pDomTreeSV ; /* SV that's hold the Index */
- /* Domtree will be deleted when this SV is delted */
+ tLookupItem * pLookup ; /**< \_en table for converting tNode and tAttr to pointers \endif */
+ /**< \_de Tabelle um tNode und tAttr Indexe zu Zeigern umzuwandeln \endif */
+ tDomTreeCheckpoint * pCheckpoints ; /**< \_en checkpoints in the code, to check against execution order when running \endif*/
+ /**< \_de checkpoints im Code. Diese Liste wird wird der Reiehenfolge der
+ tats�chlichen Ausf�hrung verglichen um den DomTree entsprechend zu modifizieren \endif*/
+ tDomTreeCheckpointStatus * pCheckpointStatus ; /**< \_en status of checkpoint while generating new DomTree \endif */
+ /**< \_de Status eines checkpoints w�hrend dem neu Erzeugen eines DomTree \endif */
+ tIndex xNdx ; /**< \_en Index of Dom Tree \endif */
+ /**< \_de Index des Dom Tree \endif */
+ tNode xDocument ; /**< \_en Index of the root document node \endif */
+ /**< \_en Index des Wurzelknotenes des DomTrees \endif */
+ tNode xLastNode ; /**< last node that was compiled */
+ tNode xCurrNode ; /**< curr node that is compiled */
+ tIndex xFilename ; /**< name of source file */
+ SV * pSV ; /**< general purpose SV */
+ SV * pDomTreeSV ; /**< SV that's hold the Index */
+ /**< Domtree will be deleted when this SV is delted */
tUInt16 nLastLinenumber ;
} ;
@@ -250,6 +265,10 @@
/*in*/ int nAdd,
/*in*/ int nElementSize) ;
+int ArrayNewZero (/*in*/ const tArray * pArray,
+ /*in*/ int nAdd,
+ /*in*/ int nElementSize) ;
+
int ArrayFree (/*in*/ const tArray * pArray) ;
int ArraySet (/*in*/ const tArray * pArray,
@@ -286,18 +305,9 @@
int DomTree_new (tDomTree * * pNewLookup) ;
int DomTree_delete (tDomTree * pDomTree) ;
-
-void DomTree_checkpoint (tReq * r, tIndex xDomTree, tIndex nRunCheckpoint) ;
-void DomTree_selfCheckpoint (tDomTree * pDomTree, tNode xFromNode, tNode xToNode) ;
-int DomTree_selfDiscardAfterCheckpoint (/*in*/ tDomTree * pDomTree,
- /*in*/ tNodeData * pNode,
- /*in*/ tNodeData * pArgNode,
- /*in*/ tRepeatLevel nRepeatLevel) ;
-
-int DomTree_discardAfterCheckpoint (/*in*/ tIndex xDomTree,
- /*in*/ tNode xNode,
- /*in*/ tRepeatLevel nRepeatLevel) ;
+void DomTree_checkpoint (tReq * r, tIndex nRunCheckpoint) ;
+void DomTree_discardAfterCheckpoint (tReq * r, tIndex nRunCheckpoint) ;
#define DomTree_SV(pSV) SvIVX(pSV)
#define DomTree_selfSV(pSV) (DomTree_self(SvIVX(pSV)))
@@ -353,6 +363,9 @@
#define Node_self(pDomTree,xNode) ((struct tNodeData *)(pDomTree -> pLookup[xNode].pLookup))
#define Node_selfLevel(pDomTree,xNode,nLevel) (pDomTree -> pLookup[xNode].pLookup?((((struct tNodeData *)(pDomTree -> pLookup[xNode].pLookup)) -> nRepeatLevel == nLevel || pDomTree -> pLookup[xNode].pLookupLevel == NULL)?((struct tNodeData *)(pDomTree -> pLookup[xNode].pLookup)):Node_selfLevelItem(pDomTree,xNode,nLevel)):NULL)
#define Node_selfNotNullLevel(pDomTree,xNode,nLevel) (pDomTree -> pLookup[xNode].pLookup?((((struct tNodeData *)(pDomTree -> pLookup[xNode].pLookup)) -> nRepeatLevel == nLevel || ((struct tNodeData *)(pDomTree -> pLookup[xNode].pLookup)) -> nRepeatLevel != 0 || pDomTree -> pLookup[xNode].pLookupLevel == NULL)?((struct tNodeData *)(pDomTree -> pLookup[xNode].pLookup)):Node_selfLevelItem(pDomTree,xNode,nLevel)):NULL)
+
+#define xNode_selfLevelNull(pDomTree,pNode) ((pDomTree) -> pLookup[(pNode)->xNdx].pLookupLevel?(pDomTree) -> pLookup[(pNode)->xNdx].pLookupLevel -> xNullNode:(pNode) -> xNdx)
+
#define Node_parentNode(pDomTree,xNode,nLevel) (Node_selfLevel(pDomTree,xNode,nLevel)->xParent)
#define Node_selfParentNode(pDomTree,pNode,nLevel) (Node_selfLevel(pDomTree,(pNode)->xParent,nLevel))
1.23.4.10 +1 -4 embperl/epeval.c
Index: epeval.c
===================================================================
RCS file: /home/cvs/embperl/epeval.c,v
retrieving revision 1.23.4.9
retrieving revision 1.23.4.10
diff -u -r1.23.4.9 -r1.23.4.10
--- epeval.c 2001/05/15 14:19:56 1.23.4.9
+++ epeval.c 2001/10/25 08:26:03 1.23.4.10
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epeval.c,v 1.23.4.9 2001/05/15 14:19:56 richter Exp $
+# $Id: epeval.c,v 1.23.4.10 2001/10/25 08:26:03 richter Exp $
#
###################################################################################*/
@@ -539,9 +539,6 @@
return rcEvalErr ;
}
-
- if (r -> bDebug & dbgWatchScalar)
- Watch (r) ;
return ok ;
1.75.4.47 +1 -3 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.75.4.46
retrieving revision 1.75.4.47
diff -u -r1.75.4.46 -r1.75.4.47
--- epmain.c 2001/10/22 06:25:01 1.75.4.46
+++ epmain.c 2001/10/25 08:26:03 1.75.4.47
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epmain.c,v 1.75.4.46 2001/10/22 06:25:01 richter Exp $
+# $Id: epmain.c,v 1.75.4.47 2001/10/25 08:26:03 richter Exp $
#
###################################################################################*/
@@ -382,7 +382,6 @@
OPTMG (dbgFunc , pCurrReq -> bDebug)
OPTMG (dbgLogLink , pCurrReq -> bDebug)
OPTMG (dbgDefEval , pCurrReq -> bDebug)
-OPTMG (dbgWatchScalar , pCurrReq -> bDebug)
OPTMG (dbgHeadersIn , pCurrReq -> bDebug)
OPTMG (dbgShowCleanup , pCurrReq -> bDebug)
OPTMG (dbgProfile , pCurrReq -> bDebug)
@@ -1623,7 +1622,6 @@
ADDOPTMG (dbgFunc )
ADDOPTMG (dbgLogLink )
ADDOPTMG (dbgDefEval )
- ADDOPTMG (dbgWatchScalar )
ADDOPTMG (dbgHeadersIn )
ADDOPTMG (dbgShowCleanup )
ADDOPTMG (dbgProfile )
1.70.4.80 +2 -2 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.70.4.79
retrieving revision 1.70.4.80
diff -u -r1.70.4.79 -r1.70.4.80
--- test.pl 2001/10/17 13:11:23 1.70.4.79
+++ test.pl 2001/10/25 08:26:03 1.70.4.80
@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test.pl,v 1.70.4.79 2001/10/17 13:11:23 richter Exp $
+# $Id: test.pl,v 1.70.4.80 2001/10/25 08:26:03 richter Exp $
#
###################################################################################
@@ -860,7 +860,7 @@
print "\nloading... ";
- $defaultdebug = 0x7fc5ffd ;
+ $defaultdebug = 0xfffc5ffd ;
#$defaultdebug = 1 ;
#### setup paths #####
No revision
No revision
1.1.4.45 +5 -1 embperl/Embperl/Attic/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
retrieving revision 1.1.4.44
retrieving revision 1.1.4.45
diff -u -r1.1.4.44 -r1.1.4.45
--- Syntax.pm 2001/09/18 18:01:46 1.1.4.44
+++ Syntax.pm 2001/10/25 08:26:04 1.1.4.45
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Syntax.pm,v 1.1.4.44 2001/09/18 18:01:46 richter Exp $
+# $Id: Syntax.pm,v 1.1.4.45 2001/10/25 08:26:04 richter Exp $
#
###################################################################################
@@ -685,6 +685,10 @@
=item %$q%
Index of source Dom Tree
+
+=item %$p%
+
+Number of current checkpoint
=item %%
No revision
No revision
1.1.2.8 +7 -7 embperl/Embperl/Syntax/Attic/EmbperlHTML.pm
Index: EmbperlHTML.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/EmbperlHTML.pm,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- EmbperlHTML.pm 2001/09/10 10:06:09 1.1.2.7
+++ EmbperlHTML.pm 2001/10/25 08:26:04 1.1.2.8
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: EmbperlHTML.pm,v 1.1.2.7 2001/09/10 10:06:09 richter Exp $
+# $Id: EmbperlHTML.pm,v 1.1.2.8 2001/10/25 08:26:04 richter Exp $
#
###################################################################################
@@ -84,20 +84,20 @@
$self -> AddTagBlock ('tr', undef, undef, undef,
{
- perlcode => 'l%$x%: for (my $col = 0; $col < $maxcol; $col++) {' ,
+ perlcode => 'l%$p%: for (my $col = 0; $col < $maxcol; $col++) {' ,
perlcodeend => '} %?*-htmlrow%' ,
perlcoderemove => 1,
stackname => 'htmlrow',
- 'push' => '%$x%',
+ 'push' => '%$p%',
mayjump => 1,
}) ;
my %ProcInfoTable = (
- perlcode => 'l%$x%: for (my $row = 0; $row < $maxrow; $row++) {' ,
+ perlcode => 'l%$p%: for (my $row = 0; $row < $maxrow; $row++) {' ,
perlcodeend => '} %?*-htmltable%' ,
perlcoderemove => 1,
stackname => 'htmltable',
- 'push' => '%$x%',
+ 'push' => '%$p%',
mayjump => 1,
) ;
@@ -114,11 +114,11 @@
stackname2 => 'htmlselect',
push2 => '%&*\'name%',
- perlcode => 'l%$x%: for (my $row = 0; $row < $maxrow; $row++) {' ,
+ perlcode => 'l%$p%: for (my $row = 0; $row < $maxrow; $row++) {' ,
perlcodeend => '} %?*-htmltable%' ,
perlcoderemove => 1,
stackname => 'htmltable',
- 'push' => '%$x%',
+ 'push' => '%$p%',
mayjump => 1,
}) ;
# option tag are _not_ added as block, to allow <option> without </option>
No revision
No revision
1.4.6.5 +2 -1 embperl/test/html/table.htm
Index: table.htm
===================================================================
RCS file: /home/cvs/embperl/test/html/table.htm,v
retrieving revision 1.4.6.4
retrieving revision 1.4.6.5
diff -u -r1.4.6.4 -r1.4.6.5
--- table.htm 2001/03/26 10:29:19 1.4.6.4
+++ table.htm 2001/10/25 08:26:04 1.4.6.5
@@ -85,7 +85,7 @@
</tr>
</table>
-<table>
+[#<table>
<tr>
<td>[+ $c[$row] +]</td>
</tr>
@@ -251,3 +251,4 @@
</body>
</html>
+#]
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org