import { Token } from './tokenize';
/**
 * precedence: (see https://docs.python.org/3/reference/expressions.html#operator-precedence)
 * () and [] - groups
 *  '.', '.?' - chains
 *  token() - function arguments attached to vars
 *  | - filters
 *  '!', '-' - modifiers (only in specific conditions)
 *  '*', '/', '+', '-' - maths
 *  '==', '!=' - equals, not equals
 *  "in", "!in" - containment or maybe loop
 *  '&&', '||' - and and or
 *  ',' - commas
 */
declare type GroupSubtype = '()' | '[]';
export declare type MixedElement = Token | TempGroup | Var | TempFunc | TempModified | TempOperation;
export interface TempGroup {
    type: 'group';
    subtype: GroupSubtype;
    args: MixedElement[][];
}
export declare function build_groups(tokens: Token[]): (Token | TempGroup)[];
export interface ChainElement {
    lookup: string | number;
    type: 'str' | 'symbol' | 'num';
    op: '.' | '.?';
}
export interface Var {
    type: 'var';
    symbol: string;
    chain: ChainElement[];
}
export declare function build_chains(groups: (Token | TempGroup)[]): (Token | TempGroup | Var)[];
interface TempFunc {
    type: 'func';
    temp: true;
    var: Var;
    args: MixedElement[][];
}
export declare function build_functions(groups: MixedElement[]): (Token | TempGroup | Var | TempFunc)[];
export interface TempModified {
    type: 'mod';
    mod: '!' | '-';
    element: MixedElement;
}
declare const operator_precedence: readonly ["|", "*", "/", "+", "-", "==", "!=", "in", "!in", "&&", "||"];
export declare type OperatorType = typeof operator_precedence[number];
export interface TempOperation {
    type: 'operator';
    operator: OperatorType;
    args: MixedElement[];
}
export declare function build_operations(groups: MixedElement[]): MixedElement;
export declare function build_modifiers(groups: MixedElement[]): MixedElement[];
interface Str {
    type: 'str';
    value: string;
}
interface Num {
    type: 'num';
    value: number;
}
interface Bool {
    type: 'bool';
    value: boolean;
}
interface List {
    type: 'list';
    elements: Clause[];
}
export interface Func {
    type: 'func';
    var: Var;
    args: Clause[];
}
export interface Modified {
    type: 'mod';
    mod: '!' | '-';
    element: Clause;
}
export interface Operation {
    type: 'operator';
    operator: OperatorType;
    args: Clause[];
}
export declare type Clause = Var | Str | Num | List | Func | Modified | Operation | Bool;
export default function build_expression(tokens: Token[]): Clause;
export {};
