UNPKG

@specs-feup/lara

Version:

A js port of the popular framework for building source-to-source compilers

35 lines 1.04 kB
/** * Counts occurrences of tuples. */ export default class Accumulator { value: number; accs: { [key: string]: Accumulator; }; seenKeys: Set<string>; /** * Adds the tuple to the accumulator. Each time a tuple is added, the corresponding value increments by 1. * * Alternatively, can also receive an array with the chain of values * * @returns the previous count of the added element */ add(...args: any[]): number; /** * Adds the value associated to the given tuple. If no value is defined for the given tuple, returns 0. * <p> * Alternatively, can also receive an array with the chain of values */ get(...args: any): number; copy(...args: any): Accumulator; /** * Returns an array of arrays with keys that have a value set. */ keys(): string[][]; private keysPrivate; /** * Receives an array with the arguments of the previous function. */ private parseArguments; } //# sourceMappingURL=Accumulator.d.ts.map