public function parse($nodes, $filename = NULL) {
    $this->nodes = $nodes;
    $this->filename = $filename;
    $this->position = 0;
    $this->length = count($nodes);
    $this->operators = [$this->sentinel];
    $this->operands = [];
    $this->E();
    if ($this->next()) {
      $next = $this->next();
      throw new ParserException(
        $this->filename,
        $next->getLineNumber(),
        $next->getColumnNumber(),
        "invalid expression");
    }
    return self::arrayLast($this->operands);
  }
public function parse($nodes, $filename = NULL) {
    $this->nodes = $nodes;
    $this->filename = $filename;
    $this->position = 0;
    $this->length = count($nodes);
    $this->operators = [$this->sentinel];
    $this->operands = [];
    $this->E();
    if ($this->next()) {
      $next = $this->next();
      throw new ParserException(
        $this->filename,
        $next->getLineNumber(),
        $next->getColumnNumber(),
        "invalid expression");
    }
    return self::arrayLast($this->operands);
  }
public function parse ( $ nodes , $ filename = NULL ) { $ this -> nodes = $ nodes ; $ this -> filename = $ filename ; $ this -> position = 0 ; $ this -> length = count ( $ nodes ) ; $ this -> operators = [ $ this -> sentinel ] ; $ this -> operands = [ ] ; $ this -> E ( ) ; if ( $ this -> next ( ) ) { $ next = $ this -> next ( ) ; throw new ParserException ( $ this -> filename , $ next -> getLineNumber ( ) , $ next -> getColumnNumber ( ) , "invalid expression" ) ; } return self :: arrayLast ( $ this -> operands ) ; }
Parse the expression nodes into a tree.
@param Node[] $nodes
Array of operands and operators
@param string $filename
Filename being parsed.
@return Node
@throws ParserException
Parse the expression nodes into a tree .