<?
   //----- Get Form fields
   $GI_TextArea1 = "" ;
   $GI_ParseMode = "" ;

   IF (ISSET($_POST))  {
      IF (!EMPTY($_POST['TextArea1']))  $GI_TextArea1 = $_POST["TextArea1"];
      IF (!EMPTY($_POST['OutputOpt']))  $GI_ParseMode = $_POST["OutputOpt"];
   }
?>





<FORM   Method=POST   Action="ParseJS.PHP"   >

Input &nbsp;( Source code for JAVASCRIPT language )<BR>
<TEXTAREA   Name=TextArea1   Cols=79   Rows=10   >
<?IF ($GI_TextArea1 != "") {?><?=$GI_TextArea1?><?} ELSE {?><SCRIPT>
   /* Simple program */

   document.writeln (   'Hello World...'   );   
</SCRIPT>
<?}?></TEXTAREA><BR>


<INPUT   Type=SUBMIT   Value="Run parsing process"   > &nbsp;


Output option
<SELECT   Name=OutputOpt   Size=1   >
   <OPTION   Value="/Same"     <?IF ($GI_ParseMode == "/Same")      {?><?="   SELECTED"?><?}?>   >/Same</OPTION>
   <OPTION   Value="/Verbose"  <?IF (($GI_ParseMode == "/Verbose") || ($GI_ParseMode == "")) {?><?="   SELECTED"?><?}?>   >/Verbose</OPTION>
   <OPTION   Value="/Parse"    <?IF ($GI_ParseMode == "/Parse")     {?><?="   SELECTED"?><?}?>   >/Parse</OPTION>
   <OPTION   Value="/NoComment"<?IF ($GI_ParseMode == "/NoComment") {?><?="   SELECTED"?><?}?>   >/NoComment</OPTION>
   <OPTION   Value="/Compact"  <?IF ($GI_ParseMode == "/Compact")   {?><?="   SELECTED"?><?}?>   >/Compact</OPTION>
   <OPTION   Value="/PackLine" <?IF ($GI_ParseMode == "/PackLine")  {?><?="   SELECTED"?><?}?>   >/PackLine</OPTION>
</SELECT><BR>

</FORM>





<?
/*
!------------------------------------------------------------------------------
! This file toolbox
!------------------------------------------------------------------------------
*/
/*
!---------------
! Const: Parser Result $prXXXXX
!
! NEXTxxx: Mini parser for JAVASCRIPT language
!---------------
*/
   $prToken             = 1 ;
   $prSymbol            = 2 ;
   $prSymbol2Ch         = 3 ;
   $prQuotedText        = 4 ;
   $prIllegalToken      = 5 ;

   $prLineComment       = 6 ;
   $prComment           = 7 ;
   $prFilling           = 8 ;

   $prEndQuoteMissing   = 9 ;
   $prEndCommentMissing = 10 ;
   $prEndOfBuffer       = 11 ;

   $prSymbol3Ch         = 12 ;      //--- 2006/03/25
   $prSymbol4Ch         = 13 ;      //--- 2006/03/25


   $C_ParserResultStr = Array();
      $C_ParserResultStr[0] = "Token"             ;
      $C_ParserResultStr[1] = "Symbol"            ;
      $C_ParserResultStr[2] = "Symbol2Ch"         ;
      $C_ParserResultStr[3] = "QuotedText"        ;
      $C_ParserResultStr[4] = "IllegalToken"      ;
      $C_ParserResultStr[5] = "LineComment"       ;
      $C_ParserResultStr[6] = "Comment"           ;
      $C_ParserResultStr[7] = "Filling"           ;
      $C_ParserResultStr[8] = "EndQuoteMissing"   ;
      $C_ParserResultStr[9] = "EndCommentMissing" ;
      $C_ParserResultStr[10] = "EndOfBuffer"       ;
      $C_ParserResultStr[11] = "prSymbol3Ch"       ;
      $C_ParserResultStr[12] = "prSymbol4Ch"       ;


//===== NEXTxxx

   $G_StrParseMe = "" ;
   $G_PBegin = 0 ;
   $G_PAfterEnd = 0 ;

FUNCTION   NEXTxxx   ( $I_BuffPLast
                     , $IO_PBegin
                     , $O_PAfterEnd
                     )   //Parser Result const, $prXXXXX
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

                                                           //   >>>=
                                                           //   ===   !==
                                                           //   >>>
                                                           //   >>=   <<=
                                                           //   !=   <=   >=   ==
                                                           //   &&   ||
                                                           //   ++   --
                                                           //   +=   -=   *=   /=
                                                           //   &=   |=   ^=   %=
                                                           //   >>   <<
                                                           //   //...
                                                           //   /*...*/

   $C_OneCharSymbols   = "+-*/>=<(),:.;[]!&|~^?%{}" ;
   $C_CharsEndingToken = "+-*/>=<(),:.;[]!&|~^?%{}" ;

   //----- Controls : nil, non sense values
   IF (Is_Null($I_BuffPLast) || Is_Null($IO_PBegin) || ($I_BuffPLast < $IO_PBegin))
   {
      RETURN  $prEndOfBuffer ;
   }

   $G_PBegin = $IO_PBegin ;
