import { Call, Joinpoint } from "@specs-feup/clava/api/Joinpoints.js"; import { AnalysisType, MISRATransformationReport } from "../../MISRA.js"; import UserConfigurableRule from "../UserConfigurableRule.js"; /** * MISRA-C Rule 17.3: A function shall not be declared implicitly */ export default class Rule_17_3_ImplicitFunction extends UserConfigurableRule { /** * A positive integer starting from 1 that indicates the rule's priority, determining the order in which rules are applied. */ readonly priority = 1; /** * Scope of analysis */ readonly analysisType = AnalysisType.SINGLE_TRANSLATION_UNIT; /** * Standards to which this rule applies to */ protected readonly appliesTo: Set; /** * @returns Rule identifier according to MISRA-C:2012 */ get name(): string; /** * Returns the prefix to be used for error messages related to the given joinpoint * * @param $jp - Joinpoint where the violation was detected * @returns Returns a prefix to prepend to error messages if no configuration is specified or if the configuration does not contain a fix for this violation */ getErrorMsgPrefix(callJp: Call): string; /** * Retrieves the fix for a implicit call specified on the config file (.h or .c) * @param callJp * @param errorMsgPrefix * @returns */ getFixFromConfig(callJp: Call): string | undefined; /** * Checks if the given joinpoint represents a call to an implicit function. * * @param $jp - Joinpoint to analyze * @param logErrors - [logErrors=false] - Whether to log errors if a violation is detected * @returns Returns true if the joinpoint violates the rule, false otherwise */ match($jp: Joinpoint, logErrors?: boolean): boolean; /** * Transforms every implicit call by adding a missing include directive or extern statement specified on the config file. * * - If the configuration is missing or the specified fix is invalid (i.e., not a '.h' or '.c' file), no transformation is performed and the call is left unchanged. * - The fix is applied only if it successfully resolves the issue (i.e., makes the call explicit and the file compiles with no error). * - Otherwise, the fix is removed. * * @param $jp - Joinpoint to transform * @returns Report detailing the transformation result */ apply($jp: Joinpoint): MISRATransformationReport; /** * Attempts to resolve implicit function calls in a file by adding missing includes or extern statements based on the configuration file. * @param fileJp The file to analyze * @returns `true` if any changes were made to the file, otherwise `false`. */ private solveImplicitCalls; private solveWithInclude; private solveWithExtern; } //# sourceMappingURL=Rule_17_3_ImplicitFunction.d.ts.map