Parsing tools

Functions

KvParseHandlekvaToolsParseCreate (void)
 
void kvaToolsParseDestroy (KvParseHandle *h)
 
void kvaToolsExprGetErrorString (int errCode, char *s, size_t bufsiz)
 
int kvaToolsParseExpr (KvParseHandle *h, char *expr, Token **t)
 
int kvaToolsFreeExpr (KvParseHandle *h, Token *t)
 
int kvaToolsDumpExpr (KvParseHandle *h, Token *t)
 
int kvaToolsExprHasErrors (KvParseHandle *h, Token *t)
 
int kvaToolsExprGetError (KvParseHandle *h, Token *t, int *errCode, int *pos)
 

Detailed Description

Function Documentation

◆ kvaToolsDumpExpr()

int kvaToolsDumpExpr ( KvParseHandle h,
Token t 
)

Dump Token tree contents if debug is enabled, otherwise do nothing (deprecated).

Parameters
[in]hKvParseHandle to parser.
[in]tPointer to Token t.
Returns
0.

◆ kvaToolsExprGetError()

int kvaToolsExprGetError ( KvParseHandle h,
Token t,
int *  errCode,
int *  pos 
)

Returns errorcode of first error found in Token tree (deprecated).

Parameters
[in]hKvParseHandle to parser.
[in]tPointer to Token t.
[out]errCodeError code of first found error token.
[out]posPosition of first found error token.
Returns
TRUE if Token tree contains any error tokens
FALSE if Token tree contains no error tokens

◆ kvaToolsExprGetErrorString()

void kvaToolsExprGetErrorString ( int  errCode,
char *  s,
size_t  bufsiz 
)

Get a human readable description of errors that occur when parsing a postfix expression (deprecated).

Parameters
[in]errCodeError code from parser.
[out]sBuffer to receive error message.
[in]bufsizBuffer size in bytes.

◆ kvaToolsExprHasErrors()

int kvaToolsExprHasErrors ( KvParseHandle h,
Token t 
)

Returns True if Token tree representation of trigger expression has errors (deprecated).

Parameters
[in]hKvParseHandle to parser.
[in]tPointer to Token t.
Returns
TRUE if Token tree contains any error tokens
FALSE if Token tree contains no error tokens

◆ kvaToolsFreeExpr()

int kvaToolsFreeExpr ( KvParseHandle h,
Token t 
)

Do nothing (deprecated).

Parameters
[in]hKvParseHandle to parser.
[in]tPointer to Token t.
Returns
0.

◆ kvaToolsParseCreate()

KvParseHandle* kvaToolsParseCreate ( void  )
C#
KvParseHandle kvaToolsParseCreate(void);

Create a parser, the start of a linked list of Tokens (deprecated).

Returns
KvParseHandle of new parser.

◆ kvaToolsParseDestroy()

void kvaToolsParseDestroy ( KvParseHandle h)

Destroy a parser with handle h and any linked Tokens (deprecated).

Parameters
[in]hKvParseHandle to parser to be destroyed.

◆ kvaToolsParseExpr()

int kvaToolsParseExpr ( KvParseHandle h,
char *  expr,
Token **  t 
)

Parse postifix expression expr and return a Token tree representation (deprecated).

Parameters
[in]hKvParseHandle to parser.
[out]exprString representation of postfix expression.
[in]tPointer to Token tree.
Returns
0.