//DEBUG:PRINT (   "DEBUG.NEXTxxx.1:"  .  ""  .  "\r\n"   );
//RETURN  $prSymbol2Ch ;

   //===== 0. Search first char of the token
   //----- Buffer   :  Other...  CRLF  Other...   TokenBeeingSearched
   //----- Pointers :                     G_PBegin^                  ^G_PAfterEnd
   $L_Ch = $G_StrParseMe[$G_PBegin];
   WHILE (($L_Ch == " ") || ($L_Ch == "\x09") || ($L_Ch == "\x0A") || ($L_Ch == "\x0D"))  {
      $G_PBegin++ ;
      IF ($I_BuffPLast < $G_PBegin)  {  RETURN  $prEndOfBuffer ;  }
      $L_Ch = $G_StrParseMe[$G_PBegin];
   }
   $G_PAfterEnd = $G_PBegin ;

   DO {      //--- PATCH  ( 1 / 2 ) , "Not aloud: goto LABEL_Bloc3"

   //===== 1. Special three non alpha chars tokens, like   >>>

   //----- 1.1. case:   >>>=
   IF ($L_Ch == ">")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != ">")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd-=2;  BREAK;  }
         IF ($G_StrParseMe[$G_PAfterEnd] != ">")  {  $G_PAfterEnd-=2;  }
         ELSE  {
            $G_PAfterEnd++ ;
            IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd-=3;  BREAK;  }
            IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd-=3;  }
            ELSE  {
               $G_PAfterEnd++ ;
               RETURN  $prSymbol4Ch ;
            }
         }
      }
   }

   //----- 1.2. case:   ===
   IF ($L_Ch == "=")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd-=2;  BREAK;  }
         IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd-=2;  }
         ELSE  {
            $G_PAfterEnd++ ;
            RETURN  $prSymbol3Ch ;
         }
      }
   }

   //----- 1.3. case:   !==
   IF ($L_Ch == "!")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd-=2;  BREAK;  }
         IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd-=2;  }
         ELSE  {
            $G_PAfterEnd++ ;
            RETURN  $prSymbol3Ch ;
         }
      }
   }

   //----- 1.4. case:   >>>
   IF ($L_Ch == ">")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != ">")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd-=2;  BREAK;  }
         IF ($G_StrParseMe[$G_PAfterEnd] != ">")  {  $G_PAfterEnd-=2;  }
         ELSE  {
            $G_PAfterEnd++ ;
            RETURN  $prSymbol3Ch ;
         }
      }
   }

   //----- 1.5. case:   >>=
   IF ($L_Ch == ">")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != ">")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd-=2;  BREAK;  }
         IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd-=2;  }
         ELSE  {
            $G_PAfterEnd++ ;
            RETURN  $prSymbol3Ch ;
         }
      }
   }

   //----- 1.6. case:   <<=
   IF ($L_Ch == "<")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "<")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd-=2;  BREAK;  }
         IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd-=2;  }
         ELSE  {
            $G_PAfterEnd++ ;
            RETURN  $prSymbol3Ch ;
         }
      }
   }

   //===== 2. Special two non alpha chars tokens, like   !=   <=   >=   //

   //----- 2.1. case:   !=
   IF ($L_Ch == "!")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.2. case:   <=
   IF ($L_Ch == "<")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.3. case:   >=
   IF ($L_Ch == ">")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.4. case:   ==
   IF ($L_Ch == "=")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.5. case:   &&
   IF ($L_Ch == "&")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "&")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.6. case:   ||
   IF ($L_Ch == "|")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "|")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.7. case:   ++
   IF ($L_Ch == "+")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "+")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.8. case:   --
   IF ($L_Ch == "-")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "-")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.9. case:   +=
   IF ($L_Ch == "+")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.A. case:   -=
   IF ($L_Ch == "-")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.B. case:   *=
   IF ($L_Ch == "*")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.C. case:   /=
   IF ($L_Ch == "/")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.D. case:   &=
   IF ($L_Ch == "&")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.E. case:   |=
   IF ($L_Ch == "|")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.F. case:   ^=
   IF ($L_Ch == "^")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.G. case:   %=
   IF ($L_Ch == "%")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "=")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.H. case:   >>
   IF ($L_Ch == ">")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != ">")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.I. case:   <<
   IF ($L_Ch == "<")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "<")  {  $G_PAfterEnd--;  }
      ELSE  {
         $G_PAfterEnd++ ;
         RETURN  $prSymbol2Ch ;
      }
   }

   //----- 2.J. case:   //... Line comment, just search end of line
   IF ($L_Ch == "/")
   {
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "/")  {  $G_PAfterEnd--;  }
      ELSE  {
         DO //search end of line
         {
            $G_PAfterEnd++ ;
            IF ($I_BuffPLast < $G_PAfterEnd)  BREAK ;
            $L_Ch = $G_StrParseMe[$G_PAfterEnd];
         } WHILE (!(($L_Ch == "\x0A") || ($L_Ch == "\x0D")));
         RETURN  $prLineComment ;
      }
   }

   //----- 2.K. case:   /*...*/ Multi line comment
   IF ($L_Ch == "/")
   {
      //----- Buffer   :  Other...  CRLF  Other...   /* comment beeing searched */
      //----- Pointers :                     G_PBegin^                            ^G_PAfterEnd
      $G_PAfterEnd++ ;
      IF ($I_BuffPLast < $G_PAfterEnd)         {  $G_PAfterEnd--;  BREAK;  }
      IF ($G_StrParseMe[$G_PAfterEnd] != "*")  {  $G_PAfterEnd--;  }
      ELSE  {
         DO   // search end comment tag: */
         {
            $G_PAfterEnd++ ;
            IF ($I_BuffPLast < $G_PAfterEnd)  {  RETURN  $prEndCommentMissing ;  }
            IF ($G_StrParseMe[$G_PAfterEnd] == "*")  {
               $G_PAfterEnd++ ;
               IF ($I_BuffPLast < $G_PAfterEnd)  {  RETURN  $prEndCommentMissing ;  }
               IF ($G_StrParseMe[$G_PAfterEnd] == "/")  {  $G_PAfterEnd++;  RETURN $prComment;  }
               $G_PAfterEnd-- ;
            }
         } WHILE (TRUE);
      }
   }

   } WHILE (False);      //--- PATCH  ( 2 / 2 ) , "Not aloud: goto LABEL_Bloc3"

   //===== 3. Other cases
 //--LABEL_Bloc3:--
   //----- 3.1. case:
   IF (False)
   {
   }  ELSE

   //----- 3.2. case:   one char symbol,  like + - * < ; etc
   $L_PosCh = StrPos ( $C_OneCharSymbols , $L_Ch );
   IF (Is_Numeric($L_PosCh) == TRUE)
   {
      $G_PAfterEnd++ ;
      RETURN  $prSymbol ;
   }  ELSE

   //----- 3.3. case:   quote ' or "
   IF (($L_Ch == "\"") || ($L_Ch == "'"))
   {
      //----- Buffer  :  Other...  CRLF  Other...   " Quotes beeing processed "
      //----- Pointers:                     G_PBegin^                          ^G_PAfterEnd
      $L_Quote = $L_Ch ;
      DO   // search end quote, skipping double quotes
      {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)             {  RETURN  $prEndQuoteMissing ;  }
         $L_Ch = $G_StrParseMe[$G_PAfterEnd];
         IF (($L_Ch == "\x0A") || ($L_Ch == "\x0D"))  {  RETURN  $prEndQuoteMissing ;  }
         IF ($L_Ch == $L_Quote)  {
            IF ($G_StrParseMe[$G_PAfterEnd-1] != "\\")  {
               $G_PAfterEnd++ ;
               IF ($I_BuffPLast < $G_PAfterEnd)  {  RETURN  $prQuotedText ;  }
               RETURN  $prQuotedText ;
            }
         }
      } WHILE (TRUE);
   }  ELSE

   //----- 3.5. case:   normal token
   {
      //----- Buffer   :  Other...  CRLF  Other...   TokenBeeingSearched
      //----- Pointers :                     G_PBegin^                  ^G_PAfterEnd
      DO
      {
         $G_PAfterEnd++ ;
         IF ($I_BuffPLast < $G_PAfterEnd)  BREAK ;
         $L_Ch = $G_StrParseMe[$G_PAfterEnd];
         $L_PosCh = StrPos ( $C_CharsEndingToken , $L_Ch );
         IF (Is_Numeric($L_PosCh) == TRUE)  BREAK ;
      } WHILE (!(($L_Ch == " ") || ($L_Ch == "\x09") || ($L_Ch == "\x0A") || ($L_Ch == "\x0D")));
      RETURN  $prToken ;
   }
}

