NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
mu::ParserStack< TValueType > Class Template Reference

Parser stack implementation. More...

#include <muParserStack.h>

Collaboration diagram for mu::ParserStack< TValueType >:

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...
 

Detailed Description

template<typename TValueType>
class mu::ParserStack< TValueType >

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.

Author
(C) 2004-2011 Ingo Berg

Definition at line 53 of file muParserStack.h.

Member Typedef Documentation

◆ impl_type

template<typename TValueType >
typedef std::stack<TValueType, std::vector<TValueType> > mu::ParserStack< TValueType >::impl_type
private

Type of the underlying stack implementation.

Definition at line 58 of file muParserStack.h.

Constructor & Destructor Documentation

◆ ParserStack()

template<typename TValueType >
mu::ParserStack< TValueType >::ParserStack ( )
inline

Definition at line 65 of file muParserStack.h.

◆ ~ParserStack()

template<typename TValueType >
virtual mu::ParserStack< TValueType >::~ParserStack ( )
inlinevirtual

Definition at line 70 of file muParserStack.h.

Member Function Documentation

◆ empty()

template<typename TValueType >
bool mu::ParserStack< TValueType >::empty ( ) const
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().

◆ pop()

template<typename TValueType >
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.

Exceptions
ParserExceptionin case the stack is empty.
See also
pop(int &a_iErrc)

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().

Here is the call graph for this function:

◆ push()

template<typename TValueType >
void mu::ParserStack< TValueType >::push ( const TValueType &  a_Val)
inline

Push an object into the stack.

Parameters
a_Valobject to push into the stack.
Exceptions
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().

◆ size()

template<typename TValueType >
unsigned mu::ParserStack< TValueType >::size ( ) const
inline

◆ top()

template<typename TValueType >
TValueType & mu::ParserStack< TValueType >::top ( )
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().

Member Data Documentation

◆ m_Stack


The documentation for this class was generated from the following file: