45 const size_t startPos =
m_pos;
46 const wxUniChar curCh =
curChar();
51 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LPAR, startPos };
54 else if( curCh ==
')' )
56 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::RPAR, startPos };
59 else if( curCh ==
'*' )
61 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::MUL, startPos };
64 else if( curCh ==
'/' )
66 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::DIV, startPos };
69 else if( curCh ==
'=' )
71 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::EQUAL, startPos };
74 else if( curCh ==
'<' )
79 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LESS_EQUAL, startPos };
81 else if( nextCh ==
'>' )
84 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::NOT_EQUAL, startPos };
88 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LESS, startPos };
92 else if( curCh ==
'>' )
97 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::GREATER_EQUAL, startPos };
101 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::GREATER, startPos };
105 else if( curCh ==
'&' && nextCh ==
'&' )
108 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LOW_AND, startPos };
111 else if( curCh ==
'|' && nextCh ==
'|' )
114 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LOW_OR, startPos };
117 else if( curCh ==
'\'' )
119 wxString constString;
120 while(
m_it !=
m_expr.end() && nextCh !=
'\'' )
122 constString += nextCh;
131 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_STRING, startPos, constString };
134 else if( curCh ==
'+' && !wxIsdigit( nextCh ) )
136 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::ADD, startPos };
139 else if( curCh ==
'-' && !wxIsdigit( nextCh ) )
141 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::SUB, startPos };
144 else if( curCh ==
'+' || curCh ==
'-' || wxIsdigit( curCh ) )
146 wxString digitString = curCh;
147 while( wxIsdigit( nextCh ) )
149 digitString += nextCh;
154 digitString.ToLong( &value );
156 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_INT, startPos, value };
161 wxString identString = curCh;
162 while( wxIsalnum( nextCh ) )
164 identString += nextCh;
168 if( identString.IsSameAs( wxT(
"True" ),
false ) )
170 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_TRUE, startPos };
172 else if( identString.IsSameAs( wxT(
"False" ),
false ) )
174 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::CONST_FALSE, startPos };
176 else if( identString.IsSameAs( wxT(
"Div" ),
false ) )
178 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::INTEGRAL_DIV, startPos };
180 else if( identString.IsSameAs( wxT(
"Mod" ),
false ) )
182 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::MOD, startPos };
184 else if( identString.IsSameAs( wxT(
"And" ),
false ) )
186 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::AND, startPos };
188 else if( identString.IsSameAs( wxT(
"Or" ),
false ) )
190 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::OR, startPos };
192 else if( identString.IsSameAs( wxT(
"Xor" ),
false ) )
194 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::XOR, startPos };
196 else if( identString.IsSameAs( wxT(
"Not" ),
false ) )
198 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::NOT, startPos };
200 else if( identString.IsSameAs( wxT(
"Between" ),
false ) )
202 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::BETWEEN, startPos };
204 else if( identString.IsSameAs( wxT(
"Like" ),
false ) )
206 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::LIKE, startPos };
210 m_nextToken = { ALTIUM_RULE_TOKEN_KIND::IDENT, startPos, identString };
const ALTIUM_RULE_TOKEN & Peek() const
ALTIUM_RULE_TOKEN m_currentToken
const ALTIUM_RULE_TOKEN & Next()
ALTIUM_RULE_TOKEN m_nextToken
wxString::const_iterator m_it