/*
!------------------------------------------------------------------------------
! This file toolbox  ( bis )
!------------------------------------------------------------------------------
*/
/*
!---------------
! ProcessBuffer_Same
! ProcessBuffer_Verbose
! ProcessBuffer_Parse
! ProcessBuffer_NoComment
! ProcessBuffer_Compact
! ProcessBuffer_PackLine
!---------------
*/
//===== ProcessBuffer_Same

FUNCTION   ProcessBuffer_Same   ( $I_BufFirst , $I_BufLast )
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

   IF (Is_Null($I_BufLast) || Is_Null($I_BufFirst))  {
      RETURN ;
   }

   $L_PAfterEnd = $I_BufFirst ;

   //----- LOOP 1 , Call parser
   DO
   {
      $L_Ptr = $L_PAfterEnd ;

      $L_Ch = $G_StrParseMe[$L_Ptr];

      //----- LOOP 2.1 , OUTPUT : Filling
      WHILE (($L_Ch == " ") || ($L_Ch == "\x09") || ($L_Ch == "\x0A") || ($L_Ch == "\x0D"))  {
         PRINT (   $L_Ch   );
         $L_Ptr++ ;
         IF ($I_BufLast < $L_Ptr)  RETURN ;
         $L_Ch = $G_StrParseMe[$L_Ptr];
      }//while
//DEBUG:PRINT (   "DEBUG.1:"  .  String($L_prResult)  .  ":"  .  String($L_Ptr)  .  "-->"  .  String($L_PAfterEnd)  .  "\r\n"   );
//RETURN;

      //----- PARSER , Get "next token"
      $L_prResult = NEXTxxx ( $I_BufLast , $L_Ptr , $L_PAfterEnd );  $L_Ptr=$G_PBegin;  $L_PAfterEnd=$G_PAfterEnd;

      IF (   ($L_prResult == $prToken) || ($L_prResult == $prSymbol) || ($L_prResult == $prSymbol2Ch) || ($L_prResult == $prQuotedText) || ($L_prResult == $prIllegalToken)
          || ($L_prResult == $prLineComment) || ($L_prResult == $prComment)
          || ($L_prResult == $prSymbol3Ch) || ($L_prResult == $prSymbol4Ch))
      {
         //----- LOOP 2. , OUTPUT : Token, Symbol,... as found
         WHILE ($L_Ptr < $L_PAfterEnd)  {
            $L_Ch = $G_StrParseMe[$L_Ptr];
            PRINT (   $L_Ch   );
            $L_Ptr++ ;
         }//while
      }

   } WHILE ($L_Ptr <= $I_BufLast);
}

