Code

Updated class location table.
[gosa.git] / include / sieve / class_My_Parser.inc
index 197d94ab2922e6a44032f344e1249c3d5cebcb32..ac99301a6f0406dac55cad68e4cf97fb160530c5 100644 (file)
@@ -1,14 +1,15 @@
 <?php
 
+/* String used to indent the different code blocks */
 define("SIEVE_INDENT_TAB","  ");
 
+
 /* This class is inherited from the original 'Parser'
  *  class written by Heiko Hund
  */
 class My_Parser extends Parser 
 {
        var $parent = NULL;
-
        var $registeredExtensions_ =array();
 
        function My_Parser($parent)
@@ -36,6 +37,8 @@ class My_Parser extends Parser
      */
        function parse($script) 
        {
+               $script = preg_replace("/^###GOSA/","",$script);
+
                $this->registeredExtensions_ = array();
         $this->status_text = "incomplete";
         $this->script_ = $script;
@@ -57,7 +60,7 @@ class My_Parser extends Parser
        
        function get_sieve_script()
        {
-               return($this->tree_->get_sieve_script());
+               return("###GOSA\n".$this->tree_->get_sieve_script());
        }               
 
        
@@ -67,22 +70,6 @@ class My_Parser extends Parser
        }
 
 
-       /* Should be obsolete in the end. */
-       function dumpToken_(&$token)
-       {
-               if (is_array($token))
-               {
-                       $str = "<" . $token['text'] . "> ";
-                       foreach ($token as $k => $v)
-                       {
-                               $str .= " $k:$v";
-                       }
-                       return $str;
-               }
-               return strval($token);
-       }
-
-
        function dumpParseTree()
        {
                return $this->tree_->execute();