Perform a shift action.
@param int The new state to shift in
@param int The major token to shift in
@param mixed the minor token to shift in
556206
function yy_shift($yyNewState, $yyMajor, $yypMinor)
    {
        $this->yyidx++;
        if ($this->yyidx >= self::YYSTACKDEPTH) {
            $this->yyidx--;
            if (self::$yyTraceFILE) {
                fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
            }
            while ($this->yyidx >= 0) {
                $this->yy_pop_parser_stack();
            }
            /* Here code is inserted which will execute if the parser
            ** stack ever overflows */
            return;
        }
        $yytos = new yyStackEntry;
        $yytos->stateno = $yyNewState;
        $yytos->major = $yyMajor;
        $yytos->minor = $yypMinor;
        array_push($this->yystack, $yytos);
        if (self::$yyTraceFILE && $this->yyidx > 0) {
            fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
                $yyNewState);
            fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
            for ($i = 1; $i <= $this->yyidx; $i++) {
                fprintf(self::$yyTraceFILE, " %s",
                    self::tokenName($this->yystack[$i]->major));
            }
            fwrite(self::$yyTraceFILE,"\n");
        }
    }
610243
protected function shiftRows()
    {
        $temp = '';
        for ($i = 1; $i < 4; ++$i) {
            for ($j = 0; $j < self::$nb; ++$j) {
                $temp[$j] = $this->state[$i][($j + $i) % self::$nb];
            }
            for ($j = 0; $j < self::$nb; ++$j) {
                $this->state[$i][$j] = $temp[$j];
            }
        }
    }
619676
def shift(self, next_state, token_type, value, lineno, column):
        """"""
        dfa, state, node = self.stack[-1]
        new_node = Node(token_type, value, None, lineno, column)
        node.children.append(new_node)
        self.stack[-1] = (dfa, next_state, node)
470269
public function move($action, $entity)
    {
        $this->checkSortableGroupField(static::getSortableGroupField(), $entity);

        $this->_transaction(function () use ($entity, $action) {
            $sortableField = static::getSortableField();

            $oldPosition = $this->getAttribute($sortableField);
            $newPosition = $entity->getAttribute($sortableField);

            if ($oldPosition === $newPosition) {
                return;
            }

            $isMoveBefore = $action === 'moveBefore'; // otherwise moveAfter
            $isMoveForward = $oldPosition < $newPosition;

            if ($isMoveForward) {
                $this->queryBetween($oldPosition, $newPosition)->decrement($sortableField);
            } else {
                $this->queryBetween($newPosition, $oldPosition)->increment($sortableField);
            }

            $this->setAttribute($sortableField, $this->getNewPosition($isMoveBefore, $isMoveForward, $newPosition));
            $entity->setAttribute($sortableField, $this->getNewPosition(!$isMoveBefore, $isMoveForward, $newPosition));

            $this->save();
            $entity->save();
        });
    }
220616
protected function acceptInput($digit)
    {
        switch ($this->evaluateInput($digit)) {
            case self::INPUT_CANCEL:
                $this->state = self::STATE_CANCEL;
                break;
            case self::INPUT_END:
                $this->state = self::STATE_COMPLETE;
                break;
            default:
                $this->appendInput($digit);
                if ($this->minInput > 0 && $this->inputLengthIsAtLeast($this->minInput)) {
                    $this->state = self::STATE_COMPLETE;
                }
        }
    }
451844
function shift() {
        if(\count($this->queue) === 0) {
            return false;
        }
        
        $item = \array_shift($this->queue);
        $this->remaining--;
        
        return $item;
    }
776849
public function shiftPositions()
    {
        $this->owner->updateAllCounters(
            [$this->positionAttribute => -1],
            ['>', $this->positionAttribute, $this->owner->{$this->positionAttribute}]
        );
    }
981718
private synchronized void changeState(PrimitiveState state) {
    if (this.state != state) {
      this.state = state;
      stateChangeListeners.forEach(l -> threadContext.execute(() -> l.accept(state)));
    }
  }
706180
protected void shiftUp(int shift) {

        int min = getMinimumVerticalScrollPosition();
        if ((m_currentValue - shift) > min) {
            setVerticalScrollPosition(m_currentValue - shift);
        } else {
            setVerticalScrollPosition(min);
        }
    }
879310
public final function shift() {
        //if ($this->lenght === 0) return;

        if ($this->lenght > 0) {
            $value = $this->memory[0];

            for ($address = 0; $address < count($this->memory)-1; $address++) {
                $this->memory[$address] = $this->memory[$address+1];
            }

            unset($this->memory[$this->lenght-1]);

            $this->lenght--;
            
        } else {
            $value = null;
        }
        return $value;
    }
544775
def _shift(tokens):
    """"""
    after = tokens.peek(n=1, skip=_is_comment, drop=True)
    tok = tokens._buffer.popleft()
    return tok[0], tok[1], tok[2], after[0]
