Changed CodeDoc/Parser.phpCodeDoc/Parser/Comment.phpCodeDoc/Parser/Method.phpCodeDoc...
[PHP_CodeDoc] / CodeDoc / Parser / Var.php
index e5a025d..9fcf56d 100644 (file)
@@ -14,34 +14,34 @@ class PHP_CodeDoc_Parser_Var {
 
     
     var $var; // current return value;
-    function read ($inclass) {
+    static function read (PHP_CodeDoc_Parser $thiz, $inclass) {
         if (!$inclass) {
             return;
         }
-        if ($c = PHP_CodeDoc_Parser_Var::parse()) {
+        if ($c = PHP_CodeDoc_Parser_Var::parse($thiz)) {
              
-            $c->activeFile = $this->activeFile;
-            $this->classes[$this->_active_class]->Attributes[$c->name] = $c;
-            $this->classes[$this->_active_class]->Attributes[$c->name]->class =
-                    $this->classes[$this->_active_class]->name;
+            $c->activeFile = $thiz->activeFile;
+            $thiz->classes[$thiz->_active_class]->Attributes[$c->name] = $c;
+            $thiz->classes[$thiz->_active_class]->Attributes[$c->name]->class =
+                    $thiz->classes[$thiz->_active_class]->name;
         }
     }
     
     
-    function parse()
+    function parse(PHP_CodeDoc_Parser $thiz)
     { //  read var declares in a class
-        $flags= array($this->look_nws(-1), $this->look_nws(-2), $this->look_nws(-3), $this->look_nws(-4));
+        $flags= array($thiz->look_nws(-1), $thiz->look_nws(-2), $thiz->look_nws(-3), $thiz->look_nws(-4));
        
         
-        $startpos = $this->pos;
+        $startpos = $thiz->pos;
         
         $var = new PHP_CodeDoc_Data_Var;
-        $var->name  = $this->tokens[$this->pos+2][1];
+        $var->name  = $thiz->tokens[$thiz->pos+2][1];
         $var->type = "Public";
         $var->isPublic = 1;
         $var->isStatic = 0;
         $var->visibility = 1;
-        $var->isConstant = $this->tokens[$this->pos][0] == T_CONST;
+        $var->isConstant = $thiz->tokens[$thiz->pos][0] == T_CONST;
         
         if (in_array(T_PRIVATE, $flags)) {
             $var->type = "Private";
@@ -59,12 +59,12 @@ class PHP_CodeDoc_Parser_Var {
         
         $var->visibility = 1;
         
-        PHP_CodeDoc_Parser_Var::_store_tokens($var);
+        PHP_CodeDoc_Parser_Var::_store_tokens($thiz, $var);
         
-        if ($v = PHP_CodeDoc_Parser_Comment::parse()) {
+        if ($v = PHP_CodeDoc_Parser_Comment::parse($thiz)) {
             $var->description = $v;
         }
-        $this->pos = $startpos;
+        $thiz->pos = $startpos;
            
         return $var;
     
@@ -73,16 +73,16 @@ class PHP_CodeDoc_Parser_Var {
     /* 
     remember the tokens for a var.. (for printing later)
     */
-    function _store_tokens(&$var) { 
+    function _store_tokens(PHP_CodeDoc_Parser $thiz, &$var) { 
         //return;
-        $var->tokenStart=$this->pos;
+        $var->tokenStart=$thiz->pos;
         $n=0;
         $in_method =0;
         $inbrak =0;
         $level=0;
-        $pos = $this->pos;
-        while ($pos < $this->total) {
-            $v = $this->tokens[$pos];
+        $pos = $thiz->pos;
+        while ($pos < $thiz->total) {
+            $v = $thiz->tokens[$pos];
             if (!is_array($v)) {
                 if (trim($v) == ";") {
                     $var->tokenEnd = $pos;
@@ -99,6 +99,5 @@ class PHP_CodeDoc_Parser_Var {
     
     
 }
-?>
-   
    
\ No newline at end of file