wibble::Lexer< Token, Stream > Struct Template Reference

`#include <parse.h>`

Collaboration diagram for wibble::Lexer< Token, Stream >:
[legend]

## Public Types

typedef std::deque< char > | Window

## Public Member Functions

void | shift ()
bool | eof ()
std::string | window (unsigned n)
bool | ensure_window (unsigned n)
void | consume (int n)
void | consume (const std::string &s)
void | consume (const Token &t)
void | keep (typename Token::Id id, const std::string &data)
template<typename I >
bool | match (I begin, I end)
void | match (const std::string &data, typename Token::Id id)
void | match (Regexp &r, typename Token::Id id)
void | match (int(*first)(int), int(*rest)(int), typename Token::Id id)
void | match (const std::string &from, const std::string &to, typename Token::Id id)
void | skipWhitespace ()
Token | decide ()
| Lexer (Stream &s)

## Public Attributes

Stream & | stream
Window | _window
Position | current
Token | _match

## Member Typedef Documentation

## Window

template<typename Token, typename Stream>

typedef std::deque< char > wibble::Lexer< Token, Stream >::Window

## Constructor & Destructor Documentation

## Lexer()

template<typename Token, typename Stream>

wibble::Lexer< Token, Stream >::Lexer | ( | Stream & | s | ) |

inline

## Member Function Documentation

## consume() [1/3]

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::consume | ( | int | n | ) |

inline

## consume() [2/3]

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::consume | ( | const std::string & | s | ) |

inline

## consume() [3/3]

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::consume | ( | const Token & | t | ) |

inline

## decide()

template<typename Token, typename Stream>

Token wibble::Lexer< Token, Stream >::decide | ( |  | ) |

inline

## ensure_window()

template<typename Token, typename Stream>

bool wibble::Lexer< Token, Stream >::ensure_window | ( | unsigned | n | ) |

inline

## eof()

template<typename Token, typename Stream>

bool wibble::Lexer< Token, Stream >::eof | ( |  | ) |

inline

## keep()

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::keep | ( | typename Token::Id | id,
|  | const std::string & | data
| ) |  |

inline

## match() [1/5]

template<typename Token, typename Stream>
template<typename I >

bool wibble::Lexer< Token, Stream >::match | ( | I | begin,
|  | I | end
| ) |  |

inline

## match() [2/5]

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::match | ( | const std::string & | data,
|  | typename Token::Id | id
| ) |  |

inline

## match() [3/5]

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::match | ( | Regexp & | r,
|  | typename Token::Id | id
| ) |  |

inline

## match() [4/5]

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::match | ( | int(*)(int) | first,
|  | int(*)(int) | rest,
|  | typename Token::Id | id
| ) |  |

inline

## match() [5/5]

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::match | ( | const std::string & | from,
|  | const std::string & | to,
|  | typename Token::Id | id
| ) |  |

inline

## shift()

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::shift | ( |  | ) |

inline

## skipWhitespace()

template<typename Token, typename Stream>

void wibble::Lexer< Token, Stream >::skipWhitespace | ( |  | ) |

inline

## window()

template<typename Token, typename Stream>

std::string wibble::Lexer< Token, Stream >::window | ( | unsigned | n | ) |

inline

## Member Data Documentation

## _match

template<typename Token, typename Stream>

Token wibble::Lexer< Token, Stream >::_match

## _window

template<typename Token, typename Stream>

Window wibble::Lexer< Token, Stream >::_window

## current

template<typename Token, typename Stream>

Position wibble::Lexer< Token, Stream >::current

## stream

template<typename Token, typename Stream>

Stream& wibble::Lexer< Token, Stream >::stream

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

- parse.h