NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
Parser stack implementation. More...
#include <muParserStack.h>
Public Member Functions | |
ParserStack () | |
virtual | ~ParserStack () |
TValueType | pop () |
Pop a value from the stack. More... | |
void | push (const TValueType &a_Val) |
Push an object into the stack. More... | |
unsigned | size () const |
Return the number of stored elements. More... | |
bool | empty () const |
Returns true if stack is empty false otherwise. More... | |
TValueType & | top () |
Return reference to the top object in the stack. More... | |
Private Types | |
typedef std::stack< TValueType, std::vector< TValueType > > | impl_type |
Type of the underlying stack implementation. More... | |
Private Attributes | |
impl_type | m_Stack |
This is the actual stack. More... | |
Parser stack implementation.
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.
Definition at line 53 of file muParserStack.h.
|
private |
Type of the underlying stack implementation.
Definition at line 58 of file muParserStack.h.
|
inline |
Definition at line 65 of file muParserStack.h.
|
inlinevirtual |
Definition at line 70 of file muParserStack.h.
|
inline |
Returns true if stack is empty false otherwise.
Definition at line 109 of file muParserStack.h.
References mu::ParserStack< TValueType >::m_Stack.
Referenced by mu::ParserBase::ApplyFunc(), mu::ParserBase::CreateRPN(), mu::ParserStack< TValueType >::pop(), and mu::ParserBase::StackDump().
|
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. |
Definition at line 82 of file muParserStack.h.
References _nrT, mu::ParserStack< TValueType >::empty(), mu::ParserStack< TValueType >::m_Stack, and mu::ParserStack< TValueType >::top().
Referenced by mu::ParserBase::ApplyBinOprt(), mu::ParserBase::ApplyFunc(), mu::ParserBase::ApplyIfElse(), mu::ParserBase::CreateRPN(), mu::ParserByteCode::Finalize(), and mu::ParserBase::StackDump().
|
inline |
Push an object into the stack.
a_Val | object to push into the stack. |
nothrow |
Definition at line 97 of file muParserStack.h.
References mu::ParserStack< TValueType >::m_Stack.
Referenced by mu::ParserBase::ApplyBinOprt(), mu::ParserBase::ApplyFunc(), mu::ParserBase::ApplyIfElse(), mu::ParserBase::CreateRPN(), and mu::ParserByteCode::Finalize().
|
inline |
Return the number of stored elements.
Definition at line 103 of file muParserStack.h.
References mu::ParserStack< TValueType >::m_Stack.
Referenced by mu::ParserBase::ApplyBinOprt(), mu::ParserBase::ApplyIfElse(), mu::ParserBase::ApplyRemainingOprt(), and mu::ParserBase::CreateRPN().
|
inline |
Return reference to the top object in the stack.
The top object is the one pushed most recently.
Definition at line 118 of file muParserStack.h.
References mu::ParserStack< TValueType >::m_Stack.
Referenced by mu::ParserBase::ApplyBinOprt(), mu::ParserBase::ApplyFunc(), mu::ParserBase::ApplyIfElse(), mu::ParserBase::ApplyRemainingOprt(), mu::ParserBase::CreateRPN(), and mu::ParserStack< TValueType >::pop().
|
private |
This is the actual stack.
Definition at line 60 of file muParserStack.h.
Referenced by mu::ParserStack< TValueType >::empty(), mu::ParserStack< TValueType >::pop(), mu::ParserStack< TValueType >::push(), mu::ParserStack< TValueType >::size(), and mu::ParserStack< TValueType >::top().