Antiprism 0.23

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# mu::ParserTokenReader Class Reference

Token reader for the ParserBase class. More...

`#include <muParserTokenReader.h>`

Collaboration diagram for mu::ParserTokenReader:
[legend]

List of all members.

## Public Member Functions
| ParserTokenReader (ParserBase *a_pParent)
| Constructor.
ParserTokenReader * | Clone (ParserBase *a_pParent) const
| Create instance of a ParserTokenReader identical with this and return its pointer.
void | SetFormula (const string_type &a_strFormula)
| Initialize the token Reader.
int | GetPos () const
| Return the current position of the token reader in the formula string.
const string_type & | GetExpr () const
| Return a reference to the formula.
varmap_type & | GetUsedVar ()
| Return a map containing the used variables only.
void | IgnoreUndefVar (bool bIgnore)
| Set Flag that contronls behaviour in case of undefined variables beeing found.
void | ReInit ()
| Reset the token reader to the start of the formula.
token_type | ReadNextToken ()
| Read the next token from the string.

## Detailed Description

Token reader for the ParserBase class.

## Constructor & Destructor Documentation

mu::ParserTokenReader::ParserTokenReader | ( | ParserBase * | a_pParent | ) |

Constructor.

Create a Token reader and bind it to a parser object.

Precondition:
  [assert] a_pParser may not be NULL

Postcondition:
  #m_pParser==a_pParser

Parameters:

  a_pParent | Parent parser object of the token reader.

## Member Function Documentation

ParserTokenReader * mu::ParserTokenReader::Clone | ( | ParserBase * | a_pParent | ) | const

Create instance of a ParserTokenReader identical with this and return its pointer.

This is a factory method the calling function must take care of the object destruction.

Returns:
  A new ParserTokenReader object.

Exceptions:

  nothrow |

const string_type & mu::ParserTokenReader::GetExpr | ( |  | ) | const

Return a reference to the formula.

Returns:
  #m_strFormula

Exceptions:

  nothrow |

int mu::ParserTokenReader::GetPos | ( |  | ) | const

Return the current position of the token reader in the formula string.

Returns:
  #m_iPos

Exceptions:

  nothrow |

void mu::ParserTokenReader::IgnoreUndefVar | ( | bool | bIgnore | ) |

Set Flag that contronls behaviour in case of undefined variables beeing found.

If true, the parser does not throw an exception if an undefined variable is found. otherwise it does. This variable is used internally only! It supresses a "undefined variable" exception in GetUsedVar(). Those function should return a complete list of variables including those the are not defined by the time of it's call.

void mu::ParserTokenReader::ReInit | ( |  | ) |

Reset the token reader to the start of the formula.

The syntax flags will be reset to a value appropriate for the start of a formula.

Postcondition:
  #m_iPos==0, #m_iSynFlags = noOPT | noBC | noPOSTOP | noSTR

Exceptions:

  nothrow |

See also:
  ESynCodes

void mu::ParserTokenReader::SetFormula | ( | const string_type & | a_strFormula | ) |

Initialize the token Reader.

Sets the formula position index to zero and set Syntax flags to default for initial formula parsing.

Precondition:
  [assert] triggered if a_szFormula==0

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

- base/muparser/muParserTokenReader.h
- base/muparser/muParserTokenReader.cc