//===== ProcessBuffer_Verbose

FUNCTION   ProcessBuffer_Verbose   ( $I_BufFirst , $I_BufLast )
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $C_ParserResultStr ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

   IF (Is_Null($I_BufLast) || Is_Null($I_BufFirst))  {
      RETURN ;
   }

   $L_PAfterEnd = $I_BufFirst ;

   //----- LOOP 1 , Call parser
   DO
   {
      $L_Ptr = $L_PAfterEnd ;

      //----- PARSER , Get "next token"
      $L_prResult = NEXTxxx ( $I_BufLast , $L_Ptr , $L_PAfterEnd );  $L_Ptr=$G_PBegin;  $L_PAfterEnd=$G_PAfterEnd;

      IF (TRUE)  {
         //----- OUTPUT : Token type
         $L_TmpStr = $C_ParserResultStr[$L_prResult-1];
         WHILE (StrLen($L_TmpStr) < 11)  {  $L_TmpStr = $L_TmpStr  .  " " ;  }
         IF (StrLen($L_TmpStr) > 11)  $L_TmpStr = SubStr ( $L_TmpStr , 0 , 11 );
         PRINT (   "/* "  .  $L_TmpStr  .  " */ "   );

         //----- LOOP 2. , OUTPUT : Token, Symbol,... as found
         WHILE ($L_Ptr < $L_PAfterEnd)  {
            $L_Ch = $G_StrParseMe[$L_Ptr];
            PRINT (   $L_Ch   );
            $L_Ptr++ ;
         }//while

         PRINT (   "\r\n"   );
      }

   } WHILE ($L_Ptr <= $I_BufLast);
}

//===== ProcessBuffer_Parse

FUNCTION   ProcessBuffer_Parse   ( $I_BufFirst , $I_BufLast )
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

   IF (Is_Null($I_BufLast) || Is_Null($I_BufFirst))  {
      RETURN ;
   }

   $L_PAfterEnd = $I_BufFirst ;

   //----- LOOP 1 , Call parser
   DO
   {
      $L_Ptr = $L_PAfterEnd ;

      //----- PARSER , Get "next token"
      $L_prResult = NEXTxxx ( $I_BufLast , $L_Ptr , $L_PAfterEnd );  $L_Ptr=$G_PBegin;  $L_PAfterEnd=$G_PAfterEnd;

      IF (   ($L_prResult == $prToken) || ($L_prResult == $prSymbol) || ($L_prResult == $prSymbol2Ch) || ($L_prResult == $prQuotedText) || ($L_prResult == $prIllegalToken)
          || ($L_prResult == $prLineComment) || ($L_prResult == $prComment)
          || ($L_prResult == $prSymbol3Ch) || ($L_prResult == $prSymbol4Ch))
      {
         //----- LOOP 2. , OUTPUT : Token, Symbol,... as found
         WHILE ($L_Ptr < $L_PAfterEnd)  {
            $L_Ch = $G_StrParseMe[$L_Ptr];
            PRINT (   $L_Ch   );
            $L_Ptr++ ;
         }//while

         PRINT (   "\r\n"   );
      }

   } WHILE ($L_Ptr <= $I_BufLast);
}

