Puma Reference Manual Puma: Puma::TokenProvider Class Reference



Puma::TokenProvider Class Reference

Reads tokens from a token source. More...

#include <Puma/TokenProvider.h>

List of all members.

Public Types

typedef TokenStore::Iterator State
 Read position.

Public Member Functions

 TokenProvider (PumaTokenSource &s)
 Constructor.
PumaTokenSourcesource () const
 Get the token source object.
Tokennext ()
 Read the next token from the token source.
Tokencurrent () const
 Get the last token read from the token source.
State get_state ()
 Get the current read position.
void set_state (State restored_pos)
 Restore the read position.

Detailed Description

Reads tokens from a token source.

Supports unlimited look ahead. A token source can be a file, a string, a token preprocessor, and so on.


Member Typedef Documentation

typedef TokenStore::Iterator Puma::TokenProvider::State

Read position.


Constructor & Destructor Documentation

Puma::TokenProvider::TokenProvider ( PumaTokenSource s  )  [inline]

Constructor.

Parameters:
s The token source from which to read the tokens.

Member Function Documentation

Token* Puma::TokenProvider::current (  )  const [inline]

Get the last token read from the token source.

State Puma::TokenProvider::get_state (  )  [inline]

Get the current read position.

Token* Puma::TokenProvider::next (  )  [inline]

Read the next token from the token source.

void Puma::TokenProvider::set_state ( State  restored_pos  )  [inline]

Restore the read position.

Parameters:
restored_pos The new read position.
PumaTokenSource& Puma::TokenProvider::source (  )  const [inline]

Get the token source object.




Puma Reference Manual. Created on 11 Sep 2009.