src/Peach/DF/JsonCodec/ArrayExpr.php
public function handle(Context $context)
    {
        $beginArray = new StructuralChar(array("["));
        $beginArray->handle($context);
        
        if ($context->current() === "]") {
            $endArray = new StructuralChar(array("]"));
            $endArray->handle($context);
            $this->result = array();
            return;
        }
        
        $result = array();
        while (true) {
            $value = new Value();
            $value->handle($context);
            $result[] = $value->getResult();
            
            $struct = new StructuralChar(array(",", "]"));
            $struct->handle($context);
            if ($struct->getResult() === "]") {
                $this->result = $result;
                break;
            }
        }
    }
public function handle(Context $context)
    {
        $beginArray = new StructuralChar(array("["));
        $beginArray->handle($context);
        
        if ($context->current() === "]") {
            $endArray = new StructuralChar(array("]"));
            $endArray->handle($context);
            $this->result = array();
            return;
        }
        
        $result = array();
        while (true) {
            $value = new Value();
            $value->handle($context);
            $result[] = $value->getResult();
            
            $struct = new StructuralChar(array(",", "]"));
            $struct->handle($context);
            if ($struct->getResult() === "]") {
                $this->result = $result;
                break;
            }
        }
    }
現在の Context から配列部分を読み込みます.

@param Context $context