//===== ProcessBuffer_NoComment

FUNCTION   ProcessBuffer_NoComment   ( $I_BufFirst , $I_BufLast )
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

   IF (Is_Null($I_BufLast) || Is_Null($I_BufFirst))  {
      RETURN ;
   }

   $L_PAfterEnd = $I_BufFirst ;

   //----- LOOP 1 , Call parser
   DO
   {
      $L_Ptr = $L_PAfterEnd ;

      //----- PARSER , Get "next token"
      $L_prResult = NEXTxxx ( $I_BufLast , $L_Ptr , $L_PAfterEnd );  $L_Ptr=$G_PBegin;  $L_PAfterEnd=$G_PAfterEnd;

      IF (   ($L_prResult == $prToken) || ($L_prResult == $prSymbol) || ($L_prResult == $prSymbol2Ch) || ($L_prResult == $prQuotedText) || ($L_prResult == $prIllegalToken)
          || ($L_prResult == $prSymbol3Ch) || ($L_prResult == $prSymbol4Ch))
      {
         //----- LOOP 2. , OUTPUT : Token, Symbol,... as found
         WHILE ($L_Ptr < $L_PAfterEnd)  {
            $L_Ch = $G_StrParseMe[$L_Ptr];
            PRINT (   $L_Ch   );
            $L_Ptr++ ;
         }//while

         PRINT (   "\r\n"   );
      }

   } WHILE ($L_Ptr <= $I_BufLast);
}

//===== ProcessBuffer_Compact

   $G_TmpBuf_LineCompacted = "" ;
   $G_PREV_prResult = "" ;

