• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #include "ast/ast_module.h"
10 
11 namespace OHOS {
12 namespace HDI {
AddAST(const String & astName,const AutoPtr<AST> ast)13 void ASTModule::AddAST(const String& astName, const AutoPtr<AST> ast)
14 {
15     asts_[astName] = ast;
16 }
17 
GetAst(const String & astName)18 AutoPtr<AST> ASTModule::GetAst(const String& astName)
19 {
20     auto astIter = asts_.find(astName);
21     if (astIter == asts_.end()) {
22         return nullptr;
23     }
24     return astIter->second;
25 }
26 } // namespace HDI
27 } // namespace OHOS