diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:04:02 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-21 18:04:02 +0000 |
commit | fb28f6800864176be2ffca29e8e664b641f33170 (patch) | |
tree | ba9180ac442939edc4eacbe1fdae93c5a7f87cee /src/astbranch.cpp | |
parent | 51e21a316be6e052251b3dfc7d671061ebd67cee (diff) | |
download | build-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 '')
-rw-r--r-- | src/astbranch.cpp | 44 |
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 | |||
3 | AstBranch::AstBranch( Type eType ) : | ||
4 | AstNode( eType ) | ||
5 | { | ||
6 | } | ||
7 | |||
8 | AstBranch::~AstBranch() | ||
9 | { | ||
10 | } | ||
11 | |||
12 | void AstBranch::addBranch() | ||
13 | { | ||
14 | lBranch.append( NodeList() ); | ||
15 | } | ||
16 | |||
17 | void AstBranch::addNode( AstNode *pNode ) | ||
18 | { | ||
19 | lBranch.last().append( pNode ); | ||
20 | } | ||
21 | |||
22 | AstBranch::BranchList::const_iterator AstBranch::getBranchBegin() const | ||
23 | { | ||
24 | return lBranch.begin(); | ||
25 | } | ||
26 | |||
27 | Bu::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 | |||