UNPKG

@specs-feup/clava

Version:

A C/C++ source-to-source compiler written in Typescript

1,581 lines 96 kB
import { LaraJoinPoint } from "@specs-feup/lara/api/LaraJoinPoint.js"; type PrivateMapper = { "Joinpoint": typeof Joinpoint; "Attribute": typeof Attribute; "ClavaException": typeof ClavaException; "Comment": typeof Comment; "Decl": typeof Decl; "Empty": typeof Empty; "Expression": typeof Expression; "FileJp": typeof FileJp; "ImplicitValue": typeof ImplicitValue; "Include": typeof Include; "InitList": typeof InitList; "Literal": typeof Literal; "MemberAccess": typeof MemberAccess; "NamedDecl": typeof NamedDecl; "NewExpr": typeof NewExpr; "Op": typeof Op; "ParenExpr": typeof ParenExpr; "Pragma": typeof Pragma; "Program": typeof Program; "RecordJp": typeof RecordJp; "Statement": typeof Statement; "Struct": typeof Struct; "Switch": typeof Switch; "SwitchCase": typeof SwitchCase; "Tag": typeof Tag; "TernaryOp": typeof TernaryOp; "This": typeof This; "Type": typeof Type; "TypedefNameDecl": typeof TypedefNameDecl; "TypedefType": typeof TypedefType; "UnaryExprOrType": typeof UnaryExprOrType; "UnaryOp": typeof UnaryOp; "UndefinedType": typeof UndefinedType; "Varref": typeof Varref; "WrapperStmt": typeof WrapperStmt; "AccessSpecifier": typeof AccessSpecifier; "AdjustedType": typeof AdjustedType; "ArrayAccess": typeof ArrayAccess; "ArrayType": typeof ArrayType; "BinaryOp": typeof BinaryOp; "BoolLiteral": typeof BoolLiteral; "Break": typeof Break; "BuiltinType": typeof BuiltinType; "Call": typeof Call; "Case": typeof Case; "Cast": typeof Cast; "CilkSpawn": typeof CilkSpawn; "CilkSync": typeof CilkSync; "Class": typeof Class; "Continue": typeof Continue; "CudaKernelCall": typeof CudaKernelCall; "DeclStmt": typeof DeclStmt; "Declarator": typeof Declarator; "Default": typeof Default; "DeleteExpr": typeof DeleteExpr; "ElaboratedType": typeof ElaboratedType; "EmptyStmt": typeof EmptyStmt; "EnumDecl": typeof EnumDecl; "EnumeratorDecl": typeof EnumeratorDecl; "ExprStmt": typeof ExprStmt; "Field": typeof Field; "FloatLiteral": typeof FloatLiteral; "FunctionJp": typeof FunctionJp; "FunctionType": typeof FunctionType; "GotoStmt": typeof GotoStmt; "If": typeof If; "IncompleteArrayType": typeof IncompleteArrayType; "IntLiteral": typeof IntLiteral; "LabelDecl": typeof LabelDecl; "LabelStmt": typeof LabelStmt; "Loop": typeof Loop; "Marker": typeof Marker; "MemberCall": typeof MemberCall; "Method": typeof Method; "Omp": typeof Omp; "ParenType": typeof ParenType; "PointerType": typeof PointerType; "QualType": typeof QualType; "ReturnStmt": typeof ReturnStmt; "Scope": typeof Scope; "TagType": typeof TagType; "TemplateSpecializationType": typeof TemplateSpecializationType; "TypedefDecl": typeof TypedefDecl; "Vardecl": typeof Vardecl; "VariableArrayType": typeof VariableArrayType; "Body": typeof Body; "CilkFor": typeof CilkFor; "EnumType": typeof EnumType; "Param": typeof Param; }; type DefaultAttributeMap = { FileJp: "name"; Include: "name"; NamedDecl: "name"; Pragma: "name"; Program: "name"; RecordJp: "name"; Struct: "name"; Tag: "id"; TypedefNameDecl: "name"; Varref: "name"; AccessSpecifier: "kind"; Call: "name"; CilkSpawn: "name"; Class: "name"; CudaKernelCall: "name"; Declarator: "name"; EnumDecl: "name"; EnumeratorDecl: "name"; Field: "name"; FunctionJp: "name"; LabelDecl: "name"; Loop: "kind"; Marker: "id"; MemberCall: "name"; Method: "name"; Omp: "kind"; TypedefDecl: "name"; Vardecl: "name"; CilkFor: "kind"; Param: "name"; }; export declare class Joinpoint extends LaraJoinPoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * String with a dump of the AST representation starting from this node. This representation corresponds to the internal Java representation of the ClavaAst, where the node names correspond to Java classes. To get an equivalent representation with join point names, use the attribute 'dump' */ get ast(): string; /** * Returns an array with the children of the node, considering null nodes */ get astChildren(): Joinpoint[]; /** * String that uniquely identifies this node */ get astId(): string; /** * The name of the Java class of this node, which is similar to the equivalent node in Clang AST */ get astName(): string; /** * Returns the number of children of the node, considering null nodes */ get astNumChildren(): number; /** * The bit width of the type returned by this join point, in relation to the definitions of its Translation Unit, or undefined if there is no type or bitwidth defined, or if the join point is not in a TranslationUnit */ get bitWidth(): number; /** * String list of the names of the join points that form a path from the root to this node */ get chain(): string[]; /** * Returns an array with the children of the node, ignoring null nodes */ get children(): Joinpoint[]; /** * String with the code represented by this node */ get code(): string; /** * The starting column of the current node in the original code */ get column(): number; /** * Returns the node that declares the scope of this node */ get currentRegion(): Joinpoint; /** * JS object associated with this node, containing parsed data of #pragma clava data when the node can be a target of pragmas. This is a special object, managed internally, and cannot be reassigned, to change its contents requires using key-value pairs. If the node can be the target of a pragma, the information stored in this object is persisted between rebuilds. */ get data(): any; /** * JS object associated with this node, containing parsed data of #pragma clava data when the node can be a target of pragmas. This is a special object, managed internally, and cannot be reassigned, to change its contents requires using key-value pairs. If the node can be the target of a pragma, the information stored in this object is persisted between rebuilds. */ set data(value: object); /** * The depth of this join point in the AST. If it is the root join point returns 0, if it is a child of the root node returns 1, etc. */ get depth(): number; /** * Retrieves all descendants of the join point */ get descendants(): Joinpoint[]; /** * The ending column of the current node in the original code */ get endColumn(): number; /** * The ending line of the current node in the original code */ get endLine(): number; /** * The name of the file where the code of this node is located, if available */ get filename(): string; /** * The complete path to the file where the code of this node comes from */ get filepath(): string; /** * Returns the first child of this node, or undefined if it has no child */ get firstChild(): Joinpoint; /** * Returns the first child of this node, or undefined if it has no child */ set firstChild(value: Joinpoint); /** * True if the node has children, false otherwise */ get hasChildren(): boolean; /** * True if this node has a parent */ get hasParent(): boolean; /** * True, if the join point has a type */ get hasType(): boolean; /** * Returns comments that are not explicitly in the AST, but embedded in other nodes */ get inlineComments(): Comment[]; /** * Returns comments that are not explicitly in the AST, but embedded in other nodes */ set inlineComments(value: string[] | string); /** * True if this is a Cilk node (i.e., cilk_spawn, cilk_sync or cilk_for) */ get isCilk(): boolean; /** * True, if the join point is part of a system header file */ get isInSystemHeader(): boolean; /** * True, if the join point is inside a header (e.g., if condition, for, while) */ get isInsideHeader(): boolean; /** * True, if the join point is inside a loop header (e.g., for, while) */ get isInsideLoopHeader(): boolean; /** * True if any descendant or the node itself was defined as a macro */ get isMacro(): boolean; /** * The names of the Java fields of this node. Can be used as key of the attribute 'javaValue' * * @deprecated used attribute 'keys' instead, together with 'getValue' */ get javaFields(): string[]; /** * Id that is based on the position of the node in the code, and should remain stable between compilations (warning: only a few nodes - file, function, loop - currently support it) */ get jpId(): string; /** * A list of the properties currently supported by this node. Can be used as parameter of the attribute 'getValue' */ get keys(): string[]; /** * Returns the last child of this node, or undefined if it has no child */ get lastChild(): Joinpoint; /** * Returns the last child of this node, or undefined if it has no child */ set lastChild(value: Joinpoint); /** * Returns the node that came before this node, or undefined if there is none */ get leftJp(): Joinpoint; /** * The starting line of the current node in the original code */ get line(): number; /** * A string with information about the file and code position of this node, if available */ get location(): string; /** * Returns the number of children of the node, ignoring null nodes */ get numChildren(): number; /** * If this join point was not originally from the parsed AST, returns the first join point of the original AST that contributed to its origin */ get originNode(): Joinpoint; /** * Returns the parent node in the AST, or undefined if it is the root node */ get parent(): Joinpoint; /** * Returns the node that declares the scope that is a parent of the scope of this node */ get parentRegion(): Joinpoint; /** * The pragmas associated with this node */ get pragmas(): Pragma[]; /** * Returns the node that comes after this node, or undefined if there is none */ get rightJp(): Joinpoint; /** * Returns the 'program' joinpoint */ get root(): Program; /** * The nodes of the scope of the current join point. If this node has a body (e.g., loop, function) corresponds to the children of the body. Otherwise, returns an empty array */ get scopeNodes(): Joinpoint[]; /** * Returns an array with the siblings that came before this node */ get siblingsLeft(): Joinpoint[]; /** * Returns an array with the siblings that come after this node */ get siblingsRight(): Joinpoint[]; /** * Converts this join point to a statement, or returns undefined if it was not possible */ get stmt(): Statement; get type(): Type; set type(value: Type); /** * True, if this node is a Java instance of the given name, which corresponds to a simple Java class name of an AST node. For an equivalent function for join point names, use 'instanceOf(joinPointName)' */ astIsInstance(className: string): boolean; /** * True if the given node is a descendant of this node */ contains(jp: Joinpoint): boolean; /** * Looks for an ancestor joinpoint name, walking back on the AST */ getAncestor(type: string): Joinpoint; /** * @deprecated Looks for an ancestor AST name, walking back on the AST */ getAstAncestor(type: string): Joinpoint; /** * Returns the child of the node at the given index, considering null nodes */ getAstChild(index: number): Joinpoint; /** * Looks for an ancestor joinpoint name, walking back on the joinpoint chain */ getChainAncestor(type: string): Joinpoint; /** * Returns the child of the node at the given index, ignoring null nodes */ getChild(index: number): Joinpoint; /** * Retrieves the descendants of the given type */ getDescendants(type: string): Joinpoint[]; /** * Retrieves the descendants of the given type, including the node itself */ getDescendantsAndSelf(type: string): Joinpoint[]; /** * Looks in the descendants for the first node of the given type */ getFirstJp(type: string): Joinpoint; /** * String with the full Java class name of the type of the Java field with the provided name */ getJavaFieldType(fieldName: string): string; /** * Java Class instance with the type of the given key */ getKeyType(key: string): object; /** * Retrives values that have been associated to nodes of the AST with 'setUserField' */ getUserField(fieldName: string): object; /** * The value associated with the given property key */ getValue(key: string): object; /** * True, if the given join point or AST node is the same (== test) as the current join point AST node */ hasNode(nodeOrJp: object): boolean; /** * Performs a copy of the node and its children, but not of the nodes in its fields */ copy(): Joinpoint; /** * Clears all properties from the .data object */ dataClear(): void; /** * Performs a copy of the node and its children, including the nodes in their fields (only the first level of field nodes, this function is not recursive) */ deepCopy(): Joinpoint; /** * Removes the node associated to this joinpoint from the AST */ detach(): Joinpoint; /** * Inserts the given join point after this join point */ insertAfter(node: Joinpoint): Joinpoint; /** * Overload which accepts a string */ insertAfter(code: string): Joinpoint; /** * Inserts the given join point before this join point */ insertBefore(node: Joinpoint): Joinpoint; /** * Overload which accepts a string */ insertBefore(node: string): Joinpoint; /** * Adds a message that will be printed to the user after weaving finishes. Identical messages are removed */ messageToUser(message: string): void; /** * Removes the children of this node */ removeChildren(): void; /** * Replaces this node with the given node */ replaceWith(node: Joinpoint): Joinpoint; /** * Overload which accepts a string */ replaceWith(node: string): Joinpoint; /** * Overload which accepts a list of join points */ replaceWith(node: Joinpoint[]): Joinpoint; /** * Overload which accepts a list of strings */ replaceWithStrings(node: string[]): Joinpoint; /** * Setting data directly is not supported, this action just emits a warning and does nothing */ setData(source: object): void; /** * Replaces the first child, or inserts the join point if no child is present. Returns the replaced child, or undefined if there was no child present. */ setFirstChild(node: Joinpoint): Joinpoint; /** * Sets the commented that are embedded in a node */ setInlineComments(comments: string[]): void; /** * Sets the commented that are embedded in a node */ setInlineComments(comments: string): void; /** * Replaces the last child, or inserts the join point if no child is present. Returns the replaced child, or undefined if there was no child present. */ setLastChild(node: Joinpoint): Joinpoint; /** * Sets the type of a node, if it has a type */ setType(type: Type): void; /** * Associates arbitrary values to nodes of the AST */ setUserField(fieldName: string, value: object): object; /** * Overload which accepts a map */ setUserField(fieldNameAndValue: Record<string, any>): object; /** * Sets the value associated with the given property key */ setValue(key: string, value: object): Joinpoint; /** * Replaces this join point with a comment with the same contents as .code */ toComment(prefix?: string, suffix?: string): Joinpoint; } export declare class Attribute extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get kind(): string; } /** * Utility joinpoint, to represent certain problems when generating join points */ export declare class ClavaException extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get exception(): object; get exceptionType(): string; get message(): string; } export declare class Comment extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get text(): string; set text(value: string); setText(text: string): void; } /** * Represents one declaration (e.g., int foo(){return 0;}) or definition (e.g., int foo();) in the code */ export declare class Decl extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The attributes (e.g. Pure, CUDAGlobal) associated to this decl */ get attrs(): Attribute[]; } /** * Utility joinpoint, to represent empty nodes when directly accessing the tree */ export declare class Empty extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } export declare class Expression extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * A 'decl' join point that represents the declaration associated with this expression, or undefined if there is none */ get decl(): Decl; /** * Returns a cast joinpoint if this expression has an associated implicit cast, undefined otherwise */ get implicitCast(): Cast; /** * True if the expression is part of an argument of a function call */ get isFunctionArgument(): boolean; get use(): "read" | "write" | "readwrite"; get vardecl(): Vardecl; } /** * Represents a source file (.c, .cpp., .cl, etc) */ export declare class FileJp extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The path to the source folder that was given as the base folder of this file */ get baseSourcePath(): string; /** * The output of the parser if there were errors during parsing */ get errorOutput(): string; /** * A Java file to the file that originated this translation unit */ get file(): object; /** * True if this file contains a 'main' method */ get hasMain(): boolean; /** * True if there were errors during parsing */ get hasParsingErrors(): boolean; /** * The includes of this file */ get includes(): Include[]; /** * True if this file is considered a C++ file */ get isCxx(): boolean; /** * True if this file is considered a header file */ get isHeader(): boolean; /** * True if this file is an OpenCL filetype */ get isOpenCL(): boolean; /** * The name of the file */ get name(): string; /** * The name of the file */ set name(value: string); /** * The folder of the source file */ get path(): string; /** * The path to the file relative to the base source path */ get relativeFilepath(): string; /** * The path to the folder of the source file relative to the base source path */ get relativeFolderpath(): string; /** * The path to the folder of the source file relative to the base source path */ set relativeFolderpath(value: string); /** * The name of the source folder of this file, or undefined if it has none */ get sourceFoldername(): string; /** * The complete path to the file that will be generated by the weaver, given a destination folder */ getDestinationFilepath(destinationFolderpath?: string): string; /** * Adds a C include to the current file. If the file already has the include, it does nothing */ addCInclude(name: string, isAngled?: boolean): void; /** * Adds a function to the file that returns void and has no parameters */ addFunction(name: string): Joinpoint; /** * Adds a global variable to this file */ addGlobal(name: string, type: Joinpoint, initValue: string): Vardecl; /** * Adds an include to the current file. If the file already has the include, it does nothing */ addInclude(name: string, isAngled?: boolean): void; /** * Overload of addInclude which accepts a join point */ addIncludeJp(jp: Joinpoint): void; /** * Adds the node in the join point to the start of the file */ insertBegin(node: Joinpoint): void; /** * Adds the String as a Decl to the end of the file */ insertBegin(code: string): void; /** * Adds the node in the join point to the end of the file */ insertEnd(node: Joinpoint): void; /** * Adds the String as a Decl to the end of the file */ insertEnd(code: string): void; /** * Recompiles only this file, returns a join point to the new recompiled file, or throws an exception if a problem happens */ rebuild(): FileJp; /** * Recompiles only this file, returns a join point to the new recompiled file, or returns a clavaException join point if a problem happens */ rebuildTry(): Joinpoint; /** * Changes the name of the file */ setName(filename: string): void; /** * Sets the path to the folder of the source file relative to the base source path */ setRelativeFolderpath(path: string): void; /** * Writes the code of this file to a given folder */ write(destinationFoldername: string): string; } export declare class ImplicitValue extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } /** * Represents an include directive (e.g., #include <stdio.h>) */ export declare class Include extends Decl { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * True if this is an angled include (i.e., system include) */ get isAngled(): boolean; /** * The name of the include */ get name(): string; /** * The path to the folder of the source file of the include, relative to the name of the include */ get relativeFolderpath(): string; } export declare class InitList extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * [May be undefined] If this initializer list initializes an array with more elements than there are initializers in the list, specifies an expression to be used for value initialization of the rest of the elements */ get arrayFiller(): Expression; } export declare class Literal extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } export declare class MemberAccess extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * True if this is a member access that uses arrow (i.e., foo->bar), false if uses dot (i.e., foo.bar) */ get arrow(): boolean; /** * True if this is a member access that uses arrow (i.e., foo->bar), false if uses dot (i.e., foo.bar) */ set arrow(value: boolean); /** * Expression of the base of this member access */ get base(): Expression; get memberChain(): Expression[]; get memberChainNames(): string[]; get name(): string; setArrow(isArrow: boolean): void; } /** * Represents a decl with a name */ export declare class NamedDecl extends Decl { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get isPublic(): boolean; get name(): string; set name(value: string); get qualifiedName(): string; set qualifiedName(value: string); get qualifiedPrefix(): string; set qualifiedPrefix(value: string); /** * Sets the name of this namedDecl */ setName(name: string): void; /** * Sets the qualified name of this namedDecl (changes both the name and qualified prefix) */ setQualifiedName(name: string): void; /** * Sets the qualified prefix of this namedDecl */ setQualifiedPrefix(qualifiedPrefix: string): void; } export declare class NewExpr extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } export declare class Op extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get isBitwise(): boolean; /** * The kind of the operator. If it is a binary operator, can be one of: ptr_mem_d, ptr_mem_i, mul, div, rem, add, sub, shl, shr, cmp, lt, gt, le, ge, eq, ne, and, xor, or, l_and, l_or, assign, mul_assign, div_assign, rem_assign, add_assign, sub_assign, shl_assign, shr_assign, and_assign, xor_assign, or_assign, comma. If it is a unary operator, can be one of: post_inc, post_dec, pre_inc, pre_dec, addr_of, deref, plus, minus, not, l_not, real, imag, extension, cowait. */ get kind(): string; get operator(): string; } export declare class ParenExpr extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * Returns the expression inside this parenthesis expression */ get subExpr(): Expression; } /** * Represents a pragma in the code (e.g., #pragma kernel) */ export declare class Pragma extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * Everything that is after the name of the pragma */ get content(): string; /** * Everything that is after the name of the pragma */ set content(value: string); /** * The name of the pragma. E.g. for #pragma foo bar, returns 'foo' */ get name(): string; /** * The name of the pragma. E.g. for #pragma foo bar, returns 'foo' */ set name(value: string); /** * The first node below the pragma that is not a comment or another pragma. Example of pragma targets are statements and declarations */ get target(): Joinpoint; /** * All the nodes below the target node, including the target node, up until a pragma with the name given by argument 'endPragma'. If no end pragma is found, returns the same result as if not providing the argument */ getTargetNodes(endPragma?: string): Joinpoint[]; setContent(content: string): void; setName(name: string): void; } /** * Represents the complete program and is the top-most joinpoint in the hierarchy */ export declare class Program extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get baseFolder(): string; get defaultFlags(): string[]; /** * Paths to includes that the current program depends on */ get extraIncludes(): string[]; /** * Link libraries of external projects the current program depends on */ get extraLibs(): string[]; /** * Paths to folders of projects that the current program depends on */ get extraProjects(): string[]; /** * Paths to sources that the current program depends on */ get extraSources(): string[]; /** * The source files in this program */ get files(): FileJp[]; get includeFolders(): string[]; /** * True if the program was compiled with a C++ standard */ get isCxx(): boolean; /** * A function join point with the main function of the program, if one is available */ get main(): FunctionJp; get name(): string; /** * The name of the standard (e.g., c99, c++11) */ get standard(): string; /** * The flag of the standard (e.g., -std=c++11) */ get stdFlag(): string; get userFlags(): string[]; get weavingFolder(): string; /** * Adds a path to an include that the current program depends on */ addExtraInclude(path: string): void; /** * Adds a path based on a git repository to an include that the current program depends on */ addExtraIncludeFromGit(gitRepo: string, path?: string): void; /** * Adds a library (e.g., -pthreads) that the current program depends on */ addExtraLib(lib: string): void; /** * Adds a path to a source that the current program depends on */ addExtraSource(path: string): void; /** * Adds a path based on a git repository to a source that the current program depends on */ addExtraSourceFromGit(gitRepo: string, path?: string): void; /** * Adds a file join point to the current program */ addFile(file: FileJp): Joinpoint; /** * Adds a file join point to the current program, from the given path, which can be either a Java File or a String */ addFileFromPath(filepath: object): Joinpoint; /** * Adds a path based on a git repository to a project that the current program depends on */ addProjectFromGit(gitRepo: string, libs: string[], path?: string): void; /** * Registers a function to be executed when the program exits */ atexit(func: FunctionJp): void; /** * Discards the AST at the top of the ASt stack */ pop(): void; /** * Creates a copy of the current AST and pushes it to the top of the AST stack */ push(): void; /** * Recompiles the program currently represented by the AST, transforming literal code into AST nodes. Returns true if all files could be parsed correctly, or false otherwise */ rebuild(): boolean; /** * Similar to rebuild, but tries to fix compilation errors. Resulting program may not represent the originally intended functionality */ rebuildFuzzy(): void; } /** * Common class of struct, union and class */ export declare class RecordJp extends NamedDecl { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get fields(): Field[]; get functions(): FunctionJp[]; /** * True if this particular join point is an implementation (i.e. has its body fully specified), false otherwise */ get isImplementation(): boolean; /** * True if this particular join point is a prototype (i.e. does not have its body fully specified), false otherwise */ get isPrototype(): boolean; get kind(): string; /** * Adds a field to a record (struct, class). */ addField(field: Field): void; } export declare class Statement extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get isFirst(): boolean; get isLast(): boolean; } /** * Represets a struct declaration */ export declare class Struct extends RecordJp { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } export declare class Switch extends Statement { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The case statements inside this switch */ get cases(): Case[]; /** * The condition of this switch statement */ get condition(): Expression; /** * The default case statement of this switch statement or undefined if it does not have a default case */ get getDefaultCase(): Case; /** * True if there is a default case in this switch statement, false otherwise */ get hasDefaultCase(): boolean; } export declare class SwitchCase extends Statement { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } /** * A pragma that references a point in the code and sticks to it */ export declare class Tag extends Pragma { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The ID of the pragma */ get id(): string; } export declare class TernaryOp extends Op { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get cond(): Expression; get falseExpr(): Expression; get trueExpr(): Expression; } export declare class This extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } export declare class Type extends Joinpoint { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get arrayDims(): number[]; get arraySize(): number; get constant(): boolean; /** * Single-step desugar. Returns the type itself if it does not have sugar */ get desugar(): Type; /** * Single-step desugar. Returns the type itself if it does not have sugar */ set desugar(value: Type); /** * Completely desugars the type */ get desugarAll(): Type; /** * A tree representation of the fields of this type */ get fieldTree(): string; get hasSugar(): boolean; get hasTemplateArgs(): boolean; get isArray(): boolean; /** * True if this is a type declared with the 'auto' keyword */ get isAuto(): boolean; get isBuiltin(): boolean; get isPointer(): boolean; get isTopLevel(): boolean; get kind(): string; /** * Ignores certain types (e.g., DecayedType) */ get normalize(): Type; get templateArgsStrings(): string[]; get templateArgsTypes(): Type[]; set templateArgsTypes(value: Type[]); /** * Maps names of join point fields that represent type join points, to their respective values */ get typeFields(): Record<string, any>; /** * If the type encapsulates another type, returns the encapsulated type */ get unwrap(): Type; /** * Returns a new node based on this type with the qualifier const */ asConst(): Type; /** * Sets the desugared type of this type */ setDesugar(desugaredType: Type): void; /** * Sets a single template argument type of a template type */ setTemplateArgType(index: number, templateArgType: Type): void; /** * Sets the template argument types of a template type */ setTemplateArgsTypes(templateArgTypes: Type[]): void; /** * Changes a single occurence of a type field that has the current value with new value. Returns true if there was a change */ setTypeFieldByValueRecursive(currentValue: object, newValue: object): boolean; /** * Replaces an underlying type of this instance with new type, if it matches the old type. Returns true if there were changes */ setUnderlyingType(oldValue: Type, newValue: Type): Type; } /** * Base node for declarations which introduce a typedef-name */ export declare class TypedefNameDecl extends NamedDecl { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } /** * Represents the type of a typedef. */ export declare class TypedefType extends Type { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The typedef declaration associated with this typedef type */ get decl(): TypedefNameDecl; /** * The type that is being typedef'd */ get underlyingType(): Type; } export declare class UnaryExprOrType extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get argExpr(): Expression; get argType(): Type; set argType(value: Type); get hasArgExpr(): boolean; get hasTypeExpr(): boolean; get kind(): string; setArgType(argType: Type): void; } export declare class UnaryOp extends Op { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get isPointerDeref(): boolean; get operand(): Expression; } export declare class UndefinedType extends Type { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; } /** * A reference to a variable */ export declare class Varref extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get declaration(): Declarator; /** * True if this variable reference has a MS-style property, false otherwise */ get hasProperty(): boolean; /** * True if this varref represents a function call */ get isFunctionCall(): boolean; get kind(): string; get name(): string; set name(value: string); /** * If this variable reference has a MS-style property, returns the property name. Returns undefined otherwise */ get property(): string; /** * Expression from where the attribute 'use' is calculated. In certain cases (e.g., array access, pointer dereference) the 'use' attribute is not calculated on the node itself, but on an ancestor of the node. This attribute returns that node */ get useExpr(): Expression; setName(name: string): void; } export declare class WrapperStmt extends Statement { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get content(): Joinpoint; get kind(): "comment" | "pragma"; } export declare class AccessSpecifier extends Decl { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The type of specifier. Can return 'public', 'protected', 'private' or 'none' */ get kind(): string; } export declare class AdjustedType extends Type { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The type that is being adjusted */ get originalType(): Type; } export declare class ArrayAccess extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * Expression representing the variable of the array access (can be a varref, memberAccess...) */ get arrayVar(): Expression; /** * If the array access is done over a variable, returns the name of the variable. Equivalent to $arrayAccess.arrayVar.name */ get name(): string; /** * The number of subscripts of this array access */ get numSubscripts(): number; /** * A view of the current arrayAccess without the last subscript, or undefined if this arrayAccess only has one subscript */ get parentAccess(): ArrayAccess; /** * Expression of the array access subscript */ get subscript(): Expression[]; } export declare class ArrayType extends Type { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get elementType(): Type; set elementType(value: Type); /** * Sets the element type of the array */ setElementType(arrayElementType: Type): void; } export declare class BinaryOp extends Op { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get isAssignment(): boolean; get left(): Expression; set left(value: Expression); get right(): Expression; set right(value: Expression); setLeft(left: Expression): void; setRight(right: Expression): void; } export declare class BoolLiteral extends Literal { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get value(): boolean; } export declare class Break extends Statement { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * The enclosing statement related to this break. It should be either a loop or a switch statement. */ get enclosingStmt(): Statement; } export declare class BuiltinType extends Type { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; get builtinKind(): string; /** * True, if ot is a floating type (e.g., float, double) */ get isFloat(): boolean; /** * True, if it is an integer type */ get isInteger(): boolean; /** * True, if it is a signed integer type */ get isSigned(): boolean; /** * True, if it is an unsigned integer type */ get isUnsigned(): boolean; /** * True, if it is the type 'void' */ get isVoid(): boolean; } export declare class Call extends Expression { /** * @internal */ static readonly _defaultAttributeInfo: { readonly map?: DefaultAttributeMap; readonly name: string | null; readonly type?: PrivateMapper; readonly jpMapper?: typeof JoinpointMapper; }; /** * An alias for 'args' */ get argList(): Expression[]; /** * An array with the arguments of the call */ get args(): Expression[]; /** * A 'function' join point that represents the function of the call that was found, it can return either an implementation or a function prototype; 'undefined' if no declaration was found */ get declaration(): FunctionJp; /** * A 'function' join point that represents the function definition of the call; 'undefined' if no definition was found */ get definition(): FunctionJp; /** * A function join point that represents the 'raw' function of the call (e.g. if this is a call to a templated function, returns a declaration representing the template specialization, instead of the original function) */ get directCallee(): FunctionJp; /** * A function join point associated with this call. If a definition is present, it is given priority over returning a declaration. If only declarations are present, returns a declaration */ get function(): FunctionJp; /** * The function ty