import { UnaryOperator } from '../../../core/base/Expr'; import { GlobalRef } from '../../../core/base/Ref'; import { Value } from '../../../core/base/Value'; import { Local } from '../../../core/base/Local'; import { ArkAliasTypeDefineStmt, Stmt } from '../../../core/base/Stmt'; import { AliasType } from '../../../core/base/Type'; import { ArkMethod } from '../../../core/model/ArkMethod'; import { FullPosition } from '../../../core/base/Position'; import { ArkIRTransformer } from '../../../core/common/ArkIRTransformer'; import { CxxAstNode, CxxTranslationUnit } from '../utils/ArkCxxAstNode'; export type ValueAndStmts = { value: Value; valueOriginalPositions: FullPosition[]; stmts: Stmt[]; }; export declare class ArkCxxIRTransformer extends ArkIRTransformer { static readonly DUMMY_IF_OPERATOR_AND_SIGNAL = "If(&&)"; static readonly DUMMY_IF_OPERATOR_END = "IfEnd"; static readonly DUMMY_IF_OPERATOR_OR_SIGNAL = "If(||)"; private readonly cxxSourceFile; private ArkCxxValueTransformer; private catchedExceptions; constructor(sourceFile: CxxTranslationUnit, declaringMethod: ArkMethod); getLocals(): Set; getGlobals(): Map | null; getThisLocal(): Local; getAliasTypeMap(): Map; prebuildStmts(): Stmt[]; private shouldGenerateCxxExtraAssignStmt; /** The main function for converting C++ AST nodes to Stmts */ cxxNodeToStmts(node: CxxAstNode): Stmt[]; private cxxClassDeclarationToStmts; private typeDefDeclToStmts; /** * Extracts the target declaration node and the type string (right operand). */ private preprocessTypeAlias; /** * Resolves the basic right-hand side type, handling anonymous structs/unions/enums. */ private resolveInitialRightType; /** * Configures generics for template aliases and handles the 'typename' keyword. */ private configureTemplateAndTypename; /** * Extracts real generic types from TemplateTypeParmDecl nodes and sets them on the expression. */ private populateRealGenericTypes; /** * Constructs the final ArkAliasTypeDefineStmt and sets source positions. */ private createAliasStmt; private getAnonymousInformation; private cxxParameterToStmts; private cxxGenerateAliasTypeExpr; private forRangeStatementToStmts; private handleForRangeIterInit; private handleForRangeIterBegin; private handleForRangeIterEnd; private handleForRangeIterResult; private cxxCatchClauseToStmts; /** The main function for converting C++ AST nodes to ValueAndStmts */ cxxNodeToValueAndStmts(node: CxxAstNode): ValueAndStmts; private cxxReturnStatementToStmts; private cxxExpressionStatementToStmts; private cxxAddInvokeStmts; /** Convert C++ switch statements to ValueAndStmts */ cxxSwitchStatementToValueAndStmts(switchStatement: CxxAstNode): ValueAndStmts[]; /** * Convert C++for statement nodes to Ark IR statement arrays * Under forStmt, there will be 5 child nodes. Taking for (a ; b; c) as an example, * the content of block a is at node 0, if block b contains assignments, it will be at node 1, * the Boolean judgment of block b is at node 2, the successor operation of block c's loop body is at node 3, * and the loop body is at node 4 * @param forStatement -The for statement node in C++AST * @returns Converted Ark IR statement array */ private cxxForStatementToStmts; private cxxWhileStatementToStmts; private cxxDoStatementToStmts; private expressionWithCleanup; private compoundToStmts; private memberCallExprToStmts; private memberCallExpressionToStmts; private expressionToStmts; private cxxDeclStatementToStmts; private decompositionDeclToStmts; private cxxVariableDeclarationListToStmts; cxxIfStatementToStmts(ifStatement: CxxAstNode, depth?: number, context?: { conditionExpr: Value | undefined; }): Stmt[]; private cxxThrowStatementToStmts; cxxMapStmtsToTsStmt(stmts: Stmt[], node: CxxAstNode): void; /** * Converts a C++ token to the corresponding unary operator. * * @param token - The C++ token to be converted. * @returns - The corresponding `UnaryOperator` if the token matches, otherwise `null`. */ static cxxTokenToUnaryOperator(token: string): UnaryOperator | null; generateAssignStmtForValue(value: Value, valueOriginalPositions: FullPosition[]): ValueAndStmts; private buildTypeForUnopExpr; private buildTypeForDerefExpr; private buildTypeForBinOpExpr; private buildTypeForArrayRefExpr; setBuilderMethodContextFlag(builderMethodContextFlag: boolean): void; } //# sourceMappingURL=ArkIRTransformer.d.ts.map