From fb28f6800864176be2ffca29e8e664b641f33170 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 21 Dec 2009 18:04:02 +0000 Subject: m3 is copied into trunk, we should be good to go, now. --- src/astbranch.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/astbranch.cpp (limited to 'src/astbranch.cpp') 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 @@ +#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; +} + -- cgit v1.2.3