GCC Code Coverage Report


Directory: src/
File: src/frontend/syntax-node.cpp
Date: 2025-10-15 09:43:47
Exec Total Coverage
Lines: 19 22 86.4%
Functions: 7 8 87.5%
Branches: 0 0 -%

Line Branch Exec Source
1 #include <gyoji-frontend.hpp>
2
3 using namespace Gyoji::context;
4 using namespace Gyoji::frontend;
5 using namespace Gyoji::frontend::ast;
6
7 ///////////////////////////////////////////////////
8 80214 SyntaxNode::SyntaxNode(
9 TokenID _type,
10 SyntaxNode::specific_type_t _data,
11 const SourceReference & _source_ref
12 80214 )
13 80214 : source_ref(_source_ref)
14 80214 , type(_type)
15 80214 , data(_data)
16 80214 {}
17 75576 SyntaxNode::~SyntaxNode()
18 75576 {}
19 void
20 75040 SyntaxNode::add_child(const SyntaxNode & node)
21 {
22 75040 children.push_back(node);
23 75040 }
24 void
25 SyntaxNode::prepend_child(const SyntaxNode & node)
26 {
27 children.insert(children.begin(), node);
28 }
29 const std::vector<std::reference_wrapper<const SyntaxNode>> &
30 34310 SyntaxNode::get_children() const
31 {
32 34310 return children;
33 }
34 12474 const TokenID & SyntaxNode::get_type() const
35 {
36 12474 return type;
37 }
38 const SyntaxNode &
39 96 SyntaxNode::get_syntax_node() const
40 96 { return *this; }
41
42 const SourceReference &
43 75952 SyntaxNode::get_source_ref() const
44 75952 { return source_ref; }
45