Code

Fixed layout, a little bit
[gosa.git] / include / sieve / class_My_Parser.inc
index f0a3f9d89729b0d9867f7c54842ed356cd5e5371..816950e996427df90eb7ddabfcb58826dc818b81 100644 (file)
@@ -1,7 +1,30 @@
 <?php
 
+define("SIEVE_INDENT_TAB","  ");
+
+/* This class is inherited from the original 'Parser'
+ *  class written by Heiko Hund
+ */
 class My_Parser extends Parser 
 {
+
+       function execute()
+       {
+               $ret = $this->dumpParseTree();
+               return($ret);
+       }
+       
+
+       /* Check if there are errors, collect them and return them */
+       function check()
+       {
+               return($this->tree_->check());
+       }
+       
+
+       /* Initiate parser, but use some other 
+     *  classes, that are rewritten.
+     */
        function parse($script) 
        {
         $this->status_text = "incomplete";
@@ -20,6 +43,20 @@ class My_Parser extends Parser
         return $this->status_;
        }
 
+       
+       function get_sieve_script()
+       {
+               return($this->tree_->get_sieve_script());
+       }               
+
+       
+       function save_object()
+       {
+               $this->tree_->save_object();
+       }
+
+
+       /* Should be obsolete in the end. */
        function dumpToken_(&$token)
        {
                if (is_array($token))
@@ -33,5 +70,11 @@ class My_Parser extends Parser
                }
                return strval($token);
        }
+
+
+       function dumpParseTree()
+       {
+               return $this->tree_->execute();
+       }
 }
 ?>