aboutsummaryrefslogtreecommitdiff
path: root/src/astbranch.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
committerMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
commitfb28f6800864176be2ffca29e8e664b641f33170 (patch)
treeba9180ac442939edc4eacbe1fdae93c5a7f87cee /src/astbranch.cpp
parent51e21a316be6e052251b3dfc7d671061ebd67cee (diff)
downloadbuild-fb28f6800864176be2ffca29e8e664b641f33170.tar.gz
build-fb28f6800864176be2ffca29e8e664b641f33170.tar.bz2
build-fb28f6800864176be2ffca29e8e664b641f33170.tar.xz
build-fb28f6800864176be2ffca29e8e664b641f33170.zip
m3 is copied into trunk, we should be good to go, now.
Diffstat (limited to 'src/astbranch.cpp')
-rw-r--r--src/astbranch.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/astbranch.cpp b/src/astbranch.cpp
new file mode 100644
index 0000000..a6aa21c
--- /dev/null
+++ b/src/astbranch.cpp
@@ -0,0 +1,44 @@
1#include "astbranch.h"
2
3AstBranch::AstBranch( Type eType ) :
4 AstNode( eType )
5{
6}
7
8AstBranch::~AstBranch()
9{
10}
11
12void AstBranch::addBranch()
13{
14 lBranch.append( NodeList() );
15}
16
17void AstBranch::addNode( AstNode *pNode )
18{
19 lBranch.last().append( pNode );
20}
21
22AstBranch::BranchList::const_iterator AstBranch::getBranchBegin() const
23{
24 return lBranch.begin();
25}
26
27Bu::Formatter &operator<<( Bu::Formatter &f, const AstBranch &l )
28{
29 f.incIndent();
30 f << ":";
31 for( AstBranch::BranchList::const_iterator i = l.getBranchBegin(); i; i++ )
32 {
33 f << f.nl << "Branch:";
34 f.incIndent();
35 for( AstBranch::NodeList::const_iterator j = i->begin(); j; j++ )
36 {
37 f << f.nl << **j;
38 }
39 f.decIndent();
40 }
41 f.decIndent();
42 return f;
43}
44