#include <muParserStack.h>
Public Member Functions | |
TValueType | pop () |
Pop a value from the stack. | |
void | push (const TValueType &a_Val) |
Push an object into the stack. | |
unsigned | size () const |
Return the number of stored elements. | |
bool | empty () const |
Returns true if stack is empty false otherwise. | |
TValueType & | top () |
Return reference to the top object in the stack. | |
Private Types | |
typedef std::stack< TValueType, std::vector< TValueType > > | impl_type |
Type of the underlying stack implementation. | |
Private Attributes | |
impl_type | m_Stack |
This is the actual stack. |
Stack implementation based on a std::stack. The behaviour of pop() had been slightly changed in order to get an error code if the stack is empty. The stack is used within the Parser both as a value stack and as an operator stack.
TValueType mu::ParserStack< TValueType >::pop | ( | ) | [inline] |
Pop a value from the stack.
Unlike the standard implementation this function will return the value that is going to be taken from the stack.
ParserException | in case the stack is empty. |
References mu::ParserStack< TValueType >::empty(), mu::ParserStack< TValueType >::m_Stack, and mu::ParserStack< TValueType >::top().
Referenced by mu::ParserBase::ApplyFunc(), and mu::ParserBase::ParseString().
void mu::ParserStack< TValueType >::push | ( | const TValueType & | a_Val | ) | [inline] |
Push an object into the stack.
a_Val | object to push into the stack. |
nothrow |
References mu::ParserStack< TValueType >::m_Stack.
Referenced by mu::ParserBase::ApplyFunc(), and mu::ParserBase::ParseString().
TValueType& mu::ParserStack< TValueType >::top | ( | ) | [inline] |
Return reference to the top object in the stack.
The top object is the one pushed most recently.
References mu::ParserStack< TValueType >::m_Stack.
Referenced by mu::ParserBase::ApplyFunc(), mu::ParserBase::ParseString(), and mu::ParserStack< TValueType >::pop().