public function parse(NodeStream $stream)
    {
        $builder = new ClassBuilder();

        while (!$stream->is(TokenParser::NODE_EON)) {
            switch ($this->status) {
                case self::STAT_NONE:
                    $this->parseClass($builder, $stream);
                    break;
                case self::STAT_BODY:
                    $methodNodes = array(
                        TokenParser::NODE_PUBLIC_METHOD,
                        TokenParser::NODE_PROTECTED_METHOD,
                        TokenParser::NODE_PRIVATE_METHOD
                    );
                    if ($stream->is($methodNodes)) {
                        $this->parseMethod($builder, $stream);
                    } else {
                        $this->parseProperty($builder, $stream);
                    }
                    break;
                default:
                    $stream->next();
                    break;
            }
        }

        return $builder;
    }
public function parse(NodeStream $stream)
    {
        $builder = new ClassBuilder();

        while (!$stream->is(TokenParser::NODE_EON)) {
            switch ($this->status) {
                case self::STAT_NONE:
                    $this->parseClass($builder, $stream);
                    break;
                case self::STAT_BODY:
                    $methodNodes = array(
                        TokenParser::NODE_PUBLIC_METHOD,
                        TokenParser::NODE_PROTECTED_METHOD,
                        TokenParser::NODE_PRIVATE_METHOD
                    );
                    if ($stream->is($methodNodes)) {
                        $this->parseMethod($builder, $stream);
                    } else {
                        $this->parseProperty($builder, $stream);
                    }
                    break;
                default:
                    $stream->next();
                    break;
            }
        }

        return $builder;
    }
public function parse ( NodeStream $ stream ) { $ builder = new ClassBuilder ( ) ; while ( ! $ stream -> is ( TokenParser :: NODE_EON ) ) { switch ( $ this -> status ) { case self :: STAT_NONE : $ this -> parseClass ( $ builder , $ stream ) ; break ; case self :: STAT_BODY : $ methodNodes = array ( TokenParser :: NODE_PUBLIC_METHOD , TokenParser :: NODE_PROTECTED_METHOD , TokenParser :: NODE_PRIVATE_METHOD ) ; if ( $ stream -> is ( $ methodNodes ) ) { $ this -> parseMethod ( $ builder , $ stream ) ; } else { $ this -> parseProperty ( $ builder , $ stream ) ; } break ; default : $ stream -> next ( ) ; break ; } } return $ builder ; }
Parses nodes and build PHP class

@param NodeStream $stream

@return ClassBuilder
Parses nodes and build PHP class