| Puma Reference Manual | Puma::TokenProvider Class Reference |
Reads tokens from a token source. More...
#include <Puma/TokenProvider.h>

Public Types | |
| typedef TokenStore::Iterator | State |
| Read position. More... | |
Public Member Functions | |
| TokenProvider (PumaTokenSource &s) | |
| Constructor. More... | |
| virtual | ~TokenProvider () |
| Destructor. More... | |
| void | init () |
| Initialize the token provider by reading the first token. More... | |
| PumaTokenSource & | source () const |
| Get the token source. More... | |
| Token * | next () |
| Read the next token from the token source. More... | |
| Token * | current () const |
| Get the last token read from the token source. More... | |
| State | get_state () |
| Get the current read position. More... | |
| void | set_state (State restored_pos) |
| Restore the read position. More... | |
Protected Types | |
| typedef BCList< void *, 8192 > | TokenStore |
Protected Member Functions | |
| virtual void * | read () |
| Read next token. More... | |
| virtual Token * | token () const |
| Get the current token. More... | |
Protected Attributes | |
| PumaTokenSource & | _source |
| TokenStore | _tokens |
| TokenStore::Iterator | _read_pos |
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.
| typedef TokenStore::Iterator Puma::TokenProvider::State |
Read position.
|
protected |
|
inline |
Constructor.
| s | The token source from which to read the tokens. |
|
inlinevirtual |
Destructor.
The compiler complains if we done define a virtual destrcutor.
|
inline |
Get the last token read from the token source.
|
inline |
Get the current read position.
|
inline |
Initialize the token provider by reading the first token.
|
inline |
Read the next token from the token source.
|
inlineprotectedvirtual |
Read next token.
Reimplemented in Puma::InstantiationTokenProvider.
|
inline |
Restore the read position.
| restored_pos | The new read position. |
|
inline |
Get the token source.
|
inlineprotectedvirtual |
Get the current token.
Reimplemented in Puma::InstantiationTokenProvider.
|
protected |
|
protected |
|
protected |