aboutsummaryrefslogtreecommitdiff
path: root/src/tree.cc
diff options
context:
space:
mode:
authorAdrian Kummerländer2013-07-29 21:07:40 +0200
committerAdrian Kummerländer2013-07-29 21:07:40 +0200
commitb765b57739463d0aa3b833a70e0ea87bca68e82e (patch)
tree096324034bd40cdb88fe4855c86194f3d4b1b48b /src/tree.cc
parent948cb0482be1783db036f40fd4f93a3355da232f (diff)
downloadSimpleParser-b765b57739463d0aa3b833a70e0ea87bca68e82e.tar
SimpleParser-b765b57739463d0aa3b833a70e0ea87bca68e82e.tar.gz
SimpleParser-b765b57739463d0aa3b833a70e0ea87bca68e82e.tar.bz2
SimpleParser-b765b57739463d0aa3b833a70e0ea87bca68e82e.tar.lz
SimpleParser-b765b57739463d0aa3b833a70e0ea87bca68e82e.tar.xz
SimpleParser-b765b57739463d0aa3b833a70e0ea87bca68e82e.tar.zst
SimpleParser-b765b57739463d0aa3b833a70e0ea87bca68e82e.zip
Coding style improvements
Diffstat (limited to 'src/tree.cc')
-rw-r--r--src/tree.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/tree.cc b/src/tree.cc
index 0fa41ad..5c47a50 100644
--- a/src/tree.cc
+++ b/src/tree.cc
@@ -15,7 +15,9 @@ double Tree::solve() {
}
Node* Tree::addOperand(Node** place, double value) {
- this->node_collection_.emplace_back(new OperandNode(value));
+ this->node_collection_.emplace_back(
+ new OperandNode(value)
+ );
if ( place != nullptr ) {
*place = this->node_collection_.back().get();
@@ -25,7 +27,9 @@ Node* Tree::addOperand(Node** place, double value) {
}
Node* Tree::addOperator(Node** place, char oper) {
- this->node_collection_.emplace_back(new OperatorNode(oper));
+ this->node_collection_.emplace_back(
+ new OperatorNode(oper)
+ );
if ( place != nullptr ) {
*place = this->node_collection_.back().get();
@@ -47,7 +51,9 @@ std::string Tree::print(std::string term) {
int i = 0;
- for ( auto it = this->node_collection_.begin(); it != this->node_collection_.end(); ++it ) {
+ for ( auto it = this->node_collection_.begin();
+ it != this->node_collection_.end();
+ ++it ) {
out << "node"
<< i
<< " [ label = \""
@@ -56,7 +62,9 @@ std::string Tree::print(std::string term) {
<< std::endl;
if ( (*it)->getType() == OPERATOR_NODE ) {
- for ( auto iter = this->node_collection_.begin(); iter != this->node_collection_.end(); ++iter ) {
+ for ( auto iter = this->node_collection_.begin();
+ iter != this->node_collection_.end();
+ ++iter ) {
if ( (*iter).get() == (*it)->leftChild ) {
out << "\"node"
<< i
@@ -84,4 +92,4 @@ std::string Tree::print(std::string term) {
return out.str();
}
-} // SimpleParser
+}