@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
30 lines (29 loc) • 1.55 kB
TypeScript
import type { SummarizedMeasurement } from '../../util/summarizer';
import { RFalse, RTrue } from '../../r-bridge/lang-4.x/convert-values';
import type { RArgument } from '../../r-bridge/lang-4.x/ast/model/nodes/r-argument';
import type { RNode } from '../../r-bridge/lang-4.x/ast/model/model';
export interface CommonSyntaxTypeCounts<Measurement = bigint> {
total: Measurement;
multiple: Measurement;
empty: Measurement;
withArgument: Measurement;
noValue: Measurement;
singleVar: Record<string, Measurement>;
number: Record<number, Measurement>;
integer: Record<number, Measurement>;
complex: Record<number, Measurement>;
string: Record<string, Measurement>;
logical: Record<typeof RTrue | typeof RFalse, Measurement>;
call: Record<string, Measurement>;
unnamedCall: Measurement;
binOp: Record<string, Measurement>;
unaryOp: Record<string, Measurement>;
other: Record<string, Measurement>;
}
export declare function emptyCommonSyntaxTypeCounts<T = bigint>(init?: () => T): CommonSyntaxTypeCounts<T>;
/**
* Updates the given counts based on the type of the given node.
*/
export declare function updateCommonSyntaxTypeCounts(current: CommonSyntaxTypeCounts, ...nodes: (RNode | RArgument)[]): CommonSyntaxTypeCounts;
export declare function appendCommonSyntaxTypeCounter(a: CommonSyntaxTypeCounts<number[][]>, b: CommonSyntaxTypeCounts): void;
export declare function summarizeCommonSyntaxTypeCounter(a: CommonSyntaxTypeCounts<number[][]>): CommonSyntaxTypeCounts<SummarizedMeasurement>;