@specs-feup/clava
Version:
A C/C++ source-to-source compiler written in Typescript
94 lines • 3.66 kB
TypeScript
import { JavaClasses } from "@specs-feup/lara/api/lara/util/JavaTypes.js";
import { FileJp, Include, Joinpoint, Program } from "../Joinpoints.js";
import ClavaDataStore from "./util/ClavaDataStore.js";
export default class Clava {
/**
* Returns the standard being used for compilation.
*/
static getStandard(): string;
static isCxx(): boolean;
static rebuild(): boolean;
static rebuildFuzzy(): void;
/**
* @returns The folder of the first input source element, either itself, if a folder, or the parent folder, if it is a file.
*/
static getBaseFolder(): string;
/**
* @returns The folder where the code represented by the AST will be written at the end of execution.
*/
static getWeavingFolder(): string;
/**
* @param $file - The file to add to the AST.
*/
static addFile($file: FileJp): void;
/**
* @param path - Path to an existing source file that will be added to the AST. If the file does not exists, throws an exception.
*/
static addExistingFile(path: string | JavaClasses.File): void;
private static cLinkageBegin;
private static cLinkageEnd;
/**
* Launches a Clava weaving session.
* @param args - The arguments to pass to the weaver, as if it was launched from the command-line
* @returns True if the weaver execution without problems, false otherwise
*/
static runClava(args: string | any[]): boolean;
/**
* Launches several Clava weaving sessions in parallel.
*
* @param argsLists - An array where each element is an array with the arguments to pass to the weaver, as if it was launched from the command-line
* @param threads - Number of threads to use
* @param clavaCommand - The command we should use to call Clava (e.g., /usr/local/bin/clava)
*
* @returns The results of each execution
*/
static runClavaParallel(argsLists: string[][], threads?: number, clavaCommand?: string | string[]): void;
/**
* Creates a clone of the current AST and pushes the clone to the top of the current AST stack. If a $program join point is passed, that join point is added to the top of the stack instead.
*
* @param $program - program to push to the AST.
*/
static pushAst($program?: Program): void;
/**
* Discards the AST at the top of the current AST stack.
*/
static popAst(): void;
/**
* Clears all ASTs except for the one at the top of the stack. If there is one of none AST on the stack does nothing.
*/
static clearAstHistory(): void;
/**
* The current number of elements in the AST stack.
*/
static getStackSize(): any;
/**
* Looks for a join point in the current AST.
*
* @param $jp - A join point from any AST
* @returns The equivalent join point from the AST at the top of the current AST stack
*/
static findJp($jp: Joinpoint): any;
/**
* Writes the code of the current AST to the given folder.
*/
static writeCode(outputFoldername: string): JavaClasses.File;
/**
* @returns DataStore with the data of the current weaver
*/
static getData(): ClavaDataStore;
/**
* @returns The join point $program.
*/
static getProgram(): Program;
/**
*
* @returns A list of join points representing available user includes
*/
static getAvailableIncludes(): JavaClasses.List<Include>;
/**
*
* @returns {J#Set<String>} A set with paths to the include folders of the current configuration.
*/
static getIncludeFolders(): any;
}
//# sourceMappingURL=Clava.d.ts.map