renamed:    assignment2/as2/main.cpp -> assignment2/as2/assignment02_159201_final_version.cpps
This commit is contained in:
mooophy
2014-12-08 17:14:08 +13:00
parent dd2b06fe8c
commit 74643b0954
2 changed files with 20 additions and 1 deletions

View File

@@ -4,5 +4,8 @@ CONFIG -= app_bundle
CONFIG -= qt
CONFIG += c++11
SOURCES += main.cpp
SOURCES +=
HEADERS += \
assignment02_159201_final_version.cpps

View File

@@ -1,3 +1,13 @@
//!
//! @author Wang WeiXu 13114633
//! @date 08.12.2014
//!
//! @brief This code implemented a parser evaluating Reverse Polish Notation expression
//! using a stack.
//!
//! Assignment 2, 159.201,s3,2014
//!
#include <iostream>
#include <stdexcept>
#include <string>
@@ -103,6 +113,8 @@ private:
/**
* @brief The Stack class
*
* using linked list as underlying data structrue
*/
template<typename T, typename Container = ads::List<T> >
class Stack
@@ -157,6 +169,9 @@ struct RpnParser
private:
/**
* @brief The Eval functor
*/
struct Eval
{
bool is_evaluable(char op) const
@@ -224,6 +239,7 @@ private:
}
//! abstraction I
//! implementation for parsing and evaluation
int do_parse_and_evaluate(std::string const& fn)
{
std::ifstream ifs{fn};