blob: a6aa21cf8f1596a83121c5d76eb866ac7ee11ec0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#include "astbranch.h"
AstBranch::AstBranch( Type eType ) :
AstNode( eType )
{
}
AstBranch::~AstBranch()
{
}
void AstBranch::addBranch()
{
lBranch.append( NodeList() );
}
void AstBranch::addNode( AstNode *pNode )
{
lBranch.last().append( pNode );
}
AstBranch::BranchList::const_iterator AstBranch::getBranchBegin() const
{
return lBranch.begin();
}
Bu::Formatter &operator<<( Bu::Formatter &f, const AstBranch &l )
{
f.incIndent();
f << ":";
for( AstBranch::BranchList::const_iterator i = l.getBranchBegin(); i; i++ )
{
f << f.nl << "Branch:";
f.incIndent();
for( AstBranch::NodeList::const_iterator j = i->begin(); j; j++ )
{
f << f.nl << **j;
}
f.decIndent();
}
f.decIndent();
return f;
}
|