FUNCTION   ProcessBuffer_Compact   ( $I_BufFirst , $I_BufLast )
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

   GLOBAL  $G_TmpBuf_LineCompacted , $G_PREV_prResult ;

   IF (Is_Null($I_BufLast) || Is_Null($I_BufFirst))  {
      IF (!Is_Null($I_BufFirst))
      {   // Before Process
         $G_TmpBuf_LineCompacted = "" ;
         $G_PREV_prResult        = $prFilling ;
      }
      ELSE  {   // After Process
         IF ($G_TmpBuf_LineCompacted != "")
            PRINT (   $G_TmpBuf_LineCompacted  .  "\r\n"   );
      }
      RETURN ;
   }

   $L_PAfterEnd = $I_BufFirst ;

   //----- LOOP 1 , Call parser
   DO
   {
      $L_Ptr = $L_PAfterEnd ;

      //----- PARSER , Get "next token"
      $L_prResult = NEXTxxx ( $I_BufLast , $L_Ptr , $L_PAfterEnd );  $L_Ptr=$G_PBegin;  $L_PAfterEnd=$G_PAfterEnd;

      IF (   ($L_prResult == $prToken) || ($L_prResult == $prSymbol) || ($L_prResult == $prSymbol2Ch) || ($L_prResult == $prQuotedText) || ($L_prResult == $prIllegalToken)
          || ($L_prResult == $prSymbol3Ch) || ($L_prResult == $prSymbol4Ch))
      {
         //----- Put a space between 2 tokens ?
         IF (($G_PREV_prResult == $prToken) && ($L_prResult == $prToken))
            $L_String0 = " " ;
         ELSE
            $L_String0 = "" ;

         //----- CONTROL : Current token too long ?
         $L_TokenLen = $L_PAfterEnd - $L_Ptr ;
         IF ($L_TokenLen > 126)  {
            //----- OUTPUT : Previous temp buffer
            PRINT (   $G_TmpBuf_LineCompacted  .  "\r\n"   );
            $G_TmpBuf_LineCompacted = "" ;

            //----- OUTPUT : Current token
            $L_String1 = SubStr ( $G_StrParseMe , $L_Ptr , 126 );
            PRINT (   $L_String1  .  "\r\n"   );

            //----- OUTPUT : Error message
            PRINT (   "ERROR: "  .  "Token too long."  .  "\r\n"   );
            RETURN ; //--throw ( 1 );--
         }

         //----- Copy current token ==> TmpString
         $L_String1 = SubStr ( $G_StrParseMe , $L_Ptr , $L_TokenLen );


         //--------------- PATCH : <SCRIPT   /SCRIPT   ;else  ---------------
         //                        ++   --   </

         $L_PATCH_SameLineQ = False ;

         DO {

         //----- Patch :  <SCRIPT   /SCRIPT
         IF ($L_PATCH_SameLineQ == False)  {
            IF (StrLen($L_String1) == 6)  {
               IF (   (StrToUpper($L_String1[0]) == "S") && (StrToUpper($L_String1[1]) == "C")
                   && (StrToUpper($L_String1[2]) == "R") && (StrToUpper($L_String1[3]) == "I")
                   && (StrToUpper($L_String1[4]) == "P") && (StrToUpper($L_String1[5]) == "T"))
               {
                  IF (StrLen($G_TmpBuf_LineCompacted) > 0)  {
                     $L_Ch = $G_TmpBuf_LineCompacted[StrLen($G_TmpBuf_LineCompacted) -1];
                     IF (($L_Ch == "/") || ($L_Ch == "<"))  {
                        //----- Temp line buffer : add "token"
                        $G_TmpBuf_LineCompacted .= $L_String1 ;
                           //--Note:So line length can be more than usal length  ( 79 chars )--

                        $L_PATCH_SameLineQ = TRUE ;
                        BREAK ;
                     }
                  }
               }
            }
         }

         //----- Patch :  ;else
         IF ($L_PATCH_SameLineQ == False)  {
            IF (StrLen($L_String1) == 4)  {
               IF ($L_String1 == "else")  {
                  IF (StrLen($G_TmpBuf_LineCompacted) > 0)  {
                     $L_Ch = $G_TmpBuf_LineCompacted[StrLen($G_TmpBuf_LineCompacted) -1];
                     IF (($L_Ch != ";") && ($L_Ch != "}"))  {
                        //----- Temp line buffer : add "token"
                        $G_TmpBuf_LineCompacted .= ";"  .  $L_String1 ;
                           //--Note:So line length can be more than usal length  ( 79 chars )--

                        $L_PATCH_SameLineQ = TRUE ;
                        BREAK ;
                     }
                  }
               }
            }
         }

         //----- Patch : ++   --
         IF ($L_PATCH_SameLineQ == False)  {
            IF (StrLen($L_String1) == 2)  {
               IF (($L_String1 == "++") || ($L_String1 == "--"))  {
                  //----- Temp line buffer : add "token"
                  $G_TmpBuf_LineCompacted .= $L_String1 ;
                     //--Note:So line length can be more than usal length  ( 79 chars )--

                  $L_PATCH_SameLineQ = TRUE ;
                  BREAK ;
               }
            }
         }

         //----- Patch :  </
         IF ($L_PATCH_SameLineQ == False)  {
            IF (StrLen($L_String1) == 1)  {
               IF ($L_String1 == "/")  {
                  IF (StrLen($G_TmpBuf_LineCompacted) > 0)  {
                     $L_Ch = $G_TmpBuf_LineCompacted[StrLen($G_TmpBuf_LineCompacted) -1];
                     IF ($L_Ch == "<")  {
                        //----- Temp line buffer : add "token"
                        $G_TmpBuf_LineCompacted .= $L_String1 ;
                           //--Note:So line length can be more than usal length  ( 79 chars )--

                        $L_PATCH_SameLineQ = TRUE ;
                        BREAK ;
                     }
                  }
               }
            }
         }

         } WHILE (False);

         //--LABEL_Patch_END:--

         //--------------- PATCH END ---------------


         IF ($L_PATCH_SameLineQ == False)  {
            //----- "Temp line buffer" would be full ?
            IF (( StrLen($G_TmpBuf_LineCompacted) + StrLen($L_String0) + StrLen($L_String1) ) > 79)
            {
               //----- OUTPUT : Previous temp buffer
               PRINT (   $G_TmpBuf_LineCompacted  .  "\r\n"   );
               $G_TmpBuf_LineCompacted = "" ;
               $L_String0              = "" ;   // Token sent to next line
            }

            //----- Temp line buffer : add "token"
            $G_TmpBuf_LineCompacted .= $L_String0  .  $L_String1 ;
         }

         $G_PREV_prResult = $L_prResult ;
      }

   } WHILE ($L_Ptr <= $I_BufLast);
}

//===== ProcessBuffer_PackLine

