import * as TSU from "@panyam/tsutils"; import { IDSet, SymbolSet, FirstSets, FollowSets, NullableSet } from "./sets"; type StringMap = TSU.StringMap; type Nullable = TSU.Nullable; export declare class Sym { readonly grammar: Grammar; readonly label: string; isTerminal: boolean; isAuxiliary: boolean; auxType: string | null; precedence: number; assocLeft: boolean; private static idCounter; creationId: number; id: number; constructor(grammar: Grammar, label: string, isTerminal: boolean, id?: Nullable); compareTo(another: this): number; equals(another: this): boolean; toString(): string; } export declare class Str { syms: Sym[]; constructor(...syms: Sym[]); append(...lits: Sym[]): this; extend(...strs: Str[]): this; copy(): Str; add(lit: Sym): void; isTerminal(index: number): boolean; get length(): number; toString(): string; slice(startIndex: number, endIndex: number): Str; splice(index: number, numToDelete: number, ...itemsToAdd: Sym[]): Str; compareTo(another: this): number; equals(another: this): boolean; containsAt(offset: number, another: Str): boolean; get debugString(): string; } export declare class RuleAction { value: string | number; constructor(value: string | number); get isFunction(): boolean; get isChildPosition(): boolean; } export declare class Rule { nt: Sym; rhs: Str; action: RuleAction | null; id: number; constructor(nt: Sym, rhs: Str, action?: RuleAction | null); get debugString(): string; equals(another: this): boolean; compareTo(another: this): number; } export declare class Grammar { startSymbol: Nullable; modified: boolean; protected symbolSet: IDSet; protected allRules: Rule[]; protected _rulesForNT: Nullable>; protected _followSets: Nullable; auxNTPrefix: string; readonly Null: Sym; readonly Eof: Sym; private _AugStartRule; private _hasNull; static make(callback: (g: Grammar) => void): Grammar; constructor(config?: any); rulesForNT(nt: Sym): Rule[]; get nullables(): NullableSet; get firstSets(): FirstSets; get followSets(): FollowSets; get augStartRule(): Rule; augmentStartSymbol(label?: string): this; refresh(): this; addTerminals(...terminals: string[]): void; get terminals(): ReadonlyArray; get allNonTerminals(): ReadonlyArray; get nonTerminals(): ReadonlyArray; get auxNonTerminals(): ReadonlyArray; get allSymbols(): ReadonlyArray; forEachNT(visitor: (nt: Sym) => void | boolean | undefined | null): void; forEachRule(nt: Nullable, visitor: (rule: Rule, index: number) => void | boolean | undefined | null): boolean; getRule(nt: string | Sym, index: number): Rule; findRule(nt: Sym, production: Str): number; add(nt: string | Sym, production: Str, action?: RuleAction | null): Rule; addRule(rule: Rule, index?: number): Rule; removeRules(pred: (r: Rule) => boolean): boolean; removeSymbols(pred: (s: Sym) => boolean): boolean; getSymById(id: number): Nullable; getSym(label: string): Nullable; ensureSym(sym: Sym, throwIfExists?: boolean): Sym; T(label: string, throwIfExists?: boolean): Sym; NT(label: string, isAuxiliary?: boolean, throwIfExists?: boolean): Sym; newTerm(label: string): Sym; newNT(label: string, isAuxiliary?: boolean): Sym; isTerminal(label: string): boolean; isNT(label: string): boolean; isAuxNT(label: string): boolean; seq(...exps: (Str | string)[]): Str; anyof(...rules: (Str | string)[]): Str; opt(exp: Str | string): Str; atleast0(exp: Str | string, leftRec?: boolean): Str; atleast1(exp: Str | string, leftRec?: boolean): Str; normalizeRule(exp: Str | string): Str; protected auxNTCount: number; protected newAuxNTName(): string; newAuxNT(name?: string): Sym; ensureAuxNT(...rules: Str[]): Sym; findAuxNT(filter: (nt: Sym) => boolean): Nullable; findAuxNTByRules(...rules: Str[]): Nullable; print(options?: any): string[]; get debugValue(): string[]; get terminalDerivingSymbols(): SymbolSet; reachableSymbols(fromSymbol?: Nullable): SymbolSet; get cycles(): ReadonlyArray<[Sym, any]>; get leftRecursion(): any; } export {};