650688
function bitwise_leftShift($shift)
    {
        $temp = new Math_BigInteger();

        switch (MATH_BIGINTEGER_MODE) {
            case MATH_BIGINTEGER_MODE_GMP:
                static $two;

                if (!isset($two)) {
                    $two = gmp_init('2');
                }

                $temp->value = gmp_mul($this->value, gmp_pow($two, $shift));

                break;
            case MATH_BIGINTEGER_MODE_BCMATH:
                $temp->value = bcmul($this->value, bcpow('2', $shift, 0), 0);

                break;
            default: // could just replace _rshift with this, but then all _lshift() calls would need to be rewritten
                     // and I don't want to do that...
                $temp->value = $this->value;
                $temp->_lshift($shift);
        }

        return $this->_normalize($temp);
    }
1225527
function bitwise_leftShift($shift)
    {
        $temp = new static();

        switch (MATH_BIGINTEGER_MODE) {
            case self::MODE_GMP:
                static $two;

                if (!isset($two)) {
                    $two = gmp_init('2');
                }

                $temp->value = gmp_mul($this->value, gmp_pow($two, $shift));

                break;
            case self::MODE_BCMATH:
                $temp->value = bcmul($this->value, bcpow('2', $shift, 0), 0);

                break;
            default: // could just replace _rshift with this, but then all _lshift() calls would need to be rewritten
                     // and I don't want to do that...
                $temp->value = $this->value;
                $temp->_lshift($shift);
        }

        return $this->_normalize($temp);
    }
1296798
public function shift() {
    $items = $this->getItems();
    if ($items->isEmpty()) {
      return NULL;
    }
    if (count($items) === 1) {
      $pop_item = $items[0];
      $pop_item->remove();
      return $pop_item;
    }
    $pop_item = $items[0];
    $pop_item->nextUntil(function ($node) {
      if ($node instanceof HiddenNode) {
        return FALSE;
      }
      if ($node instanceof TokenNode && $node->getType() === ',') {
        return FALSE;
      }
      return TRUE;
    })->remove();
    $pop_item->remove();
    return $pop_item;
  }
37328
final protected function shiftLeftFromPos($position)
    {
        $cnt = parent::count();
        if ($position < 1 || $position >= $cnt) {
            throw new \OutOfBoundsException('position to shift from must be in range 1..Length-1');
        }
        for ($i = $position; $i < $cnt; $i++) {
            $this->items[$i - 1] = $this->items[$i];
        }
    }
567378
public static function invoke_move_action($action, $dir, $table, $field, $key, $index, $position) {
        global $CFG, $XMLDB, $SESSION;
        require_once($CFG->libdir.'/ddllib.php');
        require_once("$CFG->dirroot/$CFG->admin/tool/xmldb/actions/XMLDBAction.class.php");
        require_once("$CFG->dirroot/$CFG->admin/tool/xmldb/actions/XMLDBCheckAction.class.php");
        $params = self::validate_parameters(self::invoke_move_action_parameters(), [
            'action' => $action,
            'dir' => $dir,
            'table' => $table,
            'field' => $field,
            'key' => $key,
            'index' => $index,
            'position' => $position
        ]);

        self::validate_context(context_system::instance());
        require_capability('moodle/site:config', context_system::instance());

        if (!in_array($action, ['move_updown_table', 'move_updown_field', 'move_updown_key', 'move_updown_index'])) {
            throw new coding_exception('Unsupported action');
        }

        $action = $params['action'];
        $actionsroot = "$CFG->dirroot/$CFG->admin/tool/xmldb/actions";
        $actionclass = $action . '.class.php';
        $actionpath = "$actionsroot/$action/$actionclass";

        if (file_exists($actionpath) && is_readable($actionpath)) {
            require_once($actionpath);
        }
        if (!class_exists($action)) {
            throw new coding_exception('Action class not found');
        }

        if (!isset($SESSION->xmldb)) {
            $XMLDB = new stdClass;
        } else {
            $XMLDB = unserialize($SESSION->xmldb);
        }

        $_POST['dir'] = $params['dir'];
        $_POST['table'] = $params['table'];
        $_POST['field'] = $params['field'];
        $_POST['key'] = $params['key'];
        $_POST['index'] = $params['index'];
        $_POST['direction'] = ($params['position'] > 0) ? 'down' : 'up';
        for ($i = 0; $i < abs($params['position']); $i++) {
            $a = new $action();
            $a->invoke();
        }
        $SESSION->xmldb = serialize($XMLDB);
    }
1111841
function bitwise_rightShift($shift)
    {
        $temp = new static();

        switch (MATH_BIGINTEGER_MODE) {
            case self::MODE_GMP:
                static $two;

                if (!isset($two)) {
                    $two = gmp_init('2');
                }

                $temp->value = gmp_div_q($this->value, gmp_pow($two, $shift));

                break;
            case self::MODE_BCMATH:
                $temp->value = bcdiv($this->value, bcpow('2', $shift, 0), 0);

                break;
            default: // could just replace _lshift with this, but then all _lshift() calls would need to be rewritten
                     // and I don't want to do that...
                $temp->value = $this->value;
                $temp->_rshift($shift);
        }

        return $this->_normalize($temp);
    }