/foundation/ability/idl_tool/idl_tool_2/util/ |
H A D | autoptr.h | 22 class AutoPtr { class 24 inline AutoPtr() : mPtr(nullptr) {} in AutoPtr() function in OHOS::Idl::AutoPtr 26 AutoPtr(T *other); 28 AutoPtr(const AutoPtr<T> &other); 30 AutoPtr(AutoPtr<T> &&other); 32 ~AutoPtr(); 34 AutoPtr &operator=(T *other); 36 AutoPtr 81 AutoPtr<T>::AutoPtr(T *other) : mPtr(other) AutoPtr() function in OHOS::Idl::AutoPtr 89 AutoPtr<T>::AutoPtr(const AutoPtr<T> &other) : mPtr(other.mPtr) AutoPtr() function in OHOS::Idl::AutoPtr 97 AutoPtr<T>::AutoPtr(AutoPtr<T> &&other) : mPtr(other.mPtr) AutoPtr() function in OHOS::Idl::AutoPtr [all...] |
/foundation/ability/idl_tool/util/ |
H A D | autoptr.h | 22 class AutoPtr { class 24 AutoPtr() in AutoPtr() function in OHOS::Idl::AutoPtr 28 AutoPtr(T* other); 30 AutoPtr(const AutoPtr<T>& other); 32 AutoPtr(AutoPtr<T>&& other); 34 ~AutoPtr(); 36 AutoPtr& operator=(T* other); 38 AutoPtr 83 AutoPtr<T>::AutoPtr(T* other) AutoPtr() function in OHOS::Idl::AutoPtr 92 AutoPtr<T>::AutoPtr(const AutoPtr<T>& other) AutoPtr() function in OHOS::Idl::AutoPtr 101 AutoPtr<T>::AutoPtr(AutoPtr<T>&& other) AutoPtr() function in OHOS::Idl::AutoPtr [all...] |
/foundation/ability/idl_tool/idl_tool_2/parser/ |
H A D | parser.h | 39 bool operator()(const AutoPtr<AST> &lhs, const AutoPtr<AST> &rhs) const
in operator ()() 44 using AstMergeMap = std::map<std::string, std::set<AutoPtr<AST>, AstCompare>>;
53 using StrAstMap = std::unordered_map<std::string, AutoPtr<AST>>;
104 AutoPtr<ASTAttr> ParseInfAttrInfo(const AttrSet &attrs);
106 void CheckInterfaceAttr(const AutoPtr<ASTInterfaceType> &interface, Token token);
108 void ParseInterfaceExternal(const AutoPtr<ASTInterfaceType> &interface);
110 void ParseInterfaceBody(const AutoPtr<ASTInterfaceType> &interface);
112 AutoPtr<ASTMethod> ParseMethod(const AutoPtr<ASTInterfaceTyp [all...] |
/foundation/ability/idl_tool/idl_tool_2/codegen/HDI/ |
H A D | hdi_code_emitter.h | 26 using TypeEmitterMap = std::unordered_map<TypeKind, AutoPtr<HdiTypeEmitter>>;
30 bool OutPut(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode) override;
35 bool Reset(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode);
39 AutoPtr<HdiTypeEmitter> GetTypeEmitter(AutoPtr<ASTType> astType) const;
55 std::string GetNameWithNamespace(AutoPtr<ASTNamespace> space, std::string name) const;
57 AutoPtr<HdiTypeEmitter> NewTypeEmitter(AutoPtr<ASTType> astType) const;
59 AutoPtr<HdiTypeEmitter> NewMapTypeEmitter(AutoPtr<ASTTyp [all...] |
H A D | hdi_code_emitter.cpp | 66 bool HDICodeEmitter::OutPut(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode)
in OutPut() 76 bool HDICodeEmitter::Reset(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode)
in Reset() 143 std::string HDICodeEmitter::GetNameWithNamespace(AutoPtr<ASTNamespace> space, std::string name) const
in GetNameWithNamespace() 178 AutoPtr<HdiTypeEmitter> HDICodeEmitter::GetTypeEmitter(AutoPtr<ASTType> astType) const
in GetTypeEmitter() 180 AutoPtr<HdiTypeEmitter> typeEmitter;
in GetTypeEmitter() 202 AutoPtr<HdiTypeEmitter> HDICodeEmitter::NewTypeEmitter(AutoPtr<ASTType> astType) const
in NewTypeEmitter() 225 AutoPtr<HdiTypeEmitter> typeEmitter = new HdiTypeEmitter();
in NewTypeEmitter() 231 AutoPtr<HdiTypeEmitte [all...] |
H A D | hdi_code_generator.h | 32 static void GenIpcCCode(const AutoPtr<AST> &ast, const std::string &outDir);
34 static void GenIpcCppCode(const AutoPtr<AST> &ast, const std::string &outDir);
36 static void GenIpcJavaCode(const AutoPtr<AST> &ast, const std::string &outDir);
38 static void GenPassthroughCCode(const AutoPtr<AST> &ast, const std::string &outDir);
40 static void GenPassthroughCppCode(const AutoPtr<AST> &ast, const std::string &outDir);
42 static void GenKernelCode(const AutoPtr<AST> &ast, const std::string &outDir);
44 static void GenLowCCode(const AutoPtr<AST> &ast, const std::string &outDir);
|
/foundation/ability/idl_tool/idl_tool_2/codegen/SA/ |
H A D | sa_code_emitter.h | 26 using TypeEmitterMap = std::unordered_map<TypeKind, AutoPtr<SaTypeEmitter>>;
30 bool OutPut(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode) override;
35 bool Reset(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode);
39 AutoPtr<SaTypeEmitter> GetTypeEmitter(AutoPtr<ASTType> astType) const;
48 AutoPtr<SaTypeEmitter> NewTypeEmitter(AutoPtr<ASTType> astType) const;
50 AutoPtr<SaTypeEmitter> NewMapTypeEmitter(AutoPtr<ASTType> astType) const;
52 AutoPtr<SaTypeEmitte [all...] |
H A D | sa_code_emitter.cpp | 54 bool SACodeEmitter::OutPut(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode)
in OutPut() 64 bool SACodeEmitter::Reset(const AutoPtr<AST> &ast, const std::string &targetDirectory, GenMode mode)
in Reset() 154 AutoPtr<SaTypeEmitter> SACodeEmitter::GetTypeEmitter(AutoPtr<ASTType> astType) const
in ResolveDirectory() 156 AutoPtr<SaTypeEmitter> typeEmitter;
in ResolveDirectory() 170 AutoPtr<SaTypeEmitter> SACodeEmitter::NewTypeEmitter(AutoPtr<ASTType> astType) const
in ResolveDirectory() 185 AutoPtr<SaTypeEmitter> typeEmitter = new SaTypeEmitter();
in ResolveDirectory() 191 AutoPtr<SaTypeEmitter> SACodeEmitter::NewMapTypeEmitter(AutoPtr<ASTTyp in ResolveDirectory() [all...] |
/foundation/ability/idl_tool/ast/ |
H A D | ast_module.h | 60 AutoPtr<ASTNamespace> ParseNamespace(const String& nspaceStr); 64 AutoPtr<ASTNamespace> FindNamespace(const String& nspaceStr); 66 AutoPtr<ASTNamespace> GetNamespace(size_t index); 75 AutoPtr<ASTInterfaceType> GetInterface(size_t index); 86 AutoPtr<ASTSequenceableType> GetSequenceable(size_t index); 97 AutoPtr<ASTType> FindType(const String& typeName); 99 using TypeStringMap = std::unordered_map<String, AutoPtr<ASTType>, StringHashFunc, StringEqualFunc>; 129 std::vector<AutoPtr<ASTNamespace>> namespaces_; 130 std::vector<AutoPtr<ASTInterfaceType>> interfaces_; 131 std::vector<AutoPtr<ASTSequenceableTyp [all...] |
H A D | ast_namespace.h | 41 AutoPtr<ASTNamespace> FindNamespace(const String& nspaceStr); 43 AutoPtr<ASTNamespace> GetNamespace(size_t index); 52 AutoPtr<ASTInterfaceType> GetInterface(size_t index); 61 AutoPtr<ASTSequenceableType> GetSequenceable(size_t index); 78 std::vector<AutoPtr<ASTNamespace>> innerNamespaces_; 79 std::vector<AutoPtr<ASTInterfaceType>> interfaces_; 80 std::vector<AutoPtr<ASTSequenceableType>> sequenceables_;
|
/foundation/ability/idl_tool/idl_tool_2/ast/ |
H A D | ast.h | 64 using StrASTMap = std::unordered_map<std::string, AutoPtr<AST>>; 65 using TypeStringMap = std::unordered_map<std::string, AutoPtr<ASTType>>; 110 AutoPtr<ASTNamespace> ParseNamespace(const std::string &nspaceStr); 112 void AddNamespace(const AutoPtr<ASTNamespace> &nspace); 114 AutoPtr<ASTNamespace> FindNamespace(const std::string &nspaceStr); 116 AutoPtr<ASTNamespace> GetNamespace(size_t index); 118 inline std::vector<AutoPtr<ASTNamespace>> GetNamespace() in GetNamespace() 128 void AddInterfaceDef(const AutoPtr<ASTInterfaceType> &interface); 130 AutoPtr<ASTInterfaceType> GetInterfaceDef(size_t index = 0); 137 void AddSequenceableDef(const AutoPtr<ASTSequenceableTyp [all...] |
H A D | ast_enum_type.h | 39 inline void SetType(const AutoPtr<ASTType> &type)
in SetType() 44 inline AutoPtr<ASTType> GetType()
in GetType() 49 inline void SetExprValue(const AutoPtr<ASTExpr> &value)
in SetExprValue() 54 inline AutoPtr<ASTExpr> GetExprValue()
in GetExprValue() 61 AutoPtr<ASTType> mType_;
62 AutoPtr<ASTExpr> value_;
79 inline void SetAttribute(const AutoPtr<ASTAttr> &attr)
in SetAttribute() 96 void SetBaseType(const AutoPtr<ASTType> &baseType);
98 AutoPtr<ASTType> GetBaseType();
100 bool AddMember(const AutoPtr<ASTEnumValu [all...] |
H A D | ast_namespace.h | 40 void AddNamespace(const AutoPtr<ASTNamespace> &innerNspace); 42 AutoPtr<ASTNamespace> FindNamespace(const std::string &nspaceStr); 44 AutoPtr<ASTNamespace> GetNamespace(size_t index); 51 void AddInterface(const AutoPtr<ASTInterfaceType> &interface); 53 AutoPtr<ASTInterfaceType> GetInterface(size_t index); 60 void AddSequenceable(const AutoPtr<ASTSequenceableType> &sequenceable); 62 AutoPtr<ASTSequenceableType> GetSequenceable(size_t index); 79 std::vector<AutoPtr<ASTNamespace>> innerNamespaces_; 80 std::vector<AutoPtr<ASTSequenceableType>> sequenceables_; 81 std::vector<AutoPtr<ASTInterfaceTyp [all...] |
H A D | ast_interface_type.h | 45 void SetNamespace(const AutoPtr<ASTNamespace> &nspace) override; 57 void SetAttribute(const AutoPtr<ASTAttr> &attr) in SetAttribute() 67 inline AutoPtr<ASTAttr> GetAttribute() const in GetAttribute() 112 void AddMethod(const AutoPtr<ASTMethod> &method); 114 AutoPtr<ASTMethod> GetMethod(size_t index); 116 std::vector<AutoPtr<ASTMethod>> GetMethods() const; 118 std::vector<AutoPtr<ASTMethod>> GetMethodsBySystem(SystemLevel system) const; 125 void AddVersionMethod(const AutoPtr<ASTMethod> &method) in AddVersionMethod() 130 AutoPtr<ASTMethod> GetVersionMethod() in GetVersionMethod() 135 bool AddExtendsInterface(AutoPtr<ASTInterfaceTyp [all...] |
H A D | ast_map_type.h | 28 inline void SetKeyType(const AutoPtr<ASTType> &keyType) in SetKeyType() 33 inline AutoPtr<ASTType> GetKeyType() in GetKeyType() 38 inline void SetValueType(const AutoPtr<ASTType> &valueType) in SetValueType() 43 inline AutoPtr<ASTType> GetValueType() in GetValueType() 58 AutoPtr<ASTType> keyType_; 59 AutoPtr<ASTType> valueType_;
|
H A D | ast_method.h | 41 inline void SetAttribute(AutoPtr<ASTAttr> attr) in SetAttribute() 48 inline AutoPtr<ASTAttr> GetAttribute() const in GetAttribute() 53 inline void SetReturnType(AutoPtr<ASTType> type) in SetReturnType() 58 inline AutoPtr<ASTType> GetReturnType() in GetReturnType() 88 void CheckOverload(AutoPtr<ASTInterfaceType> interface); 90 void AddParameter(const AutoPtr<ASTParameter> ¶meter); 92 AutoPtr<ASTParameter> GetParameter(size_t index); 116 void SetCacheable(AutoPtr<ASTAttr> attr) in SetCacheable() 159 AutoPtr<ASTAttr> attr_ = new ASTAttr(); 160 AutoPtr<ASTTyp [all...] |
H A D | ast_parameter.h | 28 ASTParameter(const std::string &name, ASTParamAttr::ParamAttr attribute, const AutoPtr<ASTType> &type) in ASTParameter() 33 ASTParameter(const std::string &name, const AutoPtr<ASTParamAttr> &attribute, const AutoPtr<ASTType> &type) in ASTParameter() 43 inline AutoPtr<ASTType> GetType() in GetType() 57 AutoPtr<ASTParamAttr> attr_; 58 AutoPtr<ASTType> type_;
|
H A D | ast_namespace.cpp | 27 void ASTNamespace::AddNamespace(const AutoPtr<ASTNamespace> &innerNspace) in AddNamespace() 37 AutoPtr<ASTNamespace> ASTNamespace::FindNamespace(const std::string &nspaceStr) in FindNamespace() 44 innerNamespaces_.begin(), innerNamespaces_.end(), [nspaceStr](const AutoPtr<ASTNamespace> &element) { in FindNamespace() 50 AutoPtr<ASTNamespace> ASTNamespace::GetNamespace(size_t index) in GetNamespace() 59 void ASTNamespace::AddInterface(const AutoPtr<ASTInterfaceType> &interface) in AddInterface() 68 AutoPtr<ASTInterfaceType> ASTNamespace::GetInterface(size_t index) in GetInterface() 77 void ASTNamespace::AddSequenceable(const AutoPtr<ASTSequenceableType> &sequenceable) in AddSequenceable() 86 AutoPtr<ASTSequenceableType> ASTNamespace::GetSequenceable(size_t index) in GetSequenceable()
|
H A D | ast_struct_type.h | 42 inline void SetAttribute(const AutoPtr<ASTAttr> &attr)
in SetAttribute() 59 void SetParentType(const AutoPtr<ASTStructType> &parentType);
61 void AddMember(const AutoPtr<ASTType> &typeName, std::string name);
63 inline std::vector<std::tuple<std::string, AutoPtr<ASTType>>> GetMembers()
in GetMembers() 81 inline AutoPtr<ASTType> GetMemberType(size_t index)
in GetMemberType() 98 AutoPtr<ASTAttr> attr_;
99 std::vector<std::tuple<std::string, AutoPtr<ASTType>>> members_;
100 AutoPtr<ASTStructType> parentType_; // used to dump parent type when using struct extension identify in idl
|
/foundation/ability/idl_tool/test/unittest/ast_module_test/ |
H A D | ast_module_test.cpp | 60 AutoPtr<ASTModule> module = new ASTModule(); in HWTEST_F() 62 AutoPtr<ASTNamespace> result = module->GetNamespace(index); in HWTEST_F() 77 AutoPtr<ASTModule> module = new ASTModule(); in HWTEST_F() 79 AutoPtr<ASTInterfaceType> result = module->GetInterface(index); in HWTEST_F() 94 AutoPtr<ASTModule> module = new ASTModule(); in HWTEST_F() 111 AutoPtr<ASTModule> module = new ASTModule(); in HWTEST_F() 113 AutoPtr<ASTSequenceableType> result = module->GetSequenceable(index); in HWTEST_F() 128 AutoPtr<ASTModule> module = new ASTModule(); in HWTEST_F() 145 AutoPtr<ASTModule> module = new ASTModule(); in HWTEST_F() 147 AutoPtr<ASTTyp in HWTEST_F() [all...] |
/foundation/ability/idl_tool/parser/ |
H A D | parser.h | 40 AutoPtr<ASTModule> GetModule() const in GetModule() 53 AutoPtr<ErrorInfo> next_; 82 AutoPtr<ASTNamespace> NameSpaceEmpty(); 84 AutoPtr<ASTType> ParseType(); 86 AutoPtr<ASTType> ParseList(); 88 AutoPtr<ASTType> ParseMap(); 108 AutoPtr<ASTModule> module_; 109 AutoPtr<ASTInterfaceType> parsingInterface_; 111 AutoPtr<ErrorInfo> errors_;
|
/foundation/ability/idl_tool/idl_tool_2/codegen/HDI/c/ |
H A D | c_service_stub_code_emitter.h | 61 void EmitServiceStubMethodImpl(const AutoPtr<ASTMethod> &method, StringBuilder &sb,
66 void EmitStubLocalVariable(const AutoPtr<ASTParameter> ¶m, StringBuilder &sb, const std::string &prefix) const;
68 void EmitReadStubMethodParameter(const AutoPtr<ASTParameter> ¶m, const std::string &gotoLabel,
71 void EmitReadCStringStubMethodParameter(const AutoPtr<ASTParameter> ¶m, const std::string &gotoLabel,
72 StringBuilder &sb, const std::string &prefix, AutoPtr<HdiTypeEmitter> &typeEmitter) const;
74 void EmitOutVarMemInitialize(const AutoPtr<ASTParameter> ¶m, const std::string &gotoLabel, StringBuilder &sb,
77 void EmitStubCallMethod(const AutoPtr<ASTMethod> &method,
80 void EmitCallParameter(StringBuilder &sb, const AutoPtr<ASTType> &type, ASTParamAttr::ParamAttr attribute,
84 const AutoPtr<ASTMethod> &method, StringBuilder &sb, const std::string &prefix) const;
106 void EmitParamLocalVar(const AutoPtr<ASTParamete [all...] |
H A D | c_custom_types_code_emitter.h | 50 void EmitCustomTypeMarshallFuncDecl(StringBuilder &sb, const AutoPtr<ASTType> &type) const;
60 void EmitCustomTypeMarshallingImpl(StringBuilder &sb, const AutoPtr<ASTStructType> &type);
62 void EmitCustomTypeUnmarshallingImpl(StringBuilder &sb, const AutoPtr<ASTStructType> &type);
64 void EmitMarshallingVarDecl(const AutoPtr<ASTStructType> &type,
67 void EmitUnmarshallingVarDecl(const AutoPtr<ASTStructType> &type,
75 void EmitMemberUnmarshalling(const AutoPtr<ASTType> &type, const std::string &name, const std::string &memberName,
78 void EmitStringMemberUnmarshalling(const AutoPtr<HdiTypeEmitter> &typeEmitter, const std::string &memberName,
81 void EmitArrayMemberUnmarshalling(const AutoPtr<ASTType> &type, const std::string &memberName,
84 void EmitCustomTypeFreeImpl(StringBuilder &sb, const AutoPtr<ASTStructType> &type) const;
86 bool NeedEmitInitVar(const AutoPtr<ASTTyp [all...] |
/foundation/ability/idl_tool/idl_tool_2/codegen/SA/cpp/ |
H A D | sa_cpp_code_emitter.cpp | 35 AutoPtr<ASTType> type = pair.second;
in GetStdlibInclusions() 73 void SACppCodeEmitter::EmitWriteMethodParameter(const AutoPtr<ASTParameter> ¶m, const std::string &parcelName,
in EmitWriteMethodParameter() 76 AutoPtr<SaTypeEmitter> typeEmitter = GetTypeEmitter(param->GetType());
in EmitWriteMethodParameter() 80 void SACppCodeEmitter::EmitReadMethodParameter(const AutoPtr<ASTParameter> ¶m, const std::string &parcelName,
in EmitReadMethodParameter() 83 AutoPtr<SaTypeEmitter> typeEmitter = GetTypeEmitter(param->GetType());
in EmitReadMethodParameter() 87 void SACppCodeEmitter::EmitInterfaceMethodParams(AutoPtr<ASTMethod> &method, StringBuilder &sb,
in EmitInterfaceMethodParams() 90 AutoPtr<ASTType> returnType = method->GetReturnType();
in EmitInterfaceMethodParams() 95 AutoPtr<ASTParameter> param = method->GetParameter(i);
in EmitInterfaceMethodParams() 102 AutoPtr<SaTypeEmitter> typeEmitter = GetTypeEmitter(returnType);
in EmitInterfaceMethodParams() 107 std::string SACppCodeEmitter::EmitCppParameter(AutoPtr<ASTParamete [all...] |
/foundation/ability/idl_tool/idl_tool_2/codegen/SA/ts/ |
H A D | sa_ts_interface_code_emitter.cpp | 70 AutoPtr<ASTMethod> method = interface_->GetMethod(i);
in EmitInterfaceDefinition() 76 AutoPtr<ASTMethod> method = interface_->GetMethod(i);
in EmitInterfaceDefinition() 81 void SaTsInterfaceCodeEmitter::EmitInterfaceMethod(AutoPtr<ASTMethod> &method, StringBuilder &sb,
in EmitInterfaceMethod() 87 AutoPtr<ASTParameter> param = method->GetParameter(i);
in EmitInterfaceMethod() 89 AutoPtr<SaTypeEmitter> typeEmitter = GetTypeEmitter(param->GetType());
in EmitInterfaceMethod() 96 void SaTsInterfaceCodeEmitter::EmitInterfaceMethodCallback(AutoPtr<ASTMethod> &method, StringBuilder &sb) const
in EmitInterfaceMethodCallback() 100 AutoPtr<ASTType> returnType = method->GetReturnType();
in EmitInterfaceMethodCallback() 102 AutoPtr<SaTypeEmitter> typeEmitter = GetTypeEmitter(returnType);
in EmitInterfaceMethodCallback() 107 AutoPtr<ASTParameter> param = method->GetParameter(i);
in EmitInterfaceMethodCallback() 109 AutoPtr<SaTypeEmitte in EmitInterfaceMethodCallback() [all...] |