Called by the inline parser, when it found a separator.

@param string $token The token found as a separator
14966
public function addSeparator($token)
    {
        $this->wikiContent .= $this->wikiContentArr[$this->separatorCount];
        ++$this->separatorCount;
        if ($this->separatorCount > count($this->separators)) {
            $this->currentSeparator = end($this->separators);
        } else {
            $this->currentSeparator = $this->separators[$this->separatorCount - 1];
        }
        $this->wikiContent .= $this->currentSeparator;
        $this->contents[$this->separatorCount] = '';
        $this->wikiContentArr[$this->separatorCount] = '';
    }
1308114
protected function clearToken($token)
    {
        $token = $this->tokenize($token);
        $this->checkToken($token);
        $this->tokens[$token] = array();
    }
980545
private function outputLine($string, $token)
    {
        $this->output($string, $token);
        $this->newLine = true;
    }
876222
private function _processBracesOpen($token) {
		// "{" signifies beginning of a block. We need to look for
		// its position when it is a beginning of a control structure
		// or a function or class definition.

		// Check we have a white space before a curly opening in case of a "same line" indentation
		if ($this->_config->getTestProperty('funcDefinitionOpenCurly', 'position') === SAME_LINE) {
			$this->_checkWhiteSpaceBefore($token->text);
		}
		$stackitem = new StatementItem();
		$stackitem->line = $token->line;

		// if _justAfterFuncStmt is set, the "{" is the beginning of a function definition block
		if ($this->_justAfterFuncStmt) {
			$this->_processFunctionStart();
			$stackitem->type = "FUNCTION";
			$stackitem->name = $this->_currentFunctionName;
			$stackitem->visibility = $this->_functionVisibility;
		} else if ($this->_justAfterControlStmt) {
			// if _justAfterControlStmt is set, the "{" is the beginning of a control stratement block
			$this->_processControlStatementStart();
			$stackitem->type = strtoupper($this->_currentStatement);
		} else if ($this->_inClassStatement) {
			// if _inClassStatement is set then we are just after a class declaration
			$this->_inClassStatement = false;
			$this->_processClassStart();
			$stackitem->type = "CLASS";
			$stackitem->name = $this->_currentClassname;
		} else if ($this->_inInterfaceStatement) {
			// if _inInterfaceStatement is set then we are just after a Interface declaration
			$this->_inInterfaceStatement = false;
			$this->_processInterfaceStart();
			$stackitem->type = "INTERFACE";
			$stackitem->name = $this->_currentInterfacename;
		} else {
			$stackitem->type = "{";
		}

		// Check if the block is not empty
		$this->_checkEmptyBlock();

		$this->statementStack->push($stackitem);
	}
110440
private function _checkProhibitedKeywordsRegex($token) {
		if ($this->_isActive('checkProhibitedKeywordsRegex')) {

			foreach ($this->_prohibitedKeywordsRegex as $pattern) {

				preg_match_all($pattern, $token->text, $matches);
				$matches = $matches[0];
				if (!empty($matches)) {
					foreach ($matches as $key => $value) {
						$msg = $this->_getMessage('PROHIBITED_KEYWORD_REGEX', $value);
						$this->_writeError('checkProhibitedKeywordsRegex', $msg);
					}
				}
			}
		}
	}
1331130
protected static function parseOption($token)
    {
        list($token, $description) = static::extractDescription($token);

        $matches = preg_split('/\s*\|\s*/', $token, 2);

        if (isset($matches[1])) {
            $shortcut = $matches[0];
            $token    = $matches[1];
        } else {
            $shortcut = null;
        }

        switch (true) {
            case Str::endsWith($token, '='):
                return new InputOption(trim($token, '='), $shortcut, InputOption::VALUE_OPTIONAL, $description);
            case Str::endsWith($token, '=*'):
                return new InputOption(trim($token, '=*'), $shortcut, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, $description);
            case preg_match('/(.+)\=(.+)/', $token, $matches):
                return new InputOption($matches[1], $shortcut, InputOption::VALUE_OPTIONAL, $description, $matches[2]);
            default:
                return new InputOption($token, $shortcut, InputOption::VALUE_NONE, $description);
        }
    }