FUNCTION   ProcessBuffer_PackLine   ( $I_BufFirst , $I_BufLast )
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

   GLOBAL  $G_TmpBuf_LineCompacted , $G_PREV_prResult ;

   IF (Is_Null($I_BufLast) || Is_Null($I_BufFirst))  {
      IF (!Is_Null($I_BufFirst))
      {   // Before Process
         $G_TmpBuf_LineCompacted = "" ;
         $G_PREV_prResult        = $prFilling ;
      }
      ELSE  {   // After Process
         IF ($G_TmpBuf_LineCompacted != "")
            PRINT (   $G_TmpBuf_LineCompacted  .  "\r\n"   );
      }
      RETURN ;
   }

   $L_PAfterEnd = $I_BufFirst ;

   //----- LOOP 1 , Call parser
   DO
   {
      $L_Ptr = $L_PAfterEnd ;

      $L_Ch = $G_StrParseMe[$L_Ptr];

      //----- LOOP 2.1 , Skip filling
      WHILE (($L_Ch == " ") || ($L_Ch == "\x09"))  {
         $L_Ptr++ ;
         IF ($I_BufLast < $L_Ptr)  BREAK ;
         $L_Ch = $G_StrParseMe[$L_Ptr];
      }//while

      //----- Check NewLine
      IF ($L_Ch == "\x0A")
      {
         $L_Ptr++ ;
         $L_NewLineQ = TRUE ;
      }
      ELSE  {
         IF ($L_Ch == "\x0D")  {
            $L_Ptr++ ;
            IF ($L_Ptr <= $I_BufLast)  {
               $L_Ch = $G_StrParseMe[$L_Ptr];
               IF ($L_Ch == "\x0A")
                  $L_Ptr++ ;
            }
            $L_NewLineQ = TRUE ;
         }
         ELSE
            $L_NewLineQ = False ;
      }
      IF ($L_NewLineQ == TRUE)  {
         //----- OUTPUT : temp line buffer
         IF ($G_TmpBuf_LineCompacted != "")  {
            PRINT (   $G_TmpBuf_LineCompacted  .  "\r\n"   );
            $G_TmpBuf_LineCompacted = "" ;
            $G_PREV_prResult        = $prFilling ;
         }
      }
      IF ($I_BufLast < $L_Ptr)  BREAK ;

      //----- PARSER , Get "next token"
      $L_prResult = NEXTxxx ( $I_BufLast , $L_Ptr , $L_PAfterEnd );  $L_Ptr=$G_PBegin;  $L_PAfterEnd=$G_PAfterEnd;

      IF (   ($L_prResult == $prToken) || ($L_prResult == $prSymbol) || ($L_prResult == $prSymbol2Ch) || ($L_prResult == $prQuotedText) || ($L_prResult == $prIllegalToken)
          || ($L_prResult == $prSymbol3Ch) || ($L_prResult == $prSymbol4Ch))
      {
         //----- Put a space between 2 tokens ?
         IF (($G_PREV_prResult == $prToken) && ($L_prResult == $prToken))
            $L_String0 = " " ;
         ELSE
            $L_String0 = "" ;

         //----- CONTROL : Current token too long ?
         $L_TokenLen = $L_PAfterEnd - $L_Ptr ;
         IF ($L_TokenLen > 126)  {
            //----- OUTPUT : Previous temp buffer
            PRINT (   $G_TmpBuf_LineCompacted  .  "\r\n"   );
            $G_TmpBuf_LineCompacted = "" ;

            //----- OUTPUT : Current token
            $L_String1 = SubStr ( $G_StrParseMe , $L_Ptr , 126 );
            PRINT (   $L_String1  .  "\r\n"   );

            //----- OUTPUT : Error message
            PRINT (   "ERROR: "  .  "Token too long."  .  "\r\n"   );
            RETURN ; //--throw ( 1 );--
         }

         //----- Copy current token ==> TmpString
         $L_String1 = SubStr ( $G_StrParseMe , $L_Ptr , $L_TokenLen );

         //----- "Temp line buffer" would be full ?
         IF (( StrLen($G_TmpBuf_LineCompacted) + StrLen($L_String0) + StrLen($L_String1) ) > 126)
         {
            //----- OUTPUT : Previous temp buffer
            PRINT (   $G_TmpBuf_LineCompacted  .  "\r\n"   );
            $G_TmpBuf_LineCompacted = "" ;

            //----- OUTPUT : Current token
            PRINT (   $L_String1  .  "\r\n"   );

            //----- OUTPUT : Error message
            PRINT (   "ERROR: "  .  "Line too long."  .  "\r\n"   );
            RETURN ; //--throw ( 1 );--
         }

         //----- Temp line buffer : add "token"
         $G_TmpBuf_LineCompacted .= $L_String0  .  $L_String1 ;

         $G_PREV_prResult = $L_prResult ;
      }

   } WHILE ($L_Ptr <= $I_BufLast);
}

