import { Ast, SlotAst, CallAst, ListAst, StatementAst } from "../ast/Ast"; import SqrlAstTransformer from "../ast/SqrlAstTransformer"; import { SqrlSlot, SqrlConstantSlot, SqrlStatementSlot } from "../slot/SqrlSlot"; import { SqrlInstance } from "../function/Instance"; import { SerializedSlot } from "../slot/SerializedSlot"; import SqrlImporter from "./SqrlImporter"; import SqrlFeatureSlot from "../slot/SqrlFeatureSlot"; import { EntityId } from "../platform/EntityId"; import { Filesystem } from "../api/filesystem"; import SqrlRuleSlot from "../slot/SqrlRuleSlot"; import { RuleSpec, RuleSpecMap } from "../api/spec"; import { AbstractLogger } from "../util/Logger"; import { LogProperties } from "../api/log"; import { FeatureMap } from "../api/execute"; export interface SqrlParserSourceOptions { statements: StatementAst[]; source: string; filesystem: Filesystem; } export interface SqrlParserOptions { statements: StatementAst[]; filesystem?: Filesystem; instance: SqrlInstance; allowAssertions?: boolean; allowPrivate?: boolean; baseLibrary?: string; source?: string; mainFile?: string; setInputs?: FeatureMap; allowReplaceInput?: boolean; usedFiles?: string[]; } export interface SqrlSerialized { slots: { [name: string]: SerializedSlot; }; } export declare type SlotFilter = (slotName: string) => boolean; export declare abstract class SqrlParseInfo extends AbstractLogger { slots: { [name: string]: SqrlSlot; }; options: SqrlParserOptions; baseLibrary: string; allowAssertions: boolean; allowPrivate: boolean; instance: SqrlInstance; importer: SqrlImporter; filesystem: Filesystem; remainingInputs: FeatureMap; allowReplaceInput: boolean; statements: StatementAst[]; constructor(slots: { [name: string]: SqrlSlot; }, options: SqrlParserOptions); log(level: string, props: LogProperties, format: string, ...params: any[]): void; mapToSlots(names: string[]): SqrlSlot[]; foreachRuleSlot(callback: (slot: SqrlRuleSlot) => void): void; foreachFeatureSlot(callback: (slot: SqrlFeatureSlot) => void): void; resetReplaceableFeatures(): void; getRuleSlots(): { [name: string]: SqrlRuleSlot; }; getFeatureSlotNames(): string[]; getRuleSpecs(): RuleSpecMap; getRuleSpec(sourceAst: Ast, ruleName: string): RuleSpec; } export declare class SqrlParserState extends SqrlParseInfo { _astTransformer: SqrlAstTransformer | null; _pushStatement: (ast: Ast) => void; globalWhere: Ast; currentIterator: string | null; instance: SqrlInstance; usedFiles: Set; constructor(options: SqrlParserOptions, serialized?: SqrlSerialized); ensureIterator(ast: Ast, name: string): void; setDefaultValue(name: string, valueAst: Ast): void; pushStatement(ast: Ast): void; setPushStatement(pushStatement: any): void; slotIsEmpty(name: string): boolean; hasSlot(name: any): boolean; getSlot(name: string): SqrlSlot; getFeatureSlot(sourceAst: Ast, name: string): SqrlFeatureSlot; ensureAllSlots(slotNames: string[]): void; astContainsCurrentIterator(ast: Ast): boolean; ensureStatementFeature(sourceAst: Ast, featureName: string): SqrlStatementSlot; addWhenStatement(sourceAst: Ast, basicLabelOperations: any, ast: Ast, name?: string | null): void; addCallStatement(sourceAst: any, ast: CallAst): SlotAst; addStatement(sourceAst: Ast, globalName: string, ast: Ast, name?: string): SlotAst; addStatementSlot(globalName: string, slotAst: SlotAst): void; newGlobal(sourceAst: Ast, ast: Ast, name?: string): SlotAst; addStatementFeature(ast: Ast, featureName: string): SqrlStatementSlot; ensureConstantSlot(sourceAst: Ast, name: string, value: any): SqrlConstantSlot; ensureGlobalWithoutWhere(sourceAst: Ast, name: string, callback: () => Ast): SqrlSlot; newGlobalWithoutWhere(sourceAst: Ast, ast: Ast, name?: string): SlotAst; printFeatureLoop(slot: SqrlSlot): any[]; combineWithProvidedGlobalWhere(whereAst: Ast, globalWhere: Ast): { combinedAst: Ast; whereAst: Ast; whereFeatures: string[]; whereTruth: string; }; combineGlobalWhere(whereAst: Ast): { combinedAst: Ast; whereAst: Ast; whereFeatures: string[]; whereTruth: string; }; transform(ast: Ast): Ast; withoutGlobalWhere(callback: () => T): T; wrapWhere(whereAst: Ast, callback: () => T): T; wrapIterator(iterator: string, callback: () => T): T; serialize(): SqrlSerialized; extractDataObjectConstantKeys(ast: any): any[]; extractListConstantStrings(ast: ListAst): string[]; interpretCounterCallAst(ast: CallAst): { args: Ast; whereAst: Ast; whereFeatures?: string[]; whereTruth?: string; }; constantEntityAst(sourceAst: Ast, type: string, key: string): SlotAst; counterEntity(sourceAst: Ast, entityType: string, props: { [key: string]: any; }): { entityId: EntityId; entityAst: SlotAst; }; }