/** * Aexol Language Tokenizer * * Provides a stream-like interface for token consumption and lookahead. * Builds on the Lexer to handle token stream management. */ import { TokenType } from "./lexer.js"; import type { Token } from "./lexer.js"; export declare class Tokenizer { private tokens; private position; constructor(source: string); /** * Get the current token without advancing */ current(): Token; /** * Peek at the next token(s) without advancing */ peek(offset?: number): Token; /** * Peek backwards */ peekBack(offset?: number): Token; /** * Advance to the next token and return the current one */ advance(): Token; /** * Check if current token matches a type */ check(type: TokenType): boolean; /** * Check if current token matches multiple types */ checkAny(...types: TokenType[]): boolean; /** * Consume a token of expected type or throw error */ consume(type: TokenType, message?: string): Token; /** * Try to consume a token of type, return null if not found */ tryConsume(type: TokenType): Token | null; /** * Match and consume one of multiple types */ match(...types: TokenType[]): Token | null; /** * Check if we've reached EOF */ isAtEnd(): boolean; /** * Get all tokens */ getAllTokens(): Token[]; /** * Get current position in token stream */ getPosition(): number; /** * Set position in token stream */ setPosition(pos: number): void; /** * Get tokens until a certain type is encountered */ collectUntil(type: TokenType): Token[]; /** * Get a range of tokens */ getRange(start: number, end: number): Token[]; /** * Synchronize on error - skip tokens until we find a statement boundary */ synchronize(): void; /** * Create a copy of the tokenizer at current position */ clone(): Tokenizer; /** * Get human-readable representation of current token */ getErrorContext(): string; /** * Get tokens in a specific line */ getLineTokens(lineNumber: number): Token[]; /** * Skip newlines */ skipNewlines(): void; /** * Skip indentation tokens */ skipIndentation(): void; /** * Get diagnostic information about tokenizer state */ getDiagnostics(): { totalTokens: number; currentPosition: number; currentToken: Token; tokensRemaining: number; }; } //# sourceMappingURL=tokenizer.d.ts.map