QuackCompiler\Parser\Grammar::_forStmt PHP Method

_forStmt() public method

public _forStmt ( )
    public function _forStmt()
    {
        $this->parser->match(Tag::T_FOR);
        $variable = $this->identifier();
        $this->parser->match(Tag::T_FROM);
        $from = $this->_expr();
        $this->parser->match(Tag::T_TO);
        $to = $this->_expr();
        $by = null;
        if ($this->parser->consumeIf(Tag::T_BY)) {
            $by = $this->_expr();
        }
        $body = new StmtList(iterator_to_array($this->_innerStmtList()));
        $this->parser->match(Tag::T_END);
        return new ForStmt($variable, $from, $to, $by, $body);
    }