DuroDBMS API  1.2
Functions
Parsing functions

Functions

RDB_expression * RDB_parse_node_expr (RDB_parse_node *nodep, RDB_exec_context *ecp, RDB_transaction *txp)
 
RDB_parse_node * RDB_parse_expr (const char *txt, RDB_exec_context *ecp)
 
void RDB_parse_set_read_line_fn (RDB_read_line_fn *fnp)
 
void RDB_parse_set_free_line_fn (RDB_free_line_fn *fnp)
 
int RDB_parse_del_node (RDB_parse_node *nodep, RDB_exec_context *ecp)
 

Detailed Description

#include <dli/parse.h>

Function Documentation

int RDB_parse_del_node ( RDB_parse_node *  nodep,
RDB_exec_context *  ecp 
)

Destroy the parse node *nodep and free its memory, including all children. The expression returned from RDB_parse_node_expr() will also be destroyed.

References RDB_del_expr(), and RDB_free().

RDB_parse_node* RDB_parse_expr ( const char *  txt,
RDB_exec_context *  ecp 
)

Parse the expression specified by txt.

Returns
A pointer to the RDB_parse_node representing the expression, or NULL if the parsing failed.
Errors:
SYNTAX_ERROR
A syntax error occurred during parsing.

The call may also fail for a system error.

Warning
The parser is not reentrant.

References RDB_destroy_obj(), RDB_get_err(), RDB_init_obj(), RDB_obj_string(), RDB_raise_internal(), RDB_raise_system(), and RDB_string_to_obj().

RDB_expression* RDB_parse_node_expr ( RDB_parse_node *  nodep,
RDB_exec_context *  ecp,
RDB_transaction *  txp 
)

Convert a parse tree to an expression. The expression is managed by the parse node. Calling RDB_parse_del_node() will destroy the expression.

Returns
the expression, or NULL if the parse tree could not be converted. (But see the warning below)
Warning
Passing a parse node that is not a syntactically valid expression may lead to undefined behavior.

References RDB_raise_syntax().

void RDB_parse_set_free_line_fn ( RDB_free_line_fn *  fnp)

Provide a function that will be used to free a line of input read by the function passed to RDB_parse_set_read_line_fn().

void RDB_parse_set_read_line_fn ( RDB_read_line_fn *  fnp)

Provide a function that will be used to read the next line in interactive mode.