280786
public function match($token)
    {
        $lookaheadType = $this->lexer->lookahead['type'];

        // Short-circuit on first condition, usually types match
        if ($lookaheadType === $token) {
            $this->lexer->moveNext();

            return;
        }

        // If parameter is not identifier (1-99) must be exact match
        if ($token < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is keyword (200+) must be exact match
        if ($token > Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is T_IDENTIFIER, then matches T_IDENTIFIER (100) and keywords (200+)
        if ($token === Lexer::T_IDENTIFIER && $lookaheadType < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        $this->lexer->moveNext();
    }
1202631
private function match($token)
    {
        if (!$this->lexer->isNextToken($token)) {
            throw SyntaxException::expectedToken(
                $this->lexer->getLiteral($token),
                null,
                $this->lexer
            );
        }

        return $this->lexer->moveNext();
    }
1033477
protected static function parseArgument($token)
    {
        list($token, $description) = static::extractDescription($token);

        switch (true) {
            case Str::endsWith($token, '?*'):
                return new InputArgument(trim($token, '?*'), InputArgument::IS_ARRAY, $description);
            case Str::endsWith($token, '*'):
                return new InputArgument(trim($token, '*'), InputArgument::IS_ARRAY | InputArgument::REQUIRED, $description);
            case Str::endsWith($token, '?'):
                return new InputArgument(trim($token, '?'), InputArgument::OPTIONAL, $description);
            case preg_match('/(.+)\=\*(.+)/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::IS_ARRAY, $description, preg_split('/,\s?/', $matches[2]));
            case preg_match('/(.+)\=(.+)/', $token, $matches):
                return new InputArgument($matches[1], InputArgument::OPTIONAL, $description, $matches[2]);
            default:
                return new InputArgument($token, InputArgument::REQUIRED, $description);
        }
    }
233151
public function setAccessToken($token)
    {
        if (is_string($token)) {
            $token = new Token($token);
        }
        Requestor::setToken($token);
    }
732776
private function parseArgument($token)
    {
        $c = \count($this->arguments);

        // if input is expecting another argument, add it
        if ($this->definition->hasArgument($c)) {
            $arg = $this->definition->getArgument($c);
            $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token;

        // if last argument isArray(), append token to last argument
        } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
            $arg = $this->definition->getArgument($c - 1);
            $this->arguments[$arg->getName()][] = $token;

        // unexpected argument
        } else {
            $all = $this->definition->getArguments();
            if (\count($all)) {
                throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))));
            }

            throw new RuntimeException(sprintf('No arguments expected, got "%s".', $token));
        }
    }
115525
private function parsing() : void
    {
        $lines = explode("\n", $this->raw);

        foreach ($lines as $line) {
            // check "at" mark
            if (false === strpos($line, '@')) {
                continue;
            }

            // check inline annotation
            if ($anp = strpos($line, '//')) {
                $line = substr($line, 0, $anp);
            }

            // trim blanks
            $line = trim(ltrim($line, ' *'));

            // analyze expr
            if (false === $fws = strpos($line, ' ')) {
                // @some-key
                $key = substr($line, 1);
                $val = true;
            } else {
                // @some-key some-val
                $key = substr($line, 1, $fws - 1);
                $val = trim(substr($line, $fws));
            }

            $this->lines[] = [$key, $val];

            $this->declares[$key][] = $val;
        }
    }
1234792
private function _checkProhibitedKeywords($token) {
		if ($this->_isActive('checkProhibitedKeywords')) {
			foreach ($this->_prohibitedKeywords as $keyword) {
				if (strpos($token->text, $keyword) !== FALSE) {
					$msg = $this->_getMessage('PROHIBITED_KEYWORD', $token->text);
					$this->_writeError('checkProhibitedKeywords', $msg);
				}
			}
		}
	}
159671
protected static function parseOption($token)
    {
        $description = null;

        if (mb_strpos($token, ' : ') !== false) {
            list($token, $description) = explode(' : ', $token);
            $token = trim($token);
            $description = trim($description);
        }

        $shortcut = null;

        $matches = preg_split('/\s*\|\s*/', $token, 2);

        if (isset($matches[1])) {
            $shortcut = $matches[0];
            $token = $matches[1];
        }

        switch (true) {
            case Text::endsWith($token, '='):
                return new InputOption(trim($token, '='), $shortcut, InputOption::VALUE_OPTIONAL, $description);
            case Text::endsWith($token, '=*'):
                return new InputOption(trim($token, '=*'), $shortcut, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, $description);
            case preg_match('/(.+)\=(.+)/', $token, $matches):
                return new InputOption($matches[1], $shortcut, InputOption::VALUE_OPTIONAL, $description, $matches[2]);
            default:
                return new InputOption($token, $shortcut, InputOption::VALUE_NONE, $description);
        }
    }
1136984
public function contains(string $token): bool
    {
        $this->tokenize();
        return in_array($token, $this->tokens);
    }
990167
private function _processMinus($token) {
		if (!$this->_inFuncCall) {
			$this->_checkWhiteSpaceBefore($token->text);
		}
		// We allow some '-' signs to skip the the space afterwards for negative numbers
		// float number or integer
		if (!($this->tokenizer->checkNextToken(T_LNUMBER) || $this->tokenizer->checkNextToken(T_DNUMBER))) {
			$this->_checkWhiteSpaceAfter($token->text);
		}
	}
252310
public function addSeparator($token)
    {
        $this->row->addGenerator($this->generator);
        $this->generator = $this->documentGenerator->getInlineGenerator($this->generatorName);

        $this->wikiContent .= $this->wikiContentArr[$this->separatorCount];
        ++$this->separatorCount;
        $this->currentSeparator = $token;
        $this->wikiContent .= $token;
        $this->contents[$this->separatorCount] = '';
        $this->wikiContentArr[$this->separatorCount] = '';
    }