import type { FunctionDefinition } from "../types.js"; import type { ControlFlowGraph } from "./types.js"; /** * Builds Control Flow Graphs from function ASTs */ export declare class CFGBuilder { private nodeCounter; private currentCFG; /** * Build a complete CFG for a function */ buildCFG(functionNode: FunctionDefinition): ControlFlowGraph; /** * Process a sequence of statements and return the last node ID */ private processStatements; /** * Check if a statement affects control flow */ private isControlFlowStatement; /** * Process control flow statements (if, while, for, etc.) */ private processControlFlowStatement; /** * Process if-else statement */ private processIfStatement; /** * Process while loop */ private processWhileStatement; /** * Process for loop */ private processForStatement; /** * Process return statement */ private processReturnStatement; /** * Create a basic block from statements */ private createBasicBlock; /** * Create a CFG node */ private createNode; /** * Add an edge between nodes */ private addEdge; /** * Analyze statements to extract metadata */ private analyzeStatements; /** * Recursively analyze a statement for metadata */ private analyzeStatementRecursively; /** * Analyze a function call to determine if it's external */ private analyzeFunctionCall; /** * Helper methods for analysis */ private isStateVariableAccess; private isStateVariable; private isLocalVariable; private isCriticalStateVariable; private getVariableName; private isExternalContract; private getCallTarget; private isRevertFunction; private visitChildNodes; /** * Calculate CFG metadata after construction */ private calculateCFGMetadata; /** * Calculate cyclomatic complexity */ private calculateCyclomaticComplexity; private initializeMetadata; } //# sourceMappingURL=builder.d.ts.map