src/Peach/DF/JsonCodec/ObjectExpr.php
public function handle(Context $context)
    {
        $beginObject = new StructuralChar(array("{"));
        $beginObject->handle($context);
        
        $container = $this->getContainer($context);
        if ($context->current() === "}") {
            $endObject = new StructuralChar(array("}"));
            $endObject->handle($context);
            $this->result = $container->getResult();
            return;
        }
        
        while (true) {
            if ($context->current() === "}") {
                throw $context->createException("Closing bracket after comma is not permitted");
            }
            $member = new Member();
            $member->handle($context);
            $container->setMember($member);
            
            $struct = new StructuralChar(array(",", "}"));
            $struct->handle($context);
            if ($struct->getResult() === "}") {
                $this->result = $container->getResult();
                break;
            }
        }
    }
public function handle(Context $context)
    {
        $beginObject = new StructuralChar(array("{"));
        $beginObject->handle($context);
        
        $container = $this->getContainer($context);
        if ($context->current() === "}") {
            $endObject = new StructuralChar(array("}"));
            $endObject->handle($context);
            $this->result = $container->getResult();
            return;
        }
        
        while (true) {
            if ($context->current() === "}") {
                throw $context->createException("Closing bracket after comma is not permitted");
            }
            $member = new Member();
            $member->handle($context);
            $container->setMember($member);
            
            $struct = new StructuralChar(array(",", "}"));
            $struct->handle($context);
            if ($struct->getResult() === "}") {
                $this->result = $container->getResult();
                break;
            }
        }
    }
public function handle ( Context $ context ) { $ beginObject = new StructuralChar ( array ( "{" ) ) ; $ beginObject -> handle ( $ context ) ; $ container = $ this -> getContainer ( $ context ) ; if ( $ context -> current ( ) === "}" ) { $ endObject = new StructuralChar ( array ( "}" ) ) ; $ endObject -> handle ( $ context ) ; $ this -> result = $ container -> getResult ( ) ; return ; } while ( true ) { if ( $ context -> current ( ) === "}" ) { throw $ context -> createException ( "Closing bracket after comma is not permitted" ) ; } $ member = new Member ( ) ; $ member -> handle ( $ context ) ; $ container -> setMember ( $ member ) ; $ struct = new StructuralChar ( array ( "," , "}" ) ) ; $ struct -> handle ( $ context ) ; if ( $ struct -> getResult ( ) === "}" ) { $ this -> result = $ container -> getResult ( ) ; break ; } } }
現在の Context から object 部分を読み込みます.

@param Context $context
現在の Context から object 部分を読み込みます .