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;
    }