import { Token, Identifier, Location } from "../lexer";
import { BrsType, Argument, ValueKind, BrsString } from "../brsTypes";
import { Block } from "./Statement";
export interface Visitor<T> {
    visitBinary(expression: Binary): T;
    visitCall(expression: Call): T;
    visitAnonymousFunction(func: Function): T;
    visitAtSignGet(expression: AtSignGet): T;
    visitDottedGet(expression: DottedGet): T;
    visitIndexedGet(expression: IndexedGet): T;
    visitGrouping(expression: Grouping): T;
    visitLiteral(expression: Literal): T;
    visitArrayLiteral(expression: ArrayLiteral): T;
    visitAALiteral(expression: AALiteral): T;
    visitUnary(expression: Unary): T;
    visitVariable(expression: Variable): T;
}
/** A BrightScript expression */
export interface Expression {
    /**
     * Handles the enclosing `Expression` with `visitor`.
     * @param visitor the `Visitor` that will handle the enclosing `Expression`
     * @returns the BrightScript value resulting from evaluating the expression
     */
    accept<R>(visitor: Visitor<R>): R;
    /** The starting and ending location of the expression. */
    location: Location;
}
export declare class Binary implements Expression {
    readonly left: Expression;
    readonly token: Token;
    readonly right: Expression;
    constructor(left: Expression, token: Token, right: Expression);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class Call implements Expression {
    readonly callee: Expression;
    readonly closingParen: Token;
    readonly args: Expression[];
    readonly optional: boolean;
    static MaximumArguments: number;
    constructor(callee: Expression, closingParen: Token, args: Expression[], optional?: boolean);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class Function implements Expression {
    readonly parameters: Argument[];
    readonly returns: ValueKind;
    readonly body: Block;
    readonly keyword: Token;
    readonly end: Token;
    constructor(parameters: Argument[], returns: ValueKind, body: Block, keyword: Token, end: Token);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class AtSignGet implements Expression {
    readonly obj: Expression;
    readonly name: Identifier;
    readonly optional: boolean;
    constructor(obj: Expression, name: Identifier, optional?: boolean);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class DottedGet implements Expression {
    readonly obj: Expression;
    readonly name: Identifier;
    readonly optional: boolean;
    constructor(obj: Expression, name: Identifier, optional?: boolean);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class IndexedGet implements Expression {
    readonly obj: Expression;
    readonly indexes: Expression[];
    readonly closingSquare: Token;
    readonly optional: boolean;
    constructor(obj: Expression, indexes: Expression[], closingSquare: Token, optional?: boolean);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class Grouping implements Expression {
    readonly tokens: {
        left: Token;
        right: Token;
    };
    readonly expression: Expression;
    constructor(tokens: {
        left: Token;
        right: Token;
    }, expression: Expression);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class Literal implements Expression {
    readonly value: BrsType;
    readonly _location: Location | undefined;
    constructor(value: BrsType, _location: Location | undefined);
    accept<R>(visitor: Visitor<R>): R;
    get location(): Location;
}
export declare class ArrayLiteral implements Expression {
    readonly elements: Expression[];
    readonly open: Token;
    readonly close: Token;
    constructor(elements: Expression[], open: Token, close: Token);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
/** A member of an associative array literal. */
export interface AAMember {
    /** The name of the member. */
    name: BrsString;
    /** The expression evaluated to determine the member's initial value. */
    value: Expression;
}
export declare class AALiteral implements Expression {
    readonly elements: AAMember[];
    readonly open: Token;
    readonly close: Token;
    constructor(elements: AAMember[], open: Token, close: Token);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class Unary implements Expression {
    readonly operator: Token;
    readonly right: Expression;
    constructor(operator: Token, right: Expression);
    accept<R>(visitor: Visitor<R>): R;
    get location(): {
        file: string;
        start: {
            line: number;
            column: number;
        };
        end: {
            line: number;
            column: number;
        };
    };
}
export declare class Variable implements Expression {
    readonly name: Identifier;
    constructor(name: Identifier);
    accept<R>(visitor: Visitor<R>): R;
    get location(): Location;
}
