More XPath function support

* `count`, `name`, `contains`, `not`, as defined in [xpath 1.0](https://www.w3.org/TR/xpath-10)
  * `deref`, `derived-from` and `derived-from-or-self` from RFC7950 Section 10.
    * in particular in augment/when statements
  * Improved error handling
    * Verification of XPath functions is done at startup when yang modules are loaded, not when XPaths are evaluated.
    * Separation of "not found" and "not implemented" XPath functions
    * Both give a fatal error (backend does not start).
This commit is contained in:
Olof hagsand 2020-09-23 15:35:01 +02:00
parent 2994d2f9a9
commit 21ac47915b
14 changed files with 715 additions and 132 deletions

View file

@ -87,6 +87,7 @@ enum xp_type{
XP_ADD,
XP_UNION,
XP_PATHEXPR,
XP_FILTEREXPR,
XP_LOCPATH,
XP_ABSPATH,
XP_RELLOCPATH,
@ -114,7 +115,7 @@ struct xpath_tree{
char *xs_s1; /* set if XP_NODE NAME */
struct xpath_tree *xs_c0; /* child 0 */
struct xpath_tree *xs_c1; /* child 1 */
int xs_match; /* meta: match this node */
int xs_match; /* meta: match this node */
};
typedef struct xpath_tree xpath_tree;