yumapro
24.10-3
YumaPro SDK
|
YANG Parser functions to consume and resolve data types. More...
Functions | |
status_t | yang_typ_consume_type (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *intypdef) |
Consume a type-stmt. More... | |
status_t | yang_typ_consume_metadata_type (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *intypdef) |
Consume a type-stmt for metadata. More... | |
status_t | yang_typ_consume_typedef (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *que) |
Consume a typedef-stmt. More... | |
status_t | yang_typ_resolve_typedefs (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *typeQ, obj_template_t *parent) |
Resovlve the typeQ of typedefs. More... | |
status_t | yang_typ_resolve_typedefs_final (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *typeQ) |
Resolve typedefs (final pass) More... | |
status_t | yang_typ_resolve_typedefs_grp (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *typeQ, obj_template_t *parent, grp_template_t *grp) |
Resolve typedefs in a grouping (final pass) More... | |
status_t | yang_typ_resolve_type (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *typdef, const xmlChar *defval, obj_template_t *obj) |
Resolve a type-stmt. More... | |
status_t | yang_typ_resolve_type_final (tk_chain_t *tkc, ncx_module_t *mod, typ_def_t *typdef, const xmlChar *name, const xmlChar *defval, obj_template_t *obj) |
Resolve a type-stmt (final pass) More... | |
status_t | yang_typ_rangenum_ok (typ_def_t *typdef, const ncx_num_t *num) |
Check is a range number is OK. More... | |
boolean | yang_typ_enubit_enabled (typ_enum_t *enubit) |
Check if an enum or bit is enabled. More... | |
boolean | yang_typ_identity_enabled (ncx_identity_t *id) |
Check if an identity-stmt is enabled. More... | |
status_t | yang_typ_resolve_leafref (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *testobj) |
Resolve the typdef in a leafref leaf or leaf-list. More... | |
YANG Parser functions to consume and resolve data types.
status_t yang_typ_consume_metadata_type | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
typ_def_t * | intypdef | ||
) |
Consume a type-stmt for metadata.
Parse the next token as a type declaration for an ncx:metadata definition
Error messages are printed by this function!! Do not duplicate error messages upon error return
pcb | parser control block |
tkc | token chain |
mod | module in progress |
intypdef | struct that will get the type info |
status_t yang_typ_consume_type | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
typ_def_t * | intypdef | ||
) |
Consume a type-stmt.
Parse the next N tokens as a type clause Add to the typ_template_t struct in progress
Error messages are printed by this function!! Do not duplicate error messages upon error return
Current token is the 'type' keyword
pcb | parser control block |
tkc | token chain |
mod | module in progress |
intypdef | struct that will get the type info |
status_t yang_typ_consume_typedef | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
dlq_hdr_t * | que | ||
) |
Consume a typedef-stmt.
Parse the next N tokens as a typedef clause Create a typ_template_t struct and add it to the specified module
Error messages are printed by this function!! Do not duplicate error messages upon error return
Current token is the 'typedef' keyword
pcb | parser control block |
tkc | token chain |
mod | module in progress |
que | queue will get the typ_template_t |
boolean yang_typ_enubit_enabled | ( | typ_enum_t * | enubit | ) |
Check if an enum or bit is enabled.
Check an enum or bits typdef for if-feature-stmts Evaluate and determine if the enum or bit is enabled
enubit | enum or bit from the typdef to check |
boolean yang_typ_identity_enabled | ( | ncx_identity_t * | id | ) |
Check if an identity-stmt is enabled.
Check an identity-stmt for if-feature-stmts Evaluate and determine if the identity is enabled
id | identity from the tpedef to check |
Check is a range number is OK.
Check a typdef for range definitions and check if the specified number passes all the range checks (if any)
typdef | typdef to check |
num | number to check |
status_t yang_typ_resolve_leafref | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
obj_template_t * | testobj | ||
) |
Resolve the typdef in a leafref leaf or leaf-list.
pcb | parser control block |
tkc | token chain |
mod | [sub]module in progress within the tree walking |
testobj | object to check |
status_t yang_typ_resolve_type | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
typ_def_t * | typdef, | ||
const xmlChar * | defval, | ||
obj_template_t * | obj | ||
) |
Resolve a type-stmt.
Analyze the typdef within a single leaf or leaf-list statement Finish if a named type, and/or range clauses present, which were left unfinished due to possible forward references
Algorithm for checking named types in 4 separate loops: 1) resolve all open type name references 2) check for any name loops in all named types 3) check that all base types and builtin types in each type chain are correct. Also check that all restrictions given are correct for that type 4) Check all range clauses and resolve all min/max keyword uses to decimal numbers and validate that each range is well-formed.
Error messages are printed by this function!! Do not duplicate error messages upon error return
pcb | parser control block |
tkc | token chain from parsing (needed for error msgs) |
mod | module in progress |
typdef | typdef struct from leaf or leaf-list to check |
defval | default value string for this leaf (may be NULL) |
obj | obj_template containing this typdef NULL if this is a top-level union typedef, checking its nested unnamed type clauses |
status_t yang_typ_resolve_type_final | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
typ_def_t * | typdef, | ||
const xmlChar * | name, | ||
const xmlChar * | defval, | ||
obj_template_t * | obj | ||
) |
Resolve a type-stmt (final pass)
Check default values for XPath types
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain from parsing (needed for error msgs) |
mod | module in progress |
typdef | typdef struct from leaf or leaf-list to check |
name | type name id any |
defval | default value string for this leaf (may be NULL) |
obj | obj_template containing this typdef NULL if this is a top-level union typedef, checking its nested unnamed type clauses |
status_t yang_typ_resolve_typedefs | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
dlq_hdr_t * | typeQ, | ||
obj_template_t * | parent | ||
) |
Resovlve the typeQ of typedefs.
Analyze the entire typeQ within the module struct Finish all the named types and range clauses, which were left unfinished due to possible forward references
Check all the types in the Q If a type has validation errors, it will be removed from the typeQ
Algorithm for checking named types in 4 separate loops: 1) resolve all open type name references 2) check for any name loops in all named types 3) check that all base types and builtin types in each type chain are correct. Also check that all restrictions given are correct for that type 4) Check all range clauses and resolve all min/max keyword uses to decimal numbers and validate that each range is well-formed.
Error messages are printed by this function!! Do not duplicate error messages upon error return
pcb | parser control block |
tkc | token chain |
mod | module in progress |
typeQ | queue of typ_template_t to check |
parent | obj_template containing this typeQ NULL if this is a module-level typeQ |
status_t yang_typ_resolve_typedefs_final | ( | tk_chain_t * | tkc, |
ncx_module_t * | mod, | ||
dlq_hdr_t * | typeQ | ||
) |
Resolve typedefs (final pass)
Analyze the entire typeQ within the module struct Finish all default value checking that was not done before
Error messages are printed by this function!! Do not duplicate error messages upon error return
tkc | token chain |
mod | module in progress |
typeQ | queue of typ_template_t to check |
status_t yang_typ_resolve_typedefs_grp | ( | yang_pcb_t * | pcb, |
tk_chain_t * | tkc, | ||
ncx_module_t * | mod, | ||
dlq_hdr_t * | typeQ, | ||
obj_template_t * | parent, | ||
grp_template_t * | grp | ||
) |
Resolve typedefs in a grouping (final pass)
Analyze the entire typeQ within the module struct Finish all the named types and range clauses, which were left unfinished due to possible forward references
Check all the types in the Q If a type has validation errors, it will be removed from the typeQ
Algorithm for checking named types in 4 separate loops: 1) resolve all open type name references 2) check for any name loops in all named types 3) check that all base types and builtin types in each type chain are correct. Also check that all restrictions given are correct for that type 4) Check all range clauses and resolve all min/max keyword uses to decimal numbers and validate that each range is well-formed.
Error messages are printed by this function!! Do not duplicate error messages upon error return
pcb | parser control block |
tkc | token chain |
mod | module in progress |
typeQ | queue of typ_template_t to check |
parent | obj_template containing this typeQ NULL if this is a module-level typeQ |
grp | grp_template containing this typedef |