@specs-feup/clava
Version:
A C/C++ source-to-source compiler written in Typescript
39 lines • 1.68 kB
TypeScript
import { JavaClasses } from "@specs-feup/lara/api/lara/util/JavaTypes.js";
import { FunctionJp, Statement } from "../Joinpoints.js";
/**
* Utility methods related with the source code.
*
*/
export default class ClavaCode {
/**
* Writes the code corresponding to the current AST as a single file.
*
*/
static toSingleFile(fileOrBaseFolder?: string | JavaClasses.File, optionalFile?: string | JavaClasses.File): void;
/**
* Generates code for a single fime corresponding to the current AST.
*
* @returns The code of the current AST as a single file.
*/
static toSingleFileCode(): string;
private static renameStaticDeclarations;
/**
* Tries to statically detect if a statement is executed only once.
*
* Restrictions:
* - Does not take into account runtime execution problems, such as exceptions;
* - Does not detect if the function is called indirectly through a function pointer;
*
* @returns True if it could be detected, within the restrictions, that the statement is only executed once.
*/
static isExecutedOnce($statement: Statement | undefined): boolean;
/**
* Returns the function definitions in the program with the given name.
*
* @param functionName - The name of the function to find
* @param isSingleFunction - If true, ensures there is a single definition with the given name
* @returns An array of function definitions, or a single function is 'isSingleFunction' is true
*/
static getFunctionDefinition(functionName: string, isSingleFunction: boolean): FunctionJp | FunctionJp[];
}
//# sourceMappingURL=ClavaCode.d.ts.map