45#include "selection/TokenMap.hpp"
49 TokenMap::TokenMap() {
50 tokenMap_.insert(TokenMapType::value_type(
51 "define", Token(Token::define, std::string(
"define"))));
52 tokenMap_.insert(TokenMapType::value_type(
53 "select", Token(Token::select, std::string(
"select"))));
58 tokenMap_.insert(TokenMapType::value_type(
59 "(", Token(Token::leftparen, std::string(
"("))));
60 tokenMap_.insert(TokenMapType::value_type(
61 ")", Token(Token::rightparen, std::string(
")"))));
63 tokenMap_.insert(TokenMapType::value_type(
64 "and", Token(Token::opAnd, std::string(
"and"))));
66 TokenMapType::value_type(
"&", Token(Token::opAnd, std::string(
"and"))));
67 tokenMap_.insert(TokenMapType::value_type(
68 "&&", Token(Token::opAnd, std::string(
"and"))));
71 TokenMapType::value_type(
"or", Token(Token::opOr, std::string(
"or"))));
73 TokenMapType::value_type(
",", Token(Token::opOr, std::string(
"or"))));
75 TokenMapType::value_type(
"|", Token(Token::opOr, std::string(
"or"))));
77 TokenMapType::value_type(
"||", Token(Token::opOr, std::string(
"or"))));
79 tokenMap_.insert(TokenMapType::value_type(
80 "not", Token(Token::opNot, std::string(
"not"))));
82 TokenMapType::value_type(
"!", Token(Token::opNot, std::string(
"not"))));
85 TokenMapType::value_type(
"<", Token(Token::opLT, std::string(
"<"))));
87 TokenMapType::value_type(
"<=", Token(Token::opLE, std::string(
"<="))));
89 TokenMapType::value_type(
">=", Token(Token::opGE, std::string(
">="))));
91 TokenMapType::value_type(
">", Token(Token::opGT, std::string(
">"))));
93 TokenMapType::value_type(
"==", Token(Token::opEQ, std::string(
"=="))));
95 TokenMapType::value_type(
"!=", Token(Token::opNE, std::string(
"!="))));
96 tokenMap_.insert(TokenMapType::value_type(
97 "within", Token(Token::within, std::string(
"within"))));
99 TokenMapType::value_type(
".", Token(Token::dot, std::string(
"."))));
100 tokenMap_.insert(TokenMapType::value_type(
101 "mass", Token(Token::mass, std::string(
"mass"))));
102 tokenMap_.insert(TokenMapType::value_type(
103 "charge", Token(Token::charge, std::string(
"charge"))));
104 tokenMap_.insert(TokenMapType::value_type(
105 "hull", Token(Token::hull, std::string(
"hull"))));
106 tokenMap_.insert(TokenMapType::value_type(
107 "alphahull", Token(Token::alphahull, std::string(
"alphahull"))));
109 TokenMapType::value_type(
"x", Token(Token::x, std::string(
"x"))));
111 TokenMapType::value_type(
"y", Token(Token::y, std::string(
"y"))));
113 TokenMapType::value_type(
"z", Token(Token::z, std::string(
"z"))));
114 tokenMap_.insert(TokenMapType::value_type(
115 "wrappedx", Token(Token::wrappedX, std::string(
"wrappedx"))));
116 tokenMap_.insert(TokenMapType::value_type(
117 "wrappedy", Token(Token::wrappedY, std::string(
"wrappedy"))));
118 tokenMap_.insert(TokenMapType::value_type(
119 "wrappedz", Token(Token::wrappedZ, std::string(
"wrappedz"))));
120 tokenMap_.insert(TokenMapType::value_type(
121 "atomno", Token(Token::atomno, std::string(
"atomno"))));
123 TokenMapType::value_type(
"r", Token(Token::r, std::string(
"r"))));
125 TokenMapType::value_type(
"to", Token(Token::to, std::string(
"to"))));
128 TokenMapType::value_type(
"all", Token(Token::all, std::string(
"all"))));
129 tokenMap_.insert(TokenMapType::value_type(
130 "none", Token(Token::none, std::string(
"none"))));
133 Token* TokenMap::getToken(
const std::string& ident) {
134 std::map<std::string, Token>::iterator i = tokenMap_.find(ident);
136 return i != tokenMap_.end() ? &(i->second) : NULL;
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.