mjplusplus  v0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
lexer::Stateomat Class Reference

#include <stateomat.hpp>

Public Member Functions

 Stateomat ()
 
bool state_is_accepting (unsigned int state)
 
void dump_graph (std::string const &file_name)
 

Public Attributes

std::vector< std::vector
< unsigned int > > 
transitions
 
std::vector< Token::Token_typestate_type
 
std::unordered_map
< std::string,
Token::Token_type
keywords
 
std::vector
< std::unordered_map
< std::string,
Token::Token_type > > 
operators
 
std::map< Token::Token_type,
std::string > 
reverse
 

Constructor & Destructor Documentation

lexer::Stateomat::Stateomat ( )

Constructor.

Member Function Documentation

void lexer::Stateomat::dump_graph ( std::string const &  file_name)

Writes the stateomat transition graph as a gml-file.

Parameters
file_namefile to write the graph into
bool lexer::Stateomat::state_is_accepting ( unsigned int  state)

Returns whether the current state is accepting.

Parameters
statethe state to test
Returns
true if state is accepting, else false

Member Data Documentation

std::unordered_map<std::string, Token::Token_type> lexer::Stateomat::keywords

maps string representation to token type for all keywords

std::vector<std::unordered_map<std::string, Token::Token_type> > lexer::Stateomat::operators

maps string representation to token type for operators. indexed by end state to get the appropriate map

std::map<Token::Token_type, std::string> lexer::Stateomat::reverse

maps token type to its string representation (for printing purposes)

std::vector<Token::Token_type> lexer::Stateomat::state_type

saves the token types corresponding to the different states

std::vector<std::vector<unsigned int> > lexer::Stateomat::transitions

transition map


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