1/** 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16#include "dummyNode.h" 17 18#include "checker/TSchecker.h" 19#include "checker/ETSchecker.h" 20#include "compiler/core/pandagen.h" 21#include "compiler/core/ETSGen.h" 22#include "ir/astDump.h" 23#include "ir/srcDump.h" 24 25namespace ark::es2panda::ir { 26void DummyNode::TransformChildren([[maybe_unused]] const NodeTransformer &cb, 27 [[maybe_unused]] std::string_view transformationName) 28{ 29} 30 31void DummyNode::Iterate([[maybe_unused]] const NodeTraverser &cb) const {} 32 33void DummyNode::Dump(ir::AstDumper *dumper) const 34{ 35 dumper->Add({{"type", "DummyNode"}, 36 {"name", name_}, 37 {"indexName", indexName_}, 38 {"returnType", returnType_->AsETSTypeReferencePart()->Name()->AsIdentifier()->Name()}}); 39} 40 41void DummyNode::Dump(ir::SrcDumper *dumper) const 42{ 43 dumper->Add(std::string(name_)); 44} 45 46void DummyNode::Compile(compiler::PandaGen *pg) const 47{ 48 pg->GetAstCompiler()->Compile(this); 49} 50 51void DummyNode::Compile(compiler::ETSGen *etsg) const 52{ 53 etsg->GetAstCompiler()->Compile(this); 54} 55 56checker::Type *DummyNode::Check(checker::TSChecker *checker) 57{ 58 return checker->GetAnalyzer()->Check(this); 59} 60 61checker::Type *DummyNode::Check(checker::ETSChecker *checker) 62{ 63 return checker->GetAnalyzer()->Check(this); 64} 65} // namespace ark::es2panda::ir 66