public function op_next($op, $pos, &$op_queue, &$token_queue) { $num_args = 0; $next_index = array_search($op->input, $this->op_parts); $is_next = (bool) (0 === $next_index); if ($is_next) { if (0 === $this->op_def[0][0]) { $num_args = XpresionOp::match_args($this->op_def[0][2], $pos - 1, $op_queue, $token_queue); if (false === $num_args) { $is_next = false; } else { $this->arity = $num_args; array_shift($this->op_def); } } } if ($is_next) { array_shift($this->op_def); array_shift($this->op_parts); } return $is_next; }
public function __construct($input = '', $output = '', $otype = null, $priority = 1, $arity = 1, $associativity = null, $fixity = null) { parent::__construct(is_string($input) ? array($input, $arity) : $input, Xpresion::PREFIX, null !== $associativity ? $associativity : Xpresion::RIGHT, $priority, $output, $otype, null !== $fixity ? $fixity : Xpresion::PREFIX); $this->type = Xpresion::T_FUN; }