MADNESS  version 0.9
Public Member Functions | List of all members
mu::ParserStack< TValueType > Class Template Reference

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

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-2008 Ingo Berg

Constructor & Destructor Documentation

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

Member Function Documentation

template<typename TValueType>
bool mu::ParserStack< TValueType >::empty ( ) const
inline

Returns true if stack is empty false otherwise.

Referenced by mu::ParserStack< TValueType >::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)

References _T, mu::ParserStack< TValueType >::empty(), and mu::ParserStack< TValueType >::top().

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
template<typename TValueType>
unsigned mu::ParserStack< TValueType >::size ( ) const
inline

Return the number of stored elements.

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.

Referenced by mu::ParserStack< TValueType >::pop().


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