Example #1
0
File: HData.php Project: h3rb/page
 function Parse()
 {
     $stream = new HDataStream($this->input);
     $word = "";
     while ($stream->End() == FALSE) {
         $word = $stream->Next();
         $wrapper = $word;
         $matched = $this->definition->matches($this->classes, $word);
         if ($matched == FALSE) {
             echo 'HDataSet PARSE ERROR at ' . $stream->pointer . '/' . $stream->length . ': Unknown class key: `' . $word . '` could not match in definition `' . $this->definition->name . '` ';
             //$word=$stream->Next();
             //echo 'VALUE: ';
             //var_dump($word);
             //echo ' matched = ';
             //var_dump($matched);
             //var_dump($this->definition);
             //var_dump($this->classes->list);
             die;
         } else {
             if ($matched->isList()) {
                 $word = $stream->Next();
                 $result = new HDataPoint($this->classes, $matched, $word);
                 $result->wrapper = $wrapper;
                 $this->data[] = $result;
             } else {
                 $word = $stream->Next();
                 $this->data[] = new HDataPoint($this->classes, $matched, $word);
             }
         }
     }
 }