import { ExpressionValue } from "../../value/ExpressionValue.js"; import { FuncArg } from "./FuncArg.js"; import { ExprEvalError, ExprEvalResult } from "../ExprEvalResult.js"; import { ExprType } from "../../type/ExprType.js"; import { ParserRuleContext } from "antlr4"; import { FunctionExpr } from "./FunctionExpr.js"; import { Expr } from "../Expr.js"; export declare abstract class Func { protected name: string; protected formalArguments: Array>; protected constructor(name: string, args: Array>); abstract getReturnType(argumentTypes: Array): ExprType; checkArgumentsAndGetReturnType(argumentTypes: Array<[ParserRuleContext, ExprType]>, ctx: any): ExprType; protected checkArgumentTypes(providedArgumentTypes: Array<[ParserRuleContext, ExprType]>, ctx: any): void; getName(): string; evaluate(callingExpr: FunctionExpr, funcArgs: Array>): ExprEvalResult; /** * Subclasses must provide the funcation evaluation code here. * @param callingExpr * @param evaluatedArguments * @protected */ protected abstract calculateResult(callingExpr: FunctionExpr, evaluatedArguments: Map): ExprEvalResult; /** * Override to transform individual arguments if needed. After this step, if any of the ExprEvalResult objects in the * returned array is an ExprEvalError, the function evaluation fails. * @param callingExpr * @param evaluatedArguments * @protected */ protected transformArguments(callingExpr: Expr, evaluatedArguments: Map>): void; /** * Gets the argument values from the list of provided arguments in the form of 'name' -> ExprEvalResult (which may contain errors). * Generates an error if a required value is missing. * @param callingExpr * @param provided * @protected */ protected getArgumentValues(callingExpr: FunctionExpr, provided: Array>): Map> | ExprEvalError; private checkArgs; }