HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/design.system/node_modules/@microsoft/tsdoc/lib/parser/TokenReader.d.ts
import { type Token, TokenKind } from './Token';
import { TokenSequence } from './TokenSequence';
import type { ParserContext } from './ParserContext';
/**
 * Manages a stream of tokens that are read by the parser.
 *
 * @remarks
 * Use TokenReader.readToken() to read a token and advance the stream pointer.
 * Use TokenReader.peekToken() to preview the next token.
 * Use TokenReader.createMarker() and backtrackToMarker() to rewind to an earlier point.
 * Whenever readToken() is called, the token is added to an accumulated TokenSequence
 * that can be extracted by calling extractAccumulatedSequence().
 */
export declare class TokenReader {
    readonly tokens: ReadonlyArray<Token>;
    private readonly _parserContext;
    private _readerStartIndex;
    private _readerEndIndex;
    private _currentIndex;
    private _accumulatedStartIndex;
    constructor(parserContext: ParserContext, embeddedTokenSequence?: TokenSequence);
    /**
     * Extracts and returns the TokenSequence that was accumulated so far by calls to readToken().
     * The next call to readToken() will start a new accumulated sequence.
     */
    extractAccumulatedSequence(): TokenSequence;
    /**
     * Returns true if the accumulated sequence has any tokens yet.  This will be false
     * when the TokenReader starts, and it will be false immediately after a call
     * to extractAccumulatedSequence().  Otherwise, it will become true whenever readToken()
     * is called.
     */
    isAccumulatedSequenceEmpty(): boolean;
    /**
     * Like extractAccumulatedSequence(), but returns undefined if nothing has been
     * accumulated yet.
     */
    tryExtractAccumulatedSequence(): TokenSequence | undefined;
    /**
     * Asserts that isAccumulatedSequenceEmpty() should return false.  If not, an exception
     * is throw indicating a parser bug.
     */
    assertAccumulatedSequenceIsEmpty(): void;
    /**
     * Returns the next token that would be returned by _readToken(), without
     * consuming anything.
     */
    peekToken(): Token;
    /**
     * Returns the TokenKind for the next token that would be returned by _readToken(), without
     * consuming anything.
     */
    peekTokenKind(): TokenKind;
    /**
     * Like peekTokenKind(), but looks ahead two tokens.
     */
    peekTokenAfterKind(): TokenKind;
    /**
     * Like peekTokenKind(), but looks ahead three tokens.
     */
    peekTokenAfterAfterKind(): TokenKind;
    /**
     * Extract the next token from the input stream and return it.
     * The token will also be appended to the accumulated sequence, which can
     * later be accessed via extractAccumulatedSequence().
     */
    readToken(): Token;
    /**
     * Returns the kind of the token immediately before the current token.
     */
    peekPreviousTokenKind(): TokenKind;
    /**
     * Remembers the current position in the stream.
     */
    createMarker(): number;
    /**
     * Rewinds the stream pointer to a previous position in the stream.
     */
    backtrackToMarker(marker: number): void;
}
//# sourceMappingURL=TokenReader.d.ts.map