Code

Some style fixes
[gosa.git] / include / sieve / class_My_Parser.inc
index 816950e996427df90eb7ddabfcb58826dc818b81..691faf43e0ed342224067e82bcc9f69676258247 100644 (file)
@@ -7,6 +7,15 @@ define("SIEVE_INDENT_TAB","  ");
  */
 class My_Parser extends Parser 
 {
+       var $parent = NULL;
+
+       var $registeredExtensions_ =array();
+
+       function My_Parser($parent)
+       {
+               $this->registeredExtensions_ = array();         
+               $this->parent = $parent;
+       }
 
        function execute()
        {
@@ -27,16 +36,20 @@ class My_Parser extends Parser
      */
        function parse($script) 
        {
+               $script = preg_replace("/^###GOSA/","",$script);
+
+               $this->registeredExtensions_ = array();
         $this->status_text = "incomplete";
         $this->script_ = $script;
-        $this->tree_ = new My_Tree(@Scanner::scriptStart());
+        $this->tree_ = new My_Tree(@Scanner::scriptStart(),$this);
         $this->tree_->setDumpFunc(array(&$this, 'dumpToken_'));
-        $this->scanner_ = new Scanner($this->script_);
+        $this->scanner_ = new My_Scanner($this->script_);
         $this->scanner_->setCommentFunc(array($this, 'comment_'));
 
         if ($this->commands_($this->tree_->getRoot()) &&
             $this->scanner_->nextTokenIs('script-end'))
         {
+                       $this->scanner_->nextToken(); 
             return $this->success_('success');
         }
 
@@ -46,7 +59,7 @@ class My_Parser extends Parser
        
        function get_sieve_script()
        {
-               return($this->tree_->get_sieve_script());
+               return("###GOSA\n".$this->tree_->get_sieve_script());
        }