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/22 15:52:16 UTC

cvs commit: embperl DOM.xs epcomp.c epdat.h epdom.c epdom.h

richter     01/10/22 06:52:16

  Modified:    .        Tag: Embperl2c DOM.xs epcomp.c epdat.h epdom.c
                        epdom.h
  Log:
  Embperl 2 - tree structure rewrite
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.15  +2 -11     embperl/DOM.xs
  
  Index: DOM.xs
  ===================================================================
  RCS file: /home/cvs/embperl/DOM.xs,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- DOM.xs	2001/10/22 06:25:01	1.1.2.14
  +++ DOM.xs	2001/10/22 13:52:15	1.1.2.15
  @@ -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.14 2001/10/22 06:25:01 richter Exp $
  +#   $Id: DOM.xs,v 1.1.2.15 2001/10/22 13:52:15 richter Exp $
   #
   ###################################################################################
   
  @@ -208,21 +208,12 @@
   MODULE = XML::Embperl::DOM      PACKAGE = XML::Embperl::DOM::Tree     PREFIX = embperl_DomTree_
   
   void
  -embperl_DomTree_XXiCheckpoint (xDomTree, xChild)
  -    int xDomTree
  -    int xChild
  -CODE:
  -    pCurrReq -> nCurrEscMode = pCurrReq -> nEscMode ;
  -    pCurrReq -> bEscModeSet = -1 ;
  -    DomTree_checkpoint (xDomTree, xChild) ;
  -
  -void
   embperl_DomTree_iCheckpoint (xChild)
       int xChild
   CODE:
       pCurrReq -> nCurrEscMode = pCurrReq -> nEscMode ;
       pCurrReq -> bEscModeSet = -1 ;
  -    DomTree_checkpoint (pCurrReq -> xCurrDomTree, xChild) ;
  +    DomTree_checkpoint (pCurrReq, pCurrReq -> xCurrDomTree, xChild) ;
   
   void
   embperl_DomTree_iDiscardAfterCheckpoint (xNode)
  
  
  
  1.4.2.61  +31 -24    embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.4.2.60
  retrieving revision 1.4.2.61
  diff -u -r1.4.2.60 -r1.4.2.61
  --- epcomp.c	2001/10/22 06:25:01	1.4.2.60
  +++ epcomp.c	2001/10/22 13:52:16	1.4.2.61
  @@ -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.60 2001/10/22 06:25:01 richter Exp $
  +#   $Id: epcomp.c,v 1.4.2.61 2001/10/22 13:52:16 richter Exp $
   #
   ###################################################################################*/
   
  @@ -1021,6 +1021,7 @@
   			 /*in*/  tNodeData *	pNode,
   			 /*in*/  tEmbperlCmd *	pCmd,
   			 /*in*/  int		nCheckpointCodeOffset,
  +			 /*in*/  int		nCheckpointArrayOffset,
   			 /*i/o*/ int *		bCheckpointPending)
   
   
  @@ -1071,7 +1072,8 @@
       if (nCheckpointCodeOffset && (pNode -> bFlags == 0 || (pNode -> bFlags & nflgIgnore)))
   	{
   	(*r -> pProg)[nCheckpointCodeOffset] = '#' ;
  -	if (pCurrReq -> bDebug & dbgParse)
  +	nCheckpointArrayOffset = ArraySub (&pDomTree -> pCheckpoints, 1) ;
  +        if (pCurrReq -> bDebug & dbgParse)
   	    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 */
  @@ -1083,12 +1085,11 @@
   	char buf [80] ;
   
   	pNode -> bFlags |= nflgCheckpoint ;
  -	/* l = sprintf (buf, " _ep_cp($_ep_DomTree,%d) ;\n", *bCheckpointPending<0?pNode -> xNdx:*bCheckpointPending) ; */
  -	/* l = sprintf (buf, " _ep_cp($_ep_DomTree,%d) ;\n", pNode -> xNdx) ; */
  -	l = sprintf (buf, " _ep_cp(%d) ;\n", pNode -> xNdx) ;
  -	/* l = sprintf (buf, " $_ep_cp=%d;\n", pNode -> xNdx) ; */
  -	nCheckpointCodeOffset = StringAdd (r -> pProg, buf,	l) ;
  +	nCheckpointArrayOffset = ArrayAdd (&pDomTree -> pCheckpoints, 1) ;
  +	pDomTree -> pCheckpoints[nCheckpointArrayOffset].xNode = pNode -> xNdx ;
   	*bCheckpointPending = 0 ;
  +	l = sprintf (buf, " _ep_cp(%d) ;\n", nCheckpointArrayOffset) ;
  +	nCheckpointCodeOffset = StringAdd (r -> pProg, buf,	l) ;
   
   	if (pCurrReq -> bDebug & dbgParse)
   	    lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Checkpoint\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
  @@ -1315,6 +1316,7 @@
       int             nAttr = 0 ;
       int		    nStartCodeOffset = 0 ;               
       int		    nCheckpointCodeOffset = 0 ;               
  +    int		    nCheckpointArrayOffset = 0 ;               
       tEmbperlCompilerInfo * pInfo = (tEmbperlCompilerInfo *)(*(void * *)r -> pTokenTable) ;
   
       pCmd = NULL ;
  @@ -1349,12 +1351,11 @@
   	char buf [80] ;
   	
   	pNode -> bFlags |= nflgCheckpoint ;
  -	/* l = sprintf (buf, " _ep_cp($_ep_DomTree,%d) ;\n", *bCheckpointPending<0?pNode -> xNdx:*bCheckpointPending) ; */
  -	/* l = sprintf (buf, " _ep_cp($_ep_DomTree,%d) ;\n", pNode -> xNdx) ; */
  -	l = sprintf (buf, " _ep_cp(%d) ;\n", xNode) ;
  -	/* l = sprintf (buf, " $_ep_cp=%d;\n", pNode -> xNdx) ; */
  -	nCheckpointCodeOffset = StringAdd (r -> pProg, buf,  l) ; 
  +	nCheckpointArrayOffset = ArrayAdd (&pDomTree -> pCheckpoints, 1) ;
  +	pDomTree -> pCheckpoints[nCheckpointArrayOffset].xNode = xNode ;
   	*bCheckpointPending = 0 ;
  +	l = sprintf (buf, " _ep_cp(%d) ;\n", nCheckpointArrayOffset) ;
  +	nCheckpointCodeOffset = StringAdd (r -> pProg, buf,  l) ; 
   
   	if (pCurrReq -> bDebug & dbgParse)
   	    lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Checkpoint\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ; 
  @@ -1364,6 +1365,7 @@
       if (pCmd && pCmd -> nSwitchCodeType == 2)
           {
           r -> pProg = &r -> pProgDef ;
  +        nCheckpointArrayOffset = 0 ;
           nCheckpointCodeOffset = 0 ;
           }
   	
  @@ -1399,7 +1401,7 @@
   
       pCmd = pCmdHead ;
       if (pCmd)
  -        if ((rc = embperl_CompilePostProcess (r, pDomTree, pNode, pCmd, nCheckpointCodeOffset, bCheckpointPending)) != ok)
  +        if ((rc = embperl_CompilePostProcess (r, pDomTree, pNode, pCmd, nCheckpointCodeOffset, nCheckpointArrayOffset, bCheckpointPending)) != ok)
   	    return rc ;
   
   
  @@ -1461,20 +1463,20 @@
       if ((rc = embperl_CompileNode (r, pDomTree, pDomTree -> xDocument, &bCheckpointPending)) != ok)
   	return rc ;
   
  -#if 0
       if (bCheckpointPending)
   	{
   	int l ;
   	char buf [80] ;
  -	
  -	l = sprintf (buf, " _ep_cp(%d) ;\n", -1) ; /* xNode) ; */
  -	StringAdd (r -> pProg, buf,  l) ; 
   
  +	int nCheckpointArrayOffset = ArrayAdd (&pDomTree -> pCheckpoints, 1) ;
  +	pDomTree -> pCheckpoints[nCheckpointArrayOffset].xNode = -1 ;
  +	l = sprintf (buf, " _ep_cp(%d) ;\n", nCheckpointArrayOffset) ;
  +	StringAdd (r -> pProg, buf,	l) ;
  +
   	if (pCurrReq -> bDebug & dbgParse)
  -	    lprintf (pCurrReq, "[%d]EPCOMP: #%d L%s Checkpoint\n", pCurrReq -> nPid, -1, "end") ; 
  -	
  +	    lprintf (pCurrReq, "[%d]EPCOMP: #%d  Checkpoint\n", pCurrReq -> nPid, -1) ;
  +
   	}
  -#endif
       
       return ok ;
       }
  @@ -1601,7 +1603,10 @@
       r -> pProg = &r -> pProgRun ;
   
       pDomTree -> pSV = (SV *)newHV () ;
  -    
  +    ArrayNew (&pDomTree -> pCheckpoints, 256, sizeof (tDomTreeCheckpoint)) ;
  +    ArrayAdd (&pDomTree -> pCheckpoints, 1) ;
  +    pDomTree -> pCheckpoints[0].xNode = 0 ;
  +
       if ((rc = embperl_CompileDomTree (r, pProcessor, pDomTree)) != ok)
   	{
           /*
  @@ -1823,7 +1828,8 @@
       if (!(r -> xCurrDomTree  = DomTree_clone (pDomTree, &pCurrDomTree, 1)))
   	    return 0 ;
       
  -    av_push (pSaveAV, newSViv (ArrayGetSize (pCurrDomTree -> pOrder))) ;
  +    mydie ("pOrder missing in exexcut sub start") ;
  +    //av_push (pSaveAV, newSViv (ArrayGetSize (pCurrDomTree -> pOrder))) ;
   
       av_push (r -> pDomTreeAV, pCurrDomTree -> pDomTreeSV) ;
       av_push (r -> pCleanupAV, newRV_inc (pDomTreeSV)) ;
  @@ -1861,7 +1867,7 @@
       if (AvFILL (pSaveAV) < 1)
   	return ok ;
       
  -    DomTree_checkpoint (r -> xCurrDomTree, -1) ;
  +    DomTree_checkpoint (r, r -> xCurrDomTree, -1) ;
   
       r -> xCurrDomTree = SvIV (* av_fetch (pSaveAV, 0, 0)) ;
       r -> xCurrNode    = SvIV (* av_fetch (pSaveAV, 1, 0)) ;
  @@ -1926,6 +1932,8 @@
       	r -> nPhase  = phRun ;
   
   	    
  +        r -> nCurrCheckpoint = 1 ;
  +        r -> nCurrRepeatLevel = 0 ;
   	r -> xSourceDomTree = r -> xCurrDomTree ;
   	if (!(r -> xCurrDomTree  = DomTree_clone (*pDomTree, &pCurrDomTree, sSubName?1:0)))
   	    return 1 ;
  @@ -1983,7 +1991,6 @@
   		}
       #endif    
   
  -	    DomTree_checkpoint (r -> xCurrDomTree, -1) ;
   	    sv_setiv (pDomTreeSV, xOldDomTree) ;
   	    }
   
  
  
  
  1.20.4.27 +2 -1      embperl/epdat.h
  
  Index: epdat.h
  ===================================================================
  RCS file: /home/cvs/embperl/epdat.h,v
  retrieving revision 1.20.4.26
  retrieving revision 1.20.4.27
  diff -u -r1.20.4.26 -r1.20.4.27
  --- epdat.h	2001/10/22 06:25:01	1.20.4.26
  +++ epdat.h	2001/10/22 13:52:16	1.20.4.27
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdat.h,v 1.20.4.26 2001/10/22 06:25:01 richter Exp $
  +#   $Id: epdat.h,v 1.20.4.27 2001/10/22 13:52:16 richter Exp $
   #
   ###################################################################################*/
   
  @@ -419,6 +419,7 @@
       tNode	xDocument ;	/* Document node */
       tNode	xCurrNode ;	/* node that was last executed */
       tRepeatLevel nCurrRepeatLevel ; /* repeat level for node that was last executed */
  +    tIndex      nCurrCheckpoint ; /* next checkpoint that should be passed if execution order is unchanged (i.e. no loop/if) */
       tIndex	xCurrDomTree ;	/* DomTree we are currently working on */
       tIndex	xSourceDomTree ;/* DomTree which contains the source */
   #endif
  
  
  
  1.4.2.53  +116 -32   embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.4.2.52
  retrieving revision 1.4.2.53
  diff -u -r1.4.2.52 -r1.4.2.53
  --- epdom.c	2001/10/22 11:59:06	1.4.2.52
  +++ epdom.c	2001/10/22 13:52:16	1.4.2.53
  @@ -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.52 2001/10/22 11:59:06 richter Exp $
  +#   $Id: epdom.c,v 1.4.2.53 2001/10/22 13:52:16 richter Exp $
   #
   ###################################################################################*/
   
  @@ -255,12 +255,14 @@
   
   
       {
  -    struct tArrayCtrl * pCtrl = ((struct tArrayCtrl *)(*(void * *)pArray)) - 1 ;
  +    if ((*(void * *)pArray))
  +        {
  +        struct tArrayCtrl * pCtrl = ((struct tArrayCtrl *)(*(void * *)pArray)) - 1 ;
   
  -    if (pCtrl)
           str_free (pCtrl) ;
   
  -    (*(void * *)pArray) = NULL ;
  +        (*(void * *)pArray) = NULL ;
  +        }
   
       return ok ;
       }
  @@ -278,17 +280,23 @@
   
   
       {
  -    struct tArrayCtrl * pNew ;
  -    struct tArrayCtrl * pCtrl = ((struct tArrayCtrl *)(*(void * *)pOrgArray)) - 1 ;
  -    int    size = pCtrl -> nFill * pCtrl -> nElementSize + sizeof (struct tArrayCtrl) ;
  +    if (pOrgArray)
  +        {
  +        struct tArrayCtrl * pNew ;
  +        struct tArrayCtrl * pCtrl = ((struct tArrayCtrl *)(*(void * *)pOrgArray)) - 1 ;
  +        int    size = pCtrl -> nFill * pCtrl -> nElementSize + sizeof (struct tArrayCtrl) ;
       
  -    if ((pNew = str_malloc (size)) == NULL)
  -	return 0 ;
  +        if ((pNew = str_malloc (size)) == NULL)
  +	    return 0 ;
       
  -    memcpy (pNew, pCtrl, size) ; 
  -    *(void * *)pNewArray = (struct tArray *)(pNew + 1) ;
  -    pNew -> nMax = pCtrl -> nFill ;
  -
  +        memcpy (pNew, pCtrl, size) ; 
  +        *(void * *)pNewArray = (struct tArray *)(pNew + 1) ;
  +        pNew -> nMax = pCtrl -> nFill ;
  +        }
  +    else
  +        {
  +        *(void * *)pNewArray = NULL ;
  +        }
       return ok ;
       }
   
  @@ -832,7 +840,7 @@
       ArrayNew (&pDomTree -> pLookup, 256, sizeof (tLookupItem)) ; 
       ArrayAdd (&pDomTree -> pLookup, 1) ;
   
  -    ArrayNew (&pDomTree -> pOrder, 256, sizeof (tDomTreeOrder)) ; 
  +    pDomTree -> pCheckpoints = NULL ;
   
       *pNewLookup = pDomTree  ;
   
  @@ -906,7 +914,7 @@
   
   
       ArrayFree (&pDomTree -> pLookup) ;
  -    ArrayFree (&pDomTree -> pOrder) ;
  +    ArrayFree (&pDomTree -> pCheckpoints) ;
       
       if (pDomTree -> pSV)
   	SvREFCNT_dec (pDomTree -> pSV) ;
  @@ -976,8 +984,8 @@
       pDomTree -> xDocument = pOrgDomTree -> xDocument ;
       pDomTree -> xFilename = pOrgDomTree -> xFilename ;
   
  -    ArrayClone (pOrgDomTree, &pDomTree -> pLookup) ; 
  -    ArrayNew (&pDomTree -> pOrder, 128, sizeof (tDomTreeOrder)) ; 
  +    ArrayClone (&pOrgDomTree -> pLookup, &pDomTree -> pLookup) ; 
  +    ArrayClone (&pOrgDomTree -> pCheckpoints, &pDomTree -> pCheckpoints) ; 
   
       if (pDomTree -> pSV = pOrgDomTree -> pSV)
           SvREFCNT_inc (pDomTree -> pSV) ;
  @@ -1010,23 +1018,92 @@
   /*                                                                          */
   /* DomTree_checkpoint                                                       */
   /*                                                                          */
  -/* Add a new checkpoint to sync the programm execution with the DOM tree    */
  +/* Compare checkpoint from programm execution with list build during        */
  +/* compilation and change the DomTree and repeat level accordingly          */
   /*                                                                          */
   /* ------------------------------------------------------------------------ */
   
  -void DomTree_checkpoint (tIndex xDomTree, tNode xChild)
  +void DomTree_checkpoint (tReq * r, tIndex xDomTree, tIndex nRunCheckpoint)
   
   
       {
  -    if (pCurrReq -> nPhase == phRun || pCurrReq -> nPhase == phTerm)
  -	{
  -	tDomTree * pDomTree = DomTree_self (xDomTree) ;
  -	int n = ArrayAdd (&pDomTree -> pOrder, 1) ;
  -	(pDomTree -> pOrder)[n].xFromNode = xChild ;
  -	(pDomTree -> pOrder)[n].xToNode   = 0 ;
  -	if (pCurrReq -> bDebug & dbgParse)
  -	    lprintf (pCurrReq, "[%d]Checkpoint: DomTree=%d Node=%d OrderIndex %d SVs=%d\n", pCurrReq -> nPid, xDomTree, xChild, n, sv_count) ; 
  -	}
  +    tIndex nCompileCheckpoint = r -> nCurrCheckpoint ;
  +
  +
  +    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) ; 
  +        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) ;
  +        
  +        tNodeData * pCompileParent = Node_selfParentNode (pDomTree, pCompileNode, r -> nCurrRepeatLevel) ;
  +        tNodeData * pRunParent     = Node_selfParentNode (pDomTree, pRunNode, r -> nCurrRepeatLevel) ;
  +
  +        if (pPrevNode)
  +            pPrevNode = Node_selfCondCloneNode (pDomTree, pPrevNode, r -> nCurrRepeatLevel) ;
  +        else
  +            {
  +            pPrevNode = Node_selfCondCloneNode (pDomTree, pCompileNode, r -> nCurrRepeatLevel) ;
  +            pPrevNode -> bFlags |= nflgIgnore ;
  +            }
  +
  +        if (pCompileParent == pRunParent)
  +            {
  +            pRunNode = Node_selfCondCloneNode (pDomTree, pRunNode, r -> nCurrRepeatLevel) ;
  +        
  +            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) ; 
  +
  +            
  +            }
  +        else if (pCompileParent && pRunParent)
  +            {
  +            tNodeData * pCompileParent2 = Node_selfParentNode (pDomTree, pCompileParent, r -> nCurrRepeatLevel) ;
  +            tNodeData * pRunParent2     = Node_selfParentNode (pDomTree, pRunParent, r -> nCurrRepeatLevel) ;
  +
  +            if (pCompileParent2 == pRunParent2)
  +                {
  +                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 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) ; 
  +                }
  +            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 -> xNdx, pPrevNode -> nLinenumber, nRunCheckpoint, pRunNode -> xNdx, pRunParent -> xNdx, pRunParent2 -> xNdx, 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) ; 
  +    
  +            mydie ("Unstrutured forward jump (no parents)") ;
  +            }
  +        r -> nCurrCheckpoint = nRunCheckpoint + 1 ;
  +        return ;
  +        }
  +        
  +    if (pCurrReq -> bDebug & dbgParse)
  +	lprintf (pCurrReq, "[%d]Checkpoint: jump backward DomTree=%d %d -> %d SVs=%d\n", pCurrReq -> nPid, xDomTree, nCompileCheckpoint, nRunCheckpoint, sv_count) ; 
  +    
  +    mydie ("Loops not implemented") ;
       }
   
   
  @@ -1042,6 +1119,7 @@
   
   
       {
  +#if 0
       if (pCurrReq -> nPhase == phRun || pCurrReq -> nPhase == phTerm)
   	{
   	int n = ArrayAdd (&pDomTree -> pOrder, 1) ;
  @@ -1050,6 +1128,7 @@
   	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
       }
   
   
  @@ -1099,6 +1178,8 @@
   
       xNode = pNode -> xNdx ;
   
  +    mydie ("DomTree_selfDiscardAfterCheckpoint missing") ;
  +#if 0
       pOrder = pDomTree -> pOrder ;
       o = n = ArrayGetSize (pOrder) ;
       while (--n >= 0)
  @@ -1107,7 +1188,7 @@
   	    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) ; 
       
  @@ -2401,7 +2482,8 @@
   
       while (pNode)
   	{
  -	if (pNode -> bFlags & nflgCheckpoint)
  +#if 0
  +        if (pNode -> bFlags & nflgCheckpoint)
   	    { /* see how the control flow contiounes */
   	    if ((xNextNode = pDomTree -> pOrder[nOrderNdx].xFromNode) != pNode -> xNdx && xNextNode)	
   		{
  @@ -2506,7 +2588,7 @@
   		*/
   		}
   	    }
  -
  +#endif
   
   	if (pCurrReq -> bDebug & dbgParse)
   	    lprintf (r, "[%d]toString: Node=%d type=%d flags=%x text=>%s<= (#%d) SVs=%d\n", r -> nPid, pNode -> xNdx, pNode -> nType,  pNode -> bFlags, Ndx2String (pNode -> nText), pNode -> nText, sv_count) ; 
  @@ -2690,8 +2772,10 @@
   		    }
   		pNode = pNextNode ;
   		pNextNode  = Node_selfNextSibling (pDomTree, pNextNode, nRepeatLevel) ;
  +//		if (pNode -> nType == ntypStartTag && (pNode -> bFlags & nflgIgnore) == 0 &&
  +//		    (pNextNode == NULL || (pNextNode -> bFlags & nflgCheckpoint) == 0 || pDomTree -> pOrder[nOrderNdx].xFromNode == pNextNode -> xNdx))
   		if (pNode -> nType == ntypStartTag && (pNode -> bFlags & nflgIgnore) == 0 &&
  -		    (pNextNode == NULL || (pNextNode -> bFlags & nflgCheckpoint) == 0 || pDomTree -> pOrder[nOrderNdx].xFromNode == pNextNode -> xNdx))
  +		    (pNextNode == NULL || (pNextNode -> bFlags & nflgCheckpoint) == 0))
   		    {
   		    char * pNodeName = Node_selfNodeName (pNode) ;
   	    
  
  
  
  1.4.2.31  +13 -3     embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.4.2.30
  retrieving revision 1.4.2.31
  diff -u -r1.4.2.30 -r1.4.2.31
  --- epdom.h	2001/10/22 11:59:06	1.4.2.30
  +++ epdom.h	2001/10/22 13:52:16	1.4.2.31
  @@ -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.30 2001/10/22 11:59:06 richter Exp $
  +#   $Id: epdom.h,v 1.4.2.31 2001/10/22 13:52:16 richter Exp $
   #
   ###################################################################################*/
   
  @@ -159,7 +159,14 @@
   
   typedef struct tDomTreeOrder tDomTreeOrder ;
   
  +struct tDomTreeCheckpoint
  +    {
  +    tNode  xNode ;	    
  +    } ;
  +
  +typedef struct tDomTreeCheckpoint tDomTreeCheckpoint ;
   
  +
   struct tRepeatLevelLookupItem
       {
       tNodeData	*	    pNode ;	/* pointer to actual node data */
  @@ -189,7 +196,7 @@
   struct tDomTree
       {
       tLookupItem *   pLookup ;	/* table for converting tNode and tAttr to pointers */
  -    tDomTreeOrder * pOrder ;	/* Order of dom tree after execution of code */
  +    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 */
  @@ -252,6 +259,9 @@
   
   int ArrayGetSize (/*in*/ const tArray * pArray) ;
   
  +int ArrayAdd (/*in*/ const tArray * pArray,
  +	      /*in*/ int	numElements) ;
  +
   void StringNew (/*in*/ char * * pArray,
   	      /*in*/ int	nAdd) ;
   
  @@ -273,7 +283,7 @@
   
   int DomTree_delete (tDomTree * pDomTree) ;
   
  -void DomTree_checkpoint (tIndex xDomTree, tNode xChild) ;
  +void DomTree_checkpoint (tReq * r, tIndex xDomTree, tIndex nRunCheckpoint) ;
   void DomTree_selfCheckpoint (tDomTree * pDomTree, tNode xFromNode, tNode xToNode) ;
   
   int DomTree_selfDiscardAfterCheckpoint (/*in*/ tDomTree *	    pDomTree, 
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org