/**
 * Modular Lexer Implementation - Compatible Version
 *
 * This implementation works with the existing Token interface and provides
 * a clean, modular approach to lexical analysis using the Strategy Pattern.
 */
import { TokenType, Token } from '../types';
export interface ITokenRecognizer {
    readonly priority: number;
    canRecognize(input: string, position: number): boolean;
    recognize(input: string, position: number, line: number, column: number): RecognitionResult | null;
}
export interface RecognitionResult {
    token: Token;
    consumed: number;
}
export interface ILexer {
    tokenize(source: string): LexerResult;
}
export interface LexerResult {
    tokens: Token[];
    errors: LexicalError[];
}
export declare class LexicalError extends Error {
    readonly line: number;
    readonly column: number;
    readonly char: string;
    constructor(message: string, line: number, column: number, char: string);
}
export declare abstract class BaseTokenRecognizer implements ITokenRecognizer {
    readonly priority: number;
    constructor(priority: number);
    abstract canRecognize(input: string, position: number): boolean;
    abstract recognize(input: string, position: number, line: number, column: number): RecognitionResult | null;
    protected createToken(type: TokenType, value: string, line: number, column: number): Token;
    protected peek(input: string, position: number, offset?: number): string;
    protected isAtEnd(input: string, position: number): boolean;
}
export declare class KeywordRecognizer extends BaseTokenRecognizer {
    private readonly keywords;
    constructor();
    canRecognize(input: string, position: number): boolean;
    recognize(input: string, position: number, line: number, column: number): RecognitionResult | null;
    private isCyrillicIdentifierChar;
}
export declare class IdentifierRecognizer extends BaseTokenRecognizer {
    constructor();
    canRecognize(input: string, position: number): boolean;
    recognize(input: string, position: number, line: number, column: number): RecognitionResult | null;
    private isIdentifierChar;
}
export declare class NumberRecognizer extends BaseTokenRecognizer {
    constructor();
    canRecognize(input: string, position: number): boolean;
    recognize(input: string, position: number, line: number, column: number): RecognitionResult | null;
}
export declare class StringRecognizer extends BaseTokenRecognizer {
    constructor();
    canRecognize(input: string, position: number): boolean;
    recognize(input: string, position: number, line: number, column: number): RecognitionResult | null;
    private handleEscapeSequence;
}
export declare class OperatorRecognizer extends BaseTokenRecognizer {
    private readonly operators;
    private readonly sortedOperators;
    constructor();
    canRecognize(input: string, position: number): boolean;
    recognize(input: string, position: number, line: number, column: number): RecognitionResult | null;
    private matchesAt;
}
export declare class ModularLexer implements ILexer {
    private readonly recognizers;
    constructor(recognizers?: ITokenRecognizer[]);
    tokenize(source: string): LexerResult;
    private nextToken;
    private isWhitespace;
    static withRecognizers(recognizers: ITokenRecognizer[]): ModularLexer;
    static minimal(): ModularLexer;
}
export declare function demonstrateModularLexer(): void;
//# sourceMappingURL=modular-lexer-compatible.d.ts.map