Public Types | |
typedef KRatExpToken< typename Element< S, T >::monoid_elt_value_t, typename Element< S, T >::semiring_elt_value_t > | krat_exp_token_t |
typedef std::list< krat_exp_token_t > | token_stream_t |
Public Member Functions | |
Lexer (bool trace=false) | |
void | lex_error (const std::string &msg="Lex error.") |
Put the lexer into an error state. | |
void | lex (const std::string &in, const Element< S, T > &e) |
Perform lexing. | |
bool | error () const |
Return true when an error occured. | |
const std::string & | error_msg () const |
Return the error message. | |
krat_exp_token_t | first () const |
Return the first token. | |
krat_exp_token_t | second () const |
Return the second token. | |
void | eat () |
Shift tokens. | |
void | set_trace (bool trace) |
Protected Attributes | |
token_stream_t | tokens_ |
bool | trace_ |
std::string | error_msg_ |
bool | error_ |
Parser
Definition at line 237 of file krat_exp_parser.hxx.
|
Perform lexing.
Definition at line 270 of file krat_exp_parser.hxx. References Lexer::error_, utility::escaped(), Lexer::lex_error(), vcsn::parse_weight(), vcsn::parse_word(), KRatExpToken::reset(), Element::structure(), Lexer::tokens_, and vcsn::tools::usual_escaped_characters(). Referenced by vcsn::algebra::parse(). |
|
Shift tokens. Remove the first token from the token stream. So second becames first, third becames second, and so on... Definition at line 362 of file krat_exp_parser.hxx. References Lexer::tokens_, and Lexer::trace_. |