mu::ParserStack< TValueType > Class Template Reference

Parser stack implementation. More...

#include <muParserStack.h>

List of all members.

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.


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

Member Function Documentation

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:
ParserException in case the stack is empty.
See also:
pop(int &a_iErrc)

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

Referenced by mu::ParserBase::ApplyFunc(), and mu::ParserBase::ParseString().

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

Push an object into the stack.

Parameters:
a_Val object to push into the stack.
Exceptions:
nothrow 

References mu::ParserStack< TValueType >::m_Stack.

Referenced by mu::ParserBase::ApplyFunc(), and mu::ParserBase::ParseString().

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.

References mu::ParserStack< TValueType >::m_Stack.

Referenced by mu::ParserBase::ApplyFunc(), mu::ParserBase::ParseString(), and mu::ParserStack< TValueType >::pop().


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

Generated on Sun Jun 22 00:57:25 2008 for muParser by  doxygen 1.5.5