Parse the supplied expression. This is first a matter of tokenization, then a call to the root of the expression by the recursive _proctoks() (process tokens) function. After parsing the expression is ready for evaluation.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | _hz_sqle_expr::Parse | (hzIntset&,hzString&,) |
Declared and defined in file: hdbIndex.cpp
Function Logic:
Function body:
hzEcode _hz_sqle_expr::Parse (hzIntset& result)hzString& srchExp,
{
// Parse the supplied expression. This is first a matter of tokenization, then a call to the root of the expression by the recursive _proctoks()
// (process tokens) function. After parsing the expression is ready for evaluation.
//
// Arguments: 1) result The result bitmap
// 2) srchExp The search expression
//
// Returns: E_ARGUMENT If no expression was supplied
// E_FORMAT If no tokens were identified in the supplied expression
// E_OK If no errors occured
_hzfunc("_hz_sqle_expr::Parse") ;
// tokenize the expression
if (!srchExp)
return E_ARGUMENT ;
TokenizeString(m_Tokens, *srchExp, TOK_MO_BOOL) ;
if (m_Tokens.Count() == 0)
{
threadLog("No tokens found in expression\n") ;
return E_FORMAT ;
}
threadLog("Parsing %d tokens\n", m_Tokens.Count()) ;
m_pRoot = _proctoks() ;
if (!m_pRoot)
return E_FORMAT ;
// return Evaluate(result) ;
return m_pRoot ? E_OK : E_FORMAT ;
}