public static function createOperator($token_type, $static_only = FALSE) {
    if (array_key_exists($token_type, self::$operators)) {
      list($assoc, $precedence, $static, $binary_class_name, $unary_class_name) = self::$operators[$token_type];
      if ($static_only && !$static) {
        return NULL;
      }
      $operator = new Operator();
      $operator->type = $token_type;
      $operator->associativity = $assoc;
      $operator->precedence = $precedence;
      $operator->hasBinaryMode = $binary_class_name !== NULL;
      $operator->hasUnaryMode = $unary_class_name !== NULL;
      $operator->binaryClassName = $binary_class_name;
      $operator->unaryClassName = $unary_class_name;
      return $operator;
    }
    return NULL;
  }
public static function createOperator($token_type, $static_only = FALSE) {
    if (array_key_exists($token_type, self::$operators)) {
      list($assoc, $precedence, $static, $binary_class_name, $unary_class_name) = self::$operators[$token_type];
      if ($static_only && !$static) {
        return NULL;
      }
      $operator = new Operator();
      $operator->type = $token_type;
      $operator->associativity = $assoc;
      $operator->precedence = $precedence;
      $operator->hasBinaryMode = $binary_class_name !== NULL;
      $operator->hasUnaryMode = $unary_class_name !== NULL;
      $operator->binaryClassName = $binary_class_name;
      $operator->unaryClassName = $unary_class_name;
      return $operator;
    }
    return NULL;
  }
public static function createOperator ( $ token_type , $ static_only = FALSE ) { if ( array_key_exists ( $ token_type , self :: $ operators ) ) { list ( $ assoc , $ precedence , $ static , $ binary_class_name , $ unary_class_name ) = self :: $ operators [ $ token_type ] ; if ( $ static_only && ! $ static ) { return NULL ; } $ operator = new Operator ( ) ; $ operator -> type = $ token_type ; $ operator -> associativity = $ assoc ; $ operator -> precedence = $ precedence ; $ operator -> hasBinaryMode = $ binary_class_name !== NULL ; $ operator -> hasUnaryMode = $ unary_class_name !== NULL ; $ operator -> binaryClassName = $ binary_class_name ; $ operator -> unaryClassName = $ unary_class_name ; return $ operator ; } return NULL ; }
Create an OperatorNode for the given token type.
@param int|string $token_type
@param bool $static_only
@return Operator
Create an OperatorNode for the given token type .