/*
!------------------------------------------------------------------------------
! This file routines
!------------------------------------------------------------------------------
*/
/*
!---------------
! ProcessBuffer
!---------------
*/
   $pmSame      = 0 ;
   $pmVerbose   = 1 ;
   $pmParse     = 2 ;
   $pmNoComment = 3 ;
   $pmCompact   = 4 ;
   $pmPackLine  = 5 ;

   $G_ParseMode = $pmVerbose ;

//===== ProcessBuffer

FUNCTION   ProcessBuffer   ( $I_BufFirst , $I_BufLast )
{
   GLOBAL  $prToken , $prSymbol , $prSymbol2Ch , $prQuotedText , $prIllegalToken ;
   GLOBAL  $prLineComment , $prComment , $prFilling ;
   GLOBAL  $prEndQuoteMissing , $prEndCommentMissing , $prEndOfBuffer ;
   GLOBAL  $prSymbol3Ch , $prSymbol4Ch ;

   GLOBAL  $G_StrParseMe , $G_PBegin , $G_PAfterEnd ;

   GLOBAL  $pmSame , $pmVerbose , $pmParse , $pmNoComment , $pmCompact , $pmPackLine ;
   GLOBAL  $G_ParseMode ;

   SWITCH ($G_ParseMode)  {
      CASE $pmSame      : ProcessBuffer_Same      ( $I_BufFirst , $I_BufLast );  BREAK;
      CASE $pmVerbose   : ProcessBuffer_Verbose   ( $I_BufFirst , $I_BufLast );  BREAK;
      CASE $pmParse     : ProcessBuffer_Parse     ( $I_BufFirst , $I_BufLast );  BREAK;
      CASE $pmNoComment : ProcessBuffer_NoComment ( $I_BufFirst , $I_BufLast );  BREAK;
      CASE $pmCompact   : ProcessBuffer_Compact   ( $I_BufFirst , $I_BufLast );  BREAK;
      CASE $pmPackLine  : ProcessBuffer_PackLine  ( $I_BufFirst , $I_BufLast );  BREAK;
   }//switch

   /*
   IF (Is_Null($I_BufLast) || Is_Null($I_BufFirst))  {
      IF (!Is_Null($I_BufFirst))
         PRINT (   "***** Begin"  .  "\r\n"   );      //--- Before Process
      ELSE
         PRINT (   "***** End"  .  "\r\n"     );      //--- After Process
      RETURN ;
   }

   //----- Input ==> Output, char by char
   $L_Ptr = $I_BufFirst ;
   WHILE ($L_Ptr <= $I_BufLast)  {
      $L_Ch = $G_StrParseMe[$L_Ptr];
      PRINT (   $L_Ch   );
      $L_Ptr++ ;
   }
   */
}


//===============


   IF ($GI_TextArea1 != "")  {
      $G_StrParseMe = $GI_TextArea1 ;

      //----- OPTIONAL : Parameter 2
      $G_ParseMode = $pmVerbose ;
      IF ($GI_ParseMode == "/Same")       $G_ParseMode = $pmSame ;
      IF ($GI_ParseMode == "/Verbose")    $G_ParseMode = $pmVerbose ;
      IF ($GI_ParseMode == "/Parse")      $G_ParseMode = $pmParse ;
      IF ($GI_ParseMode == "/NoComment")  $G_ParseMode = $pmNoComment ;
      IF ($GI_ParseMode == "/Compact")    $G_ParseMode = $pmCompact ;
      IF ($GI_ParseMode == "/PackLine")   $G_ParseMode = $pmPackLine ;

      PRINT (   "<BR>"  .  "\r\n"   );
      PRINT (   "<XMP>"  .  "***** OUTPUT"  .  "\r\n"   );
      $G_Time1 = MicroTime();
      ProcessBuffer ( 0 , null );      //--- Before Process
      ProcessBuffer ( 0 , StrLen($G_StrParseMe) -1 );
      ProcessBuffer ( null , null );      //--- After Process
      $G_Time2 = MicroTime();
//DEBUG:
//print(($G_Time1) . "  time 1" . "\r\n");
//print(($G_Time2) . "  time 2" . "\r\n");
//print(SubStr($G_Time2,StrPos($G_Time2,' ')+1) . " + ");
//print(SubStr($G_Time2,0,StrPos($G_Time2,' ')) . "\r\n");
      $G_Time1 = SubStr($G_Time1,0,10)  +  SubStr($G_Time1,11,10);
      $G_Time2 = SubStr($G_Time2,0,StrPos($G_Time2,' '))  +  SubStr($G_Time2,StrPos($G_Time2,' ')+1);
//DEBUG:
//print(($G_Time1) . "  time 1" . "\r\n");
//print(($G_Time2) . "  time 2" . "\r\n");
      PRINT (   "*****  "  .  (($G_Time2-$G_Time1)*1000)  .  "  milliseconds"  .  "\r\n"   );
      PRINT (   "</XMP>"  .  "\r\n"   );
   }
?>
