import type { Token, ASTNode, CommandNode } from '../types/core';
import { TokenType } from './tokenizer';
export interface Position {
    start: number;
    end: number;
    line: number;
    column: number;
}
export interface IdentifierNode extends ASTNode {
    type: 'identifier';
    name: string;
    scope?: 'local' | 'global';
}
export interface LiteralNode extends ASTNode {
    type: 'literal';
    value: unknown;
    raw: string;
}
export interface BinaryExpressionNode extends ASTNode {
    type: 'binaryExpression';
    operator: string;
    left: ASTNode;
    right: ASTNode;
}
export interface UnaryExpressionNode extends ASTNode {
    type: 'unaryExpression';
    operator: string;
    argument: ASTNode;
    prefix: boolean;
}
export interface CallExpressionNode extends ASTNode {
    type: 'callExpression';
    callee: ASTNode;
    arguments: ASTNode[];
}
export interface MemberExpressionNode extends ASTNode {
    type: 'memberExpression';
    object: ASTNode;
    property: ASTNode;
    computed: boolean;
}
export interface SelectorNode extends ASTNode {
    type: 'selector';
    value: string;
}
export interface PossessiveExpressionNode extends ASTNode {
    type: 'possessiveExpression';
    object: ASTNode;
    property: ASTNode;
}
export interface BlockNode extends ASTNode {
    type: 'block';
    commands: ASTNode[];
}
export interface StringLiteralNode extends ASTNode {
    type: 'string';
    value: string;
}
export interface ObjectLiteralNode extends ASTNode {
    type: 'objectLiteral';
    properties: Array<{
        key: ASTNode;
        value: ASTNode;
    }>;
}
export interface ArrayLiteralNode extends ASTNode {
    type: 'arrayLiteral';
    elements: ASTNode[];
}
export interface PropertyOfExpressionNode extends ASTNode {
    type: 'propertyOfExpression';
    property: ASTNode;
    target: ASTNode;
}
export interface CommandSequenceNode extends ASTNode {
    type: 'CommandSequence';
    commands: ASTNode[];
}
export interface ProgramNode extends ASTNode {
    type: 'Program';
    statements: ASTNode[];
}
export interface MultiWordPattern {
    command: string;
    keywords: string[];
    minArgs?: number;
    maxArgs?: number;
}
export interface ParserContext {
    readonly tokens: Token[];
    current: number;
    advance(): Token;
    peek(): Token;
    previous(): Token;
    consume(expected: string | TokenType, message: string): Token;
    check(value: string): boolean;
    checkIdentifierLike(): boolean;
    checkSelector(): boolean;
    checkAnySelector(): boolean;
    checkLiteral(): boolean;
    checkReference(): boolean;
    checkTimeExpression(): boolean;
    checkEvent(): boolean;
    checkIsCommand(): boolean;
    checkContextVar(): boolean;
    match(...types: Array<string | TokenType>): boolean;
    matchOperator(operator: string): boolean;
    isAtEnd(): boolean;
    createIdentifier(name: string): IdentifierNode;
    createLiteral(value: unknown, raw: string): ASTNode;
    createSelector(value: string): ASTNode;
    createBinaryExpression(operator: string, left: ASTNode, right: ASTNode): ASTNode;
    createUnaryExpression(operator: string, operand: ASTNode, prefix?: boolean): ASTNode;
    createMemberExpression(object: ASTNode, property: ASTNode, computed: boolean): ASTNode;
    createPossessiveExpression(object: ASTNode, property: ASTNode): ASTNode;
    createCallExpression(callee: ASTNode, args: ASTNode[]): ASTNode;
    createErrorNode(): ASTNode;
    createProgramNode(statements: ASTNode[]): ASTNode;
    createCommandFromIdentifier(identifierNode: IdentifierNode): CommandNode;
    parseExpression(): ASTNode;
    parsePrimary(): ASTNode;
    parseCall(): ASTNode;
    parseAssignment(): ASTNode;
    parseLogicalOr(): ASTNode;
    parseLogicalAnd(): ASTNode;
    parseEquality(): ASTNode;
    parseComparison(): ASTNode;
    parseAddition(): ASTNode;
    parseMultiplication(): ASTNode;
    parseImplicitBinary(): ASTNode;
    parseConditional(): ASTNode;
    parseConditionalBranch(): ASTNode;
    parseEventHandler(): ASTNode;
    parseBehaviorDefinition(): ASTNode;
    parseNavigationFunction(): ASTNode;
    parseMyPropertyAccess(): ASTNode;
    parseDollarExpression(): ASTNode;
    parseHyperscriptSelector(): ASTNode;
    parseAttributeOrArrayLiteral(): ASTNode;
    parseObjectLiteral(): ASTNode;
    parseCSSObjectLiteral(): ASTNode;
    parseCommand(): CommandNode;
    parseCommandSequence(): ASTNode;
    parseCommandListUntilEnd(): ASTNode[];
    savePosition(): number;
    restorePosition(pos: number): void;
    peekAt(offset: number): Token | null;
    getPosition(): Position;
    addError(message: string): void;
    addWarning(warning: string): void;
    isCommand(name: string): boolean;
    isCompoundCommand(name: string): boolean;
    isKeyword(name: string): boolean;
    getMultiWordPattern(commandName: string): MultiWordPattern | null;
    resolveKeyword(value: string): string;
    getInputSlice(start: number, end?: number): string;
}
export type CommandParserFunction = (token: Token, context: ParserContext) => CommandNode;
export type CompoundCommandParserFunction = (identifierNode: IdentifierNode, context: ParserContext) => CommandNode | null;
export type TokenNavigationFunction = (context: ParserContext) => Token | boolean;
export type ASTNodeCreatorFunction = (...args: any[]) => ASTNode;
export type ExpressionParserFunction = (context: ParserContext) => ASTNode;
export interface ParseResult {
    success: boolean;
    node?: ASTNode;
    error?: {
        name: string;
        message: string;
        line?: number;
        column?: number;
        position?: number;
    };
    warnings?: string[];
}
//# sourceMappingURL=parser-types.d.ts.map