1 #ifndef _HGVS_LEXER_HPP_ 2 #define _HGVS_LEXER_HPP_ 3 4 #include <boost/spirit/include/lex_lexertl.hpp> 5 6 namespace lex = boost::spirit::lex; 7 8 typedef char const* TLexIterator; 9 typedef lex::lexertl::token<TLexIterator, boost::mpl::vector<std::string> > TToken; 10 typedef lex::lexertl::lexer<TToken> TLexer; 11 12 13 struct SHgvsLexer : lex::lexer<TLexer> 14 { 15 16 SHgvsLexer(); 17 18 typedef lex::token_def<lex::omit> TSimpleToken; // This token type only has an identifier 19 typedef lex::token_def<std::string> TAttributedToken; // This token also includes attribute 20 21 TSimpleToken dup; 22 TSimpleToken del; 23 TSimpleToken delins; 24 TSimpleToken ins; 25 TSimpleToken inv; 26 TSimpleToken con; 27 TSimpleToken ext; 28 TSimpleToken fs; 29 TAttributedToken ACGT; 30 TAttributedToken acgu; 31 TAttributedToken definite_aa1; 32 TAttributedToken aa3; 33 TSimpleToken stop; 34 TAttributedToken pos_int; 35 TAttributedToken fuzzy_pos_int; 36 TAttributedToken unknown_val; 37 TSimpleToken nochange; 38 TSimpleToken zero; 39 TSimpleToken unknown_chrom_separator; // (;) 40 TSimpleToken protein_tag; 41 TAttributedToken na_tag; 42 TAttributedToken identifier; 43 TSimpleToken slash; 44 TSimpleToken double_slash; 45 TSimpleToken splice; 46 }; 47 48 #endif // _HGVS_LEXER_HPP_ 49