diff --git a/CHANGELOG.md b/CHANGELOG.md index 00c31beb..b123b59d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,9 @@ Developers may need to change their code ### Minor changes +* Debug messages + * Added cli command debug printf on debug level 1 + * Moved all parse debug printfs to level 3 * Added `-r` command-line option to restconf daemon to NOT lower privileges to wwwuser if started from root. * Changed CLI help strings behaviour on query (?) for long and multi-line help strings. * If multiple strings (eg "\n" in text), indent before each new line diff --git a/apps/cli/cli_plugin.c b/apps/cli/cli_plugin.c index 0870926f..3584ca37 100644 --- a/apps/cli/cli_plugin.c +++ b/apps/cli/cli_plugin.c @@ -584,6 +584,8 @@ clicon_parse(clicon_handle h, } if (cliread_parse(cli_cligen(h), cmd, pt, &match_obj, cvv, result, &reason) < 0) goto done; + /* Debug command and result code */ + clicon_debug(1, "%s result:%d command: \"%s\"", __FUNCTION__, *result, cmd); if (*result != CG_MATCH) pt_expand_cleanup(pt); /* XXX change to pt_expand_treeref_cleanup */ if (modename0){ diff --git a/lib/src/clixon_api_path_parse.y b/lib/src/clixon_api_path_parse.y index 8b03c6c6..1f864f95 100644 --- a/lib/src/clixon_api_path_parse.y +++ b/lib/src/clixon_api_path_parse.y @@ -148,7 +148,7 @@ static clixon_path * path_append(clixon_path *list, clixon_path *new) { - clicon_debug(1, "%s()", __FUNCTION__); + clicon_debug(3, "%s()", __FUNCTION__); if (new == NULL) return NULL; ADDQ(new, list); @@ -161,7 +161,7 @@ static clixon_path * path_add_keyvalue(clixon_path *cp, cvec *cvk) { - clicon_debug(1, "%s()", __FUNCTION__); + clicon_debug(3, "%s()", __FUNCTION__); if (cp) cp->cp_cvk = cvk; return cp; @@ -173,7 +173,7 @@ path_new(char *module_name, { clixon_path *cp = NULL; - clicon_debug(1, "%s(%s,%s)", __FUNCTION__, module_name, id); + clicon_debug(3, "%s(%s,%s)", __FUNCTION__, module_name, id); if ((cp = malloc(sizeof(*cp))) == NULL){ clicon_err(OE_UNIX, errno, "malloc"); goto done; @@ -203,7 +203,7 @@ static cvec * keyval_add(cvec *cvv, cg_var *cv) { - clicon_debug(1, "%s()", __FUNCTION__); + clicon_debug(3, "%s()", __FUNCTION__); if (cv == NULL) goto done; if (cvv == NULL && @@ -229,7 +229,7 @@ keyval_set(char *name, { cg_var *cv = NULL; - clicon_debug(1, "%s(%s=%s)", __FUNCTION__, name?name:"NULL", val); + clicon_debug(3, "%s(%s=%s)", __FUNCTION__, name?name:"NULL", val); if ((cv = cv_new(CGV_STRING)) == NULL){ clicon_err(OE_UNIX, errno, "cv_new"); goto done; diff --git a/lib/src/clixon_instance_id_parse.y b/lib/src/clixon_instance_id_parse.y index 593c9cfa..3373b410 100644 --- a/lib/src/clixon_instance_id_parse.y +++ b/lib/src/clixon_instance_id_parse.y @@ -160,7 +160,7 @@ static clixon_path * path_append(clixon_path *list, clixon_path *new) { - clicon_debug(1, "%s()", __FUNCTION__); + clicon_debug(2, "%s()", __FUNCTION__); if (new == NULL) return NULL; ADDQ(new, list); @@ -175,7 +175,7 @@ static clixon_path * path_add_keyvalue(clixon_path *cp, cvec *cvk) { - clicon_debug(1, "%s()", __FUNCTION__); + clicon_debug(2, "%s()", __FUNCTION__); if (cp == NULL) goto done; cp->cp_cvk = cvk; @@ -189,7 +189,7 @@ path_new(char *prefix, { clixon_path *cp = NULL; - clicon_debug(1, "%s(%s,%s)", __FUNCTION__, prefix, id); + clicon_debug(2, "%s(%s,%s)", __FUNCTION__, prefix, id); if ((cp = malloc(sizeof(*cp))) == NULL){ clicon_err(OE_UNIX, errno, "malloc"); goto done; @@ -219,7 +219,7 @@ keyval_pos(char *uint) char *reason=NULL; int ret; - clicon_debug(1, "%s(%s)", __FUNCTION__, uint); + clicon_debug(2, "%s(%s)", __FUNCTION__, uint); if ((cvv = cvec_new(1)) == NULL) { clicon_err(OE_UNIX, errno, "cvec_new"); goto done; @@ -252,7 +252,7 @@ static cvec * keyval_add(cvec *cvv, cg_var *cv) { - clicon_debug(1, "%s()", __FUNCTION__); + clicon_debug(2, "%s()", __FUNCTION__); if (cv == NULL) goto done; if (cvv == NULL && @@ -278,7 +278,7 @@ keyval_set(char *name, { cg_var *cv = NULL; - clicon_debug(1, "%s(%s=%s)", __FUNCTION__, name, val); + clicon_debug(2, "%s(%s=%s)", __FUNCTION__, name, val); if ((cv = cv_new(CGV_STRING)) == NULL){ clicon_err(OE_UNIX, errno, "cv_new"); goto done; @@ -307,74 +307,74 @@ keyval_set(char *name, /* */ -start : list X_EOF { clicon_debug(2,"top"); _IY->iy_top=$1; YYACCEPT; } +start : list X_EOF { clicon_debug(3,"top"); _IY->iy_top=$1; YYACCEPT; } ; list : list SLASH element { if (($$ = path_append($1, $3)) == NULL) YYABORT; - clicon_debug(2,"list = list / element");} + clicon_debug(3,"list = list / element");} | SLASH element { if (($$ = path_append(NULL, $2)) == NULL) YYABORT; - clicon_debug(2,"list = / element");} + clicon_debug(3,"list = / element");} ; element : node_id element2 { $$ = path_add_keyvalue($1, $2); - clicon_debug(2,"element = node_id element2");} + clicon_debug(3,"element = node_id element2");} ; node_id : IDENTIFIER { $$ = path_new(NULL, $1); free($1); - clicon_debug(2,"node_id = IDENTIFIER");} + clicon_debug(3,"node_id = IDENTIFIER");} | prefix COLON IDENTIFIER { $$ = path_new($1, $3); free($1); free($3); - clicon_debug(2,"node_id = prefix : IDENTIFIER");} + clicon_debug(3,"node_id = prefix : IDENTIFIER");} ; -prefix : IDENTIFIER { $$=$1; clicon_debug(2,"prefix = IDENTIFIER");} +prefix : IDENTIFIER { $$=$1; clicon_debug(3,"prefix = IDENTIFIER");} -element2 : key_preds { $$=$1; clicon_debug(2,"element2 = key_preds"); } - | leaf_list_pred { $$=$1; clicon_debug(2,"element2 = leaf_list_pred"); } - | pos { $$=$1; clicon_debug(2,"element2 = key_preds"); } - | { $$=NULL; clicon_debug(2,"element2 = "); } +element2 : key_preds { $$=$1; clicon_debug(3,"element2 = key_preds"); } + | leaf_list_pred { $$=$1; clicon_debug(3,"element2 = leaf_list_pred"); } + | pos { $$=$1; clicon_debug(3,"element2 = key_preds"); } + | { $$=NULL; clicon_debug(3,"element2 = "); } ; leaf_list_pred : LSQBR leaf_list_pred_expr RSQBR { if (($$ = keyval_add(NULL, $2)) == NULL) YYABORT; - clicon_debug(2,"leaf_list_pred = [ leaf_list_pred_expr ]"); } + clicon_debug(3,"leaf_list_pred = [ leaf_list_pred_expr ]"); } ; leaf_list_pred_expr : DOT EQUAL qstring { $$ = keyval_set(".", $3); free($3); - clicon_debug(2,"leaf_list_pred_expr = '.=' qstring"); } + clicon_debug(3,"leaf_list_pred_expr = '.=' qstring"); } ; pos : LSQBR UINT RSQBR { $$ = keyval_pos($2); free($2); - clicon_debug(2,"pos = [ UINT ]"); } + clicon_debug(3,"pos = [ UINT ]"); } ; key_preds : key_preds key_pred { if (($$ = keyval_add($1, $2)) == NULL) YYABORT; - clicon_debug(2,"key_preds = key_pred key_preds"); } + clicon_debug(3,"key_preds = key_pred key_preds"); } | key_pred { if (($$ = keyval_add(NULL, $1)) == NULL) YYABORT; - clicon_debug(2,"key_preds = key_pred");} + clicon_debug(3,"key_preds = key_pred");} ; key_pred : LSQBR key_pred_expr RSQBR { $$ = $2; - clicon_debug(2,"key_pred = [ key_pred_expr ]"); } + clicon_debug(3,"key_pred = [ key_pred_expr ]"); } ; key_pred_expr : node_id_k EQUAL qstring { $$ = keyval_set($1, $3); free($1); free($3); - clicon_debug(2,"key_pred_expr = node_id_k = qstring"); } + clicon_debug(3,"key_pred_expr = node_id_k = qstring"); } ; node_id_k : IDENTIFIER { $$ = $1; - clicon_debug(2,"node_id_k = IDENTIFIER %s", $1); } + clicon_debug(3,"node_id_k = IDENTIFIER %s", $1); } | prefix COLON IDENTIFIER { $$ = $3; /* ignore prefix in key? */ - clicon_debug(2,"node_id_k = prefix %s : IDENTIFIER %s", $1, $3); free($1);} + clicon_debug(3,"node_id_k = prefix %s : IDENTIFIER %s", $1, $3); free($1);} ; qstring : DQUOTE STRING DQUOTE { $$=$2; - clicon_debug(2,"qstring = \" string \""); } + clicon_debug(3,"qstring = \" string \""); } | DQUOTE DQUOTE { $$=strdup(""); - clicon_debug(2,"qstring = \" \""); } + clicon_debug(3,"qstring = \" \""); } | SQUOTE STRING SQUOTE { $$=$2; - clicon_debug(2,"qstring = ' string '"); } + clicon_debug(3,"qstring = ' string '"); } | SQUOTE SQUOTE { $$=strdup(""); - clicon_debug(2,"qstring = ''"); } + clicon_debug(3,"qstring = ''"); } ; %% diff --git a/lib/src/clixon_json_parse.y b/lib/src/clixon_json_parse.y index 2c7f2e72..13a30b6e 100644 --- a/lib/src/clixon_json_parse.y +++ b/lib/src/clixon_json_parse.y @@ -250,7 +250,7 @@ json_current_body(clixon_json_yacc *jy, */ /* top: json -> value is also possible */ -json : value J_EOF { clicon_debug(2,"json->object"); YYACCEPT; } +json : value J_EOF { clicon_debug(3,"json->object"); YYACCEPT; } ; value : J_TRUE { json_current_body(_JY, "true");} @@ -263,16 +263,16 @@ value : J_TRUE { json_current_body(_JY, "true");} ; -object : '{' '}' { clicon_debug(2,"object->{}");} - | '{' objlist '}' { clicon_debug(2,"object->{ objlist }");} +object : '{' '}' { clicon_debug(3,"object->{}");} + | '{' objlist '}' { clicon_debug(3,"object->{ objlist }");} ; -objlist : pair { clicon_debug(2,"objlist->pair");} - | objlist ',' pair { clicon_debug(2,"objlist->objlist , pair");} +objlist : pair { clicon_debug(3,"objlist->pair");} + | objlist ',' pair { clicon_debug(3,"objlist->objlist , pair");} ; pair : string { json_current_new(_JY, $1);free($1);} ':' - value { json_current_pop(_JY);}{ clicon_debug(2,"pair->string : value");} + value { json_current_pop(_JY);}{ clicon_debug(3,"pair->string : value");} ; array : '[' ']' @@ -284,8 +284,8 @@ valuelist : value ; /* quoted string */ -string : J_DQ ustring J_DQ { clicon_debug(2,"string->\" ustring \"");$$=$2; } - | J_DQ J_DQ { clicon_debug(2,"string->\" ustring \"");$$=strdup(""); } +string : J_DQ ustring J_DQ { clicon_debug(3,"string->\" ustring \"");$$=$2; } + | J_DQ J_DQ { clicon_debug(3,"string->\" ustring \"");$$=strdup(""); } ; /* unquoted string */ diff --git a/lib/src/clixon_xml_io.c b/lib/src/clixon_xml_io.c index f84cc98e..07260727 100644 --- a/lib/src/clixon_xml_io.c +++ b/lib/src/clixon_xml_io.c @@ -459,7 +459,7 @@ _xml_parse(const char *str, int failed = 0; /* yang assignment */ int i; - clicon_debug(1, "%s", __FUNCTION__); + clicon_debug(2, "%s", __FUNCTION__); if (strlen(str) == 0) return 0; /* OK */ if (xt == NULL){ diff --git a/lib/src/clixon_xml_parse.y b/lib/src/clixon_xml_parse.y index c5669036..4db9946f 100644 --- a/lib/src/clixon_xml_parse.y +++ b/lib/src/clixon_xml_parse.y @@ -85,7 +85,7 @@ /* Enable for debugging, steals some cycles otherwise */ #if 0 -#define _PARSE_DEBUG(s) clicon_debug(2,(s)) +#define _PARSE_DEBUG(s) clicon_debug(3,(s)) #else #define _PARSE_DEBUG(s) #endif diff --git a/lib/src/clixon_xml_sort.c b/lib/src/clixon_xml_sort.c index c3182e82..1680fc1d 100644 --- a/lib/src/clixon_xml_sort.c +++ b/lib/src/clixon_xml_sort.c @@ -383,7 +383,7 @@ xml_cmp(cxobj *x1, break; } /* switch */ done: - clicon_debug(2, "%s %s %s eq:%d nr: %d %d yi: %d %d", __FUNCTION__, xml_name(x1), xml_name(x2), equal, nr1, nr2, yi1, yi2); + clicon_debug(3, "%s %s %s eq:%d nr: %d %d yi: %d %d", __FUNCTION__, xml_name(x1), xml_name(x2), equal, nr1, nr2, yi1, yi2); return equal; } diff --git a/lib/src/clixon_xpath_parse.y b/lib/src/clixon_xpath_parse.y index 9f573873..2ea8a393 100644 --- a/lib/src/clixon_xpath_parse.y +++ b/lib/src/clixon_xpath_parse.y @@ -146,7 +146,7 @@ clixon_xpath_parseerror(void *_xpy, int xpath_parse_init(clixon_xpath_yacc *xpy) { - // clicon_debug_init(2, NULL); + // clicon_debug_init(3, NULL); return 0; } @@ -198,87 +198,87 @@ xp_new(enum xp_type type, /* */ -start : expr X_EOF { _XPY->xpy_top=$1;clicon_debug(2,"start->expr"); YYACCEPT; } - | locationpath X_EOF { _XPY->xpy_top=$1;clicon_debug(2,"start->locationpath"); YYACCEPT; } +start : expr X_EOF { _XPY->xpy_top=$1;clicon_debug(3,"start->expr"); YYACCEPT; } + | locationpath X_EOF { _XPY->xpy_top=$1;clicon_debug(3,"start->locationpath"); YYACCEPT; } ; -expr : expr LOGOP andexpr { $$=xp_new(XP_EXP,$2,NULL,NULL,NULL,$1, $3);clicon_debug(2,"expr->expr or andexpr"); } - | andexpr { $$=xp_new(XP_EXP,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(2,"expr-> andexpr"); } +expr : expr LOGOP andexpr { $$=xp_new(XP_EXP,$2,NULL,NULL,NULL,$1, $3);clicon_debug(3,"expr->expr or andexpr"); } + | andexpr { $$=xp_new(XP_EXP,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"expr-> andexpr"); } ; -andexpr : andexpr LOGOP relexpr { $$=xp_new(XP_AND,$2,NULL,NULL,NULL,$1, $3);clicon_debug(2,"andexpr-> andexpr and relexpr"); } - | relexpr { $$=xp_new(XP_AND,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(2,"andexpr-> relexpr"); } +andexpr : andexpr LOGOP relexpr { $$=xp_new(XP_AND,$2,NULL,NULL,NULL,$1, $3);clicon_debug(3,"andexpr-> andexpr and relexpr"); } + | relexpr { $$=xp_new(XP_AND,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"andexpr-> relexpr"); } ; -relexpr : relexpr RELOP addexpr { $$=xp_new(XP_RELEX,$2,NULL,NULL,NULL,$1, $3);clicon_debug(2,"relexpr-> relexpr relop addexpr"); } - | addexpr { $$=xp_new(XP_RELEX,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(2,"relexpr-> addexpr"); } +relexpr : relexpr RELOP addexpr { $$=xp_new(XP_RELEX,$2,NULL,NULL,NULL,$1, $3);clicon_debug(3,"relexpr-> relexpr relop addexpr"); } + | addexpr { $$=xp_new(XP_RELEX,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"relexpr-> addexpr"); } ; -addexpr : addexpr ADDOP unionexpr { $$=xp_new(XP_ADD,$2,NULL,NULL,NULL,$1, $3);clicon_debug(2,"addexpr-> addexpr ADDOP unionexpr"); } - | unionexpr { $$=xp_new(XP_ADD,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(2,"addexpr-> unionexpr"); } +addexpr : addexpr ADDOP unionexpr { $$=xp_new(XP_ADD,$2,NULL,NULL,NULL,$1, $3);clicon_debug(3,"addexpr-> addexpr ADDOP unionexpr"); } + | unionexpr { $$=xp_new(XP_ADD,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"addexpr-> unionexpr"); } ; /* node-set */ -unionexpr : unionexpr '|' pathexpr { $$=xp_new(XP_UNION,A_NAN,NULL,NULL,NULL,$1, $3);clicon_debug(2,"unionexpr-> unionexpr | pathexpr"); } - | pathexpr { $$=xp_new(XP_UNION,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(2,"unionexpr-> pathexpr"); } +unionexpr : unionexpr '|' pathexpr { $$=xp_new(XP_UNION,A_NAN,NULL,NULL,NULL,$1, $3);clicon_debug(3,"unionexpr-> unionexpr | pathexpr"); } + | pathexpr { $$=xp_new(XP_UNION,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"unionexpr-> pathexpr"); } ; -pathexpr : locationpath { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(2,"pathexpr-> locationpath"); } - | primaryexpr { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(2,"pathexpr-> primaryexpr"); } +pathexpr : locationpath { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"pathexpr-> locationpath"); } + | primaryexpr { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"pathexpr-> primaryexpr"); } ; /* location path returns a node-set */ -locationpath : rellocpath { $$=xp_new(XP_LOCPATH,A_NAN,NULL,NULL,NULL,$1, NULL); clicon_debug(2,"locationpath-> rellocpath"); } - | abslocpath { $$=xp_new(XP_LOCPATH,A_NAN,NULL,NULL,NULL,$1, NULL); clicon_debug(2,"locationpath-> abslocpath"); } +locationpath : rellocpath { $$=xp_new(XP_LOCPATH,A_NAN,NULL,NULL,NULL,$1, NULL); clicon_debug(3,"locationpath-> rellocpath"); } + | abslocpath { $$=xp_new(XP_LOCPATH,A_NAN,NULL,NULL,NULL,$1, NULL); clicon_debug(3,"locationpath-> abslocpath"); } ; -abslocpath : '/' { $$=xp_new(XP_ABSPATH,A_ROOT,NULL,NULL,NULL,NULL, NULL);clicon_debug(2,"abslocpath-> /"); } - | '/' rellocpath { $$=xp_new(XP_ABSPATH,A_ROOT,NULL,NULL,NULL,$2, NULL);clicon_debug(2,"abslocpath->/ rellocpath");} +abslocpath : '/' { $$=xp_new(XP_ABSPATH,A_ROOT,NULL,NULL,NULL,NULL, NULL);clicon_debug(3,"abslocpath-> /"); } + | '/' rellocpath { $$=xp_new(XP_ABSPATH,A_ROOT,NULL,NULL,NULL,$2, NULL);clicon_debug(3,"abslocpath->/ rellocpath");} /* // is short for /descendant-or-self::node()/ */ - | DOUBLESLASH rellocpath {$$=xp_new(XP_ABSPATH,A_DESCENDANT_OR_SELF,NULL,NULL,NULL,$2, NULL); clicon_debug(2,"abslocpath-> // rellocpath"); } + | DOUBLESLASH rellocpath {$$=xp_new(XP_ABSPATH,A_DESCENDANT_OR_SELF,NULL,NULL,NULL,$2, NULL); clicon_debug(3,"abslocpath-> // rellocpath"); } ; -rellocpath : step { $$=xp_new(XP_RELLOCPATH,A_NAN,NULL,NULL,NULL,$1, NULL); clicon_debug(2,"rellocpath-> step"); } - | rellocpath '/' step { $$=xp_new(XP_RELLOCPATH,A_NAN,NULL,NULL,NULL,$1, $3);clicon_debug(2,"rellocpath-> rellocpath / step"); } - | rellocpath DOUBLESLASH step { $$=xp_new(XP_RELLOCPATH,A_DESCENDANT_OR_SELF,NULL,NULL,NULL,$1, $3); clicon_debug(2,"rellocpath-> rellocpath // step"); } +rellocpath : step { $$=xp_new(XP_RELLOCPATH,A_NAN,NULL,NULL,NULL,$1, NULL); clicon_debug(3,"rellocpath-> step"); } + | rellocpath '/' step { $$=xp_new(XP_RELLOCPATH,A_NAN,NULL,NULL,NULL,$1, $3);clicon_debug(3,"rellocpath-> rellocpath / step"); } + | rellocpath DOUBLESLASH step { $$=xp_new(XP_RELLOCPATH,A_DESCENDANT_OR_SELF,NULL,NULL,NULL,$1, $3); clicon_debug(3,"rellocpath-> rellocpath // step"); } ; -step : axisspec nodetest predicates {$$=xp_new(XP_STEP,$1,NULL, NULL, NULL, $2, $3);clicon_debug(2,"step->axisspec(%d) nodetest", $1); } - | '.' predicates { $$=xp_new(XP_STEP,A_SELF, NULL,NULL, NULL, NULL, $2); clicon_debug(2,"step-> ."); } - | DOUBLEDOT predicates { $$=xp_new(XP_STEP, A_PARENT, NULL,NULL, NULL, NULL, $2); clicon_debug(2,"step-> .."); } +step : axisspec nodetest predicates {$$=xp_new(XP_STEP,$1,NULL, NULL, NULL, $2, $3);clicon_debug(3,"step->axisspec(%d) nodetest", $1); } + | '.' predicates { $$=xp_new(XP_STEP,A_SELF, NULL,NULL, NULL, NULL, $2); clicon_debug(3,"step-> ."); } + | DOUBLEDOT predicates { $$=xp_new(XP_STEP, A_PARENT, NULL,NULL, NULL, NULL, $2); clicon_debug(3,"step-> .."); } ; -axisspec : AXISNAME { clicon_debug(2,"axisspec-> AXISNAME(%d) ::", $1); $$=$1;} - | '@' { $$=A_ATTRIBUTE; clicon_debug(2,"axisspec-> @"); } - | { clicon_debug(2,"axisspec-> "); $$=A_CHILD;} +axisspec : AXISNAME { clicon_debug(3,"axisspec-> AXISNAME(%d) ::", $1); $$=$1;} + | '@' { $$=A_ATTRIBUTE; clicon_debug(3,"axisspec-> @"); } + | { clicon_debug(3,"axisspec-> "); $$=A_CHILD;} ; -nodetest : '*' { $$=xp_new(XP_NODE,A_NAN,NULL, NULL, NULL, NULL, NULL); clicon_debug(2,"nodetest-> *"); } - | NAME { $$=xp_new(XP_NODE,A_NAN,NULL, NULL, $1, NULL, NULL); clicon_debug(2,"nodetest-> name(%s)",$1); } - | NAME ':' NAME { $$=xp_new(XP_NODE,A_NAN,NULL, $1, $3, NULL, NULL);clicon_debug(2,"nodetest-> name(%s) : name(%s)", $1, $3); } - | NAME ':' '*' { $$=xp_new(XP_NODE,A_NAN,NULL, $1, NULL, NULL, NULL);clicon_debug(2,"nodetest-> name(%s) : *", $1); } - | NODETYPE '(' ')' { $$=xp_new(XP_NODE_FN,A_NAN,NULL, $1, NULL, NULL, NULL); clicon_debug(1,"nodetest-> nodetype():%s", $1); } +nodetest : '*' { $$=xp_new(XP_NODE,A_NAN,NULL, NULL, NULL, NULL, NULL); clicon_debug(3,"nodetest-> *"); } + | NAME { $$=xp_new(XP_NODE,A_NAN,NULL, NULL, $1, NULL, NULL); clicon_debug(3,"nodetest-> name(%s)",$1); } + | NAME ':' NAME { $$=xp_new(XP_NODE,A_NAN,NULL, $1, $3, NULL, NULL);clicon_debug(3,"nodetest-> name(%s) : name(%s)", $1, $3); } + | NAME ':' '*' { $$=xp_new(XP_NODE,A_NAN,NULL, $1, NULL, NULL, NULL);clicon_debug(3,"nodetest-> name(%s) : *", $1); } + | NODETYPE '(' ')' { $$=xp_new(XP_NODE_FN,A_NAN,NULL, $1, NULL, NULL, NULL); clicon_debug(3,"nodetest-> nodetype():%s", $1); } ; /* evaluates to boolean */ -predicates : predicates '[' expr ']' { $$=xp_new(XP_PRED,A_NAN,NULL, NULL, NULL, $1, $3); clicon_debug(2,"predicates-> [ expr ]"); } - | { $$=xp_new(XP_PRED,A_NAN,NULL, NULL, NULL, NULL, NULL); clicon_debug(2,"predicates->"); } +predicates : predicates '[' expr ']' { $$=xp_new(XP_PRED,A_NAN,NULL, NULL, NULL, $1, $3); clicon_debug(3,"predicates-> [ expr ]"); } + | { $$=xp_new(XP_PRED,A_NAN,NULL, NULL, NULL, NULL, NULL); clicon_debug(3,"predicates->"); } ; -primaryexpr : '(' expr ')' { $$=xp_new(XP_PRI0,A_NAN,NULL, NULL, NULL, $2, NULL); clicon_debug(2,"primaryexpr-> ( expr )"); } - | NUMBER { $$=xp_new(XP_PRIME_NR,A_NAN, $1, NULL, NULL, NULL, NULL);clicon_debug(2,"primaryexpr-> NUMBER(%s)", $1); /*XXX*/} - | QUOTE string QUOTE { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, $2, NULL, NULL, NULL);clicon_debug(2,"primaryexpr-> \" string \""); } - | QUOTE QUOTE { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, NULL, NULL, NULL, NULL);clicon_debug(2,"primaryexpr-> \" \""); } - | APOST string APOST { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, $2, NULL, NULL, NULL);clicon_debug(2,"primaryexpr-> ' string '"); } - | APOST APOST { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, NULL, NULL, NULL, NULL);clicon_debug(2,"primaryexpr-> ' '"); } - | FUNCTIONNAME '(' ')' { $$=xp_new(XP_PRIME_FN,A_NAN,NULL, $1, NULL, NULL, NULL);clicon_debug(2,"primaryexpr-> functionname ( arguments )"); } - | FUNCTIONNAME '(' args ')' { $$=xp_new(XP_PRIME_FN,A_NAN,NULL, $1, NULL, $3, NULL);clicon_debug(2,"primaryexpr-> functionname ( arguments )"); } +primaryexpr : '(' expr ')' { $$=xp_new(XP_PRI0,A_NAN,NULL, NULL, NULL, $2, NULL); clicon_debug(3,"primaryexpr-> ( expr )"); } + | NUMBER { $$=xp_new(XP_PRIME_NR,A_NAN, $1, NULL, NULL, NULL, NULL);clicon_debug(3,"primaryexpr-> NUMBER(%s)", $1); /*XXX*/} + | QUOTE string QUOTE { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, $2, NULL, NULL, NULL);clicon_debug(3,"primaryexpr-> \" string \""); } + | QUOTE QUOTE { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, NULL, NULL, NULL, NULL);clicon_debug(3,"primaryexpr-> \" \""); } + | APOST string APOST { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, $2, NULL, NULL, NULL);clicon_debug(3,"primaryexpr-> ' string '"); } + | APOST APOST { $$=xp_new(XP_PRIME_STR,A_NAN,NULL, NULL, NULL, NULL, NULL);clicon_debug(3,"primaryexpr-> ' '"); } + | FUNCTIONNAME '(' ')' { $$=xp_new(XP_PRIME_FN,A_NAN,NULL, $1, NULL, NULL, NULL);clicon_debug(3,"primaryexpr-> functionname ( arguments )"); } + | FUNCTIONNAME '(' args ')' { $$=xp_new(XP_PRIME_FN,A_NAN,NULL, $1, NULL, $3, NULL);clicon_debug(3,"primaryexpr-> functionname ( arguments )"); } ; args : args ',' expr { $$=xp_new(XP_EXP,A_NAN,NULL,NULL,NULL,$1, $3); - clicon_debug(2,"args -> args expr");} + clicon_debug(3,"args -> args expr");} | expr { $$=xp_new(XP_EXP,A_NAN,NULL,NULL,NULL,$1, NULL); - clicon_debug(2,"args -> expr "); } + clicon_debug(3,"args -> expr "); } ; string : string CHARS { @@ -286,9 +286,9 @@ string : string CHARS { $$ = realloc($1, len+strlen($2) + 1); sprintf($$+len, "%s", $2); free($2); - clicon_debug(2,"string-> string CHAR"); + clicon_debug(3,"string-> string CHAR"); } - | CHARS { clicon_debug(2,"string-> "); } + | CHARS { clicon_debug(3,"string-> "); } ; diff --git a/lib/src/clixon_yang_parse.y b/lib/src/clixon_yang_parse.y index 7e3add06..a28d55eb 100644 --- a/lib/src/clixon_yang_parse.y +++ b/lib/src/clixon_yang_parse.y @@ -164,7 +164,7 @@ /* typecast macro */ #define _YY ((clixon_yang_yacc *)_yy) -#define _YYERROR(msg) {clicon_debug(2, "YYERROR %s '%s' %d", (msg), clixon_yang_parsetext, _YY->yy_linenum); YYERROR;} +#define _YYERROR(msg) {clicon_debug(1, "YYERROR %s '%s' %d", (msg), clixon_yang_parsetext, _YY->yy_linenum); YYERROR;} /* add _yy to error parameters */ #define YY_(msgid) msgid @@ -373,9 +373,9 @@ string_del_join(char *str1, */ file : module_stmt MY_EOF - { clicon_debug(2,"file->module-stmt"); YYACCEPT; } + { clicon_debug(3,"file->module-stmt"); YYACCEPT; } | submodule_stmt MY_EOF - { clicon_debug(2,"file->submodule-stmt"); YYACCEPT; } + { clicon_debug(3,"file->submodule-stmt"); YYACCEPT; } ; /* module identifier-arg-str */ @@ -384,22 +384,22 @@ module_stmt : K_MODULE identifier_str } '{' module_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("module_stmt"); - clicon_debug(2,"module_stmt -> id-arg-str { module-substmts }");} + clicon_debug(3,"module_stmt -> id-arg-str { module-substmts }");} ; module_substmts : module_substmts module_substmt - {clicon_debug(2,"module-substmts -> module-substmts module-substm");} + {clicon_debug(3,"module-substmts -> module-substmts module-substm");} | module_substmt - { clicon_debug(2,"module-substmts ->");} + { clicon_debug(3,"module-substmts ->");} ; -module_substmt : module_header_stmts { clicon_debug(2,"module-substmt -> module-header-stmts");} - | linkage_stmts { clicon_debug(2,"module-substmt -> linake-stmts");} - | meta_stmts { clicon_debug(2,"module-substmt -> meta-stmts");} - | revision_stmts { clicon_debug(2,"module-substmt -> revision-stmts");} - | body_stmts { clicon_debug(2,"module-substmt -> body-stmts");} - | unknown_stmt { clicon_debug(2,"module-substmt -> unknown-stmt");} - | { clicon_debug(2,"module-substmt ->");} +module_substmt : module_header_stmts { clicon_debug(3,"module-substmt -> module-header-stmts");} + | linkage_stmts { clicon_debug(3,"module-substmt -> linake-stmts");} + | meta_stmts { clicon_debug(3,"module-substmt -> meta-stmts");} + | revision_stmts { clicon_debug(3,"module-substmt -> revision-stmts");} + | body_stmts { clicon_debug(3,"module-substmt -> body-stmts");} + | unknown_stmt { clicon_debug(3,"module-substmt -> unknown-stmt");} + | { clicon_debug(3,"module-substmt ->");} ; /* submodule */ @@ -407,64 +407,64 @@ submodule_stmt : K_SUBMODULE identifier_str { if ((_YY->yy_module = ysp_add_push(_yy, Y_SUBMODULE, $2, NULL)) == NULL) _YYERROR("submodule_stmt"); } '{' submodule_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("submodule_stmt"); - clicon_debug(2,"submodule_stmt -> id-arg-str { submodule-substmts }");} + clicon_debug(3,"submodule_stmt -> id-arg-str { submodule-substmts }");} ; submodule_substmts : submodule_substmts submodule_substmt - { clicon_debug(2,"submodule-stmts -> submodule-substmts submodule-substmt"); } + { clicon_debug(3,"submodule-stmts -> submodule-substmts submodule-substmt"); } | submodule_substmt - { clicon_debug(2,"submodule-stmts -> submodule-substmt"); } + { clicon_debug(3,"submodule-stmts -> submodule-substmt"); } ; submodule_substmt : submodule_header_stmts - { clicon_debug(2,"submodule-substmt -> submodule-header-stmts"); } - | linkage_stmts { clicon_debug(2,"submodule-substmt -> linake-stmts");} - | meta_stmts { clicon_debug(2,"submodule-substmt -> meta-stmts");} - | revision_stmts { clicon_debug(2,"submodule-substmt -> revision-stmts");} - | body_stmts { clicon_debug(2,"submodule-stmt -> body-stmts"); } - | unknown_stmt { clicon_debug(2,"submodule-substmt -> unknown-stmt");} - | { clicon_debug(2,"submodule-substmt ->");} + { clicon_debug(3,"submodule-substmt -> submodule-header-stmts"); } + | linkage_stmts { clicon_debug(3,"submodule-substmt -> linake-stmts");} + | meta_stmts { clicon_debug(3,"submodule-substmt -> meta-stmts");} + | revision_stmts { clicon_debug(3,"submodule-substmt -> revision-stmts");} + | body_stmts { clicon_debug(3,"submodule-stmt -> body-stmts"); } + | unknown_stmt { clicon_debug(3,"submodule-substmt -> unknown-stmt");} + | { clicon_debug(3,"submodule-substmt ->");} ; /* linkage */ linkage_stmts : linkage_stmts linkage_stmt - { clicon_debug(2,"linkage-stmts -> linkage-stmts linkage-stmt"); } + { clicon_debug(3,"linkage-stmts -> linkage-stmts linkage-stmt"); } | linkage_stmt - { clicon_debug(2,"linkage-stmts -> linkage-stmt"); } + { clicon_debug(3,"linkage-stmts -> linkage-stmt"); } ; -linkage_stmt : import_stmt { clicon_debug(2,"linkage-stmt -> import-stmt"); } - | include_stmt { clicon_debug(2,"linkage-stmt -> include-stmt"); } +linkage_stmt : import_stmt { clicon_debug(3,"linkage-stmt -> import-stmt"); } + | include_stmt { clicon_debug(3,"linkage-stmt -> include-stmt"); } ; /* module-header */ module_header_stmts : module_header_stmts module_header_stmt - { clicon_debug(2,"module-header-stmts -> module-header-stmts module-header-stmt"); } - | module_header_stmt { clicon_debug(2,"module-header-stmts -> "); } + { clicon_debug(3,"module-header-stmts -> module-header-stmts module-header-stmt"); } + | module_header_stmt { clicon_debug(3,"module-header-stmts -> "); } ; module_header_stmt : yang_version_stmt - { clicon_debug(2,"module-header-stmt -> yang-version-stmt"); } - | namespace_stmt { clicon_debug(2,"module-header-stmt -> namespace-stmt"); } - | prefix_stmt { clicon_debug(2,"module-header-stmt -> prefix-stmt"); } + { clicon_debug(3,"module-header-stmt -> yang-version-stmt"); } + | namespace_stmt { clicon_debug(3,"module-header-stmt -> namespace-stmt"); } + | prefix_stmt { clicon_debug(3,"module-header-stmt -> prefix-stmt"); } ; /* submodule-header */ submodule_header_stmts : submodule_header_stmts submodule_header_stmt - { clicon_debug(2,"submodule-header-stmts -> submodule-header-stmts submodule-header-stmt"); } + { clicon_debug(3,"submodule-header-stmts -> submodule-header-stmts submodule-header-stmt"); } | submodule_header_stmt - { clicon_debug(2,"submodule-header-stmts -> submodule-header-stmt"); } + { clicon_debug(3,"submodule-header-stmts -> submodule-header-stmt"); } ; submodule_header_stmt : yang_version_stmt - { clicon_debug(2,"submodule-header-stmt -> yang-version-stmt"); } - | belongs_to_stmt { clicon_debug(2,"submodule-header-stmt -> belongs-to-stmt"); } + { clicon_debug(3,"submodule-header-stmt -> yang-version-stmt"); } + | belongs_to_stmt { clicon_debug(3,"submodule-header-stmt -> belongs-to-stmt"); } ; /* yang-version-stmt = yang-version-keyword yang-version-arg-str */ yang_version_stmt : K_YANG_VERSION string stmtend { if (ysp_add(_yy, Y_YANG_VERSION, $2, NULL) == NULL) _YYERROR("yang_version_stmt"); - clicon_debug(2,"yang-version-stmt -> YANG-VERSION string"); } + clicon_debug(3,"yang-version-stmt -> YANG-VERSION string"); } ; /* import */ @@ -472,52 +472,52 @@ import_stmt : K_IMPORT identifier_str { if (ysp_add_push(_yy, Y_IMPORT, $2, NULL) == NULL) _YYERROR("import_stmt"); } '{' import_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("import_stmt"); - clicon_debug(2,"import-stmt -> IMPORT id-arg-str { import-substmts }");} + clicon_debug(3,"import-stmt -> IMPORT id-arg-str { import-substmts }");} ; import_substmts : import_substmts import_substmt - { clicon_debug(2,"import-substmts -> import-substmts import-substm");} + { clicon_debug(3,"import-substmts -> import-substmts import-substm");} | import_substmt - { clicon_debug(2,"import-substmts ->");} + { clicon_debug(3,"import-substmts ->");} ; -import_substmt : prefix_stmt { clicon_debug(2,"import-stmt -> prefix-stmt"); } - | revision_date_stmt { clicon_debug(2,"import-stmt -> revision-date-stmt"); } - | description_stmt { clicon_debug(2,"import-stmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"import-stmt -> reference-stmt"); } +import_substmt : prefix_stmt { clicon_debug(3,"import-stmt -> prefix-stmt"); } + | revision_date_stmt { clicon_debug(3,"import-stmt -> revision-date-stmt"); } + | description_stmt { clicon_debug(3,"import-stmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"import-stmt -> reference-stmt"); } ; include_stmt : K_INCLUDE identifier_str ';' { if (ysp_add(_yy, Y_INCLUDE, $2, NULL)== NULL) _YYERROR("include_stmt"); - clicon_debug(2,"include-stmt -> id-str"); } + clicon_debug(3,"include-stmt -> id-str"); } | K_INCLUDE identifier_str { if (ysp_add_push(_yy, Y_INCLUDE, $2, NULL) == NULL) _YYERROR("include_stmt"); } '{' include_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("include_stmt"); - clicon_debug(2,"include-stmt -> id-str { include-substmts }"); } + clicon_debug(3,"include-stmt -> id-str { include-substmts }"); } ; include_substmts : include_substmts include_substmt - { clicon_debug(2,"include-substmts -> include-substmts include-substm");} + { clicon_debug(3,"include-substmts -> include-substmts include-substm");} | include_substmt - { clicon_debug(2,"include-substmts ->");} + { clicon_debug(3,"include-substmts ->");} ; -include_substmt : revision_date_stmt { clicon_debug(2,"include-stmt -> revision-date-stmt"); } - | description_stmt { clicon_debug(2,"include-stmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"include-stmt -> reference-stmt"); } +include_substmt : revision_date_stmt { clicon_debug(3,"include-stmt -> revision-date-stmt"); } + | description_stmt { clicon_debug(3,"include-stmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"include-stmt -> reference-stmt"); } ; /* namespace-stmt = namespace-keyword sep uri-str */ namespace_stmt : K_NAMESPACE string stmtend { if (ysp_add(_yy, Y_NAMESPACE, $2, NULL)== NULL) _YYERROR("namespace_stmt"); - clicon_debug(2,"namespace-stmt -> NAMESPACE string"); } + clicon_debug(3,"namespace-stmt -> NAMESPACE string"); } ; prefix_stmt : K_PREFIX identifier_str stmtend /* XXX prefix-arg-str */ { if (ysp_add(_yy, Y_PREFIX, $2, NULL)== NULL) _YYERROR("prefix_stmt"); - clicon_debug(2,"prefix-stmt -> PREFIX string ;");} + clicon_debug(3,"prefix-stmt -> PREFIX string ;");} ; belongs_to_stmt : K_BELONGS_TO identifier_str @@ -525,114 +525,114 @@ belongs_to_stmt : K_BELONGS_TO identifier_str '{' prefix_stmt '}' { if (ystack_pop(_yy) < 0) _YYERROR("belongs_to_stmt"); - clicon_debug(2,"belongs-to-stmt -> BELONGS-TO id-arg-str { prefix-stmt } "); + clicon_debug(3,"belongs-to-stmt -> BELONGS-TO id-arg-str { prefix-stmt } "); } ; organization_stmt: K_ORGANIZATION string stmtend { if (ysp_add(_yy, Y_ORGANIZATION, $2, NULL)== NULL) _YYERROR("belongs_to_stmt"); - clicon_debug(2,"organization-stmt -> ORGANIZATION string ;");} + clicon_debug(3,"organization-stmt -> ORGANIZATION string ;");} ; contact_stmt : K_CONTACT string stmtend { if (ysp_add(_yy, Y_CONTACT, $2, NULL)== NULL) _YYERROR("contact_stmt"); - clicon_debug(2,"contact-stmt -> CONTACT string"); } + clicon_debug(3,"contact-stmt -> CONTACT string"); } ; description_stmt : K_DESCRIPTION string stmtend { if (ysp_add(_yy, Y_DESCRIPTION, $2, NULL)== NULL) _YYERROR("description_stmt"); - clicon_debug(2,"description-stmt -> DESCRIPTION string ;");} + clicon_debug(3,"description-stmt -> DESCRIPTION string ;");} ; reference_stmt : K_REFERENCE string stmtend { if (ysp_add(_yy, Y_REFERENCE, $2, NULL)== NULL) _YYERROR("reference_stmt"); - clicon_debug(2,"reference-stmt -> REFERENCE string ;");} + clicon_debug(3,"reference-stmt -> REFERENCE string ;");} ; units_stmt : K_UNITS string ';' { if (ysp_add(_yy, Y_UNITS, $2, NULL)== NULL) _YYERROR("units_stmt"); - clicon_debug(2,"units-stmt -> UNITS string"); } + clicon_debug(3,"units-stmt -> UNITS string"); } ; revision_stmt : K_REVISION string ';' /* XXX date-arg-str */ { if (ysp_add(_yy, Y_REVISION, $2, NULL) == NULL) _YYERROR("revision_stmt"); - clicon_debug(2,"revision-stmt -> date-arg-str ;"); } + clicon_debug(3,"revision-stmt -> date-arg-str ;"); } | K_REVISION string { if (ysp_add_push(_yy, Y_REVISION, $2, NULL) == NULL) _YYERROR("revision_stmt"); } '{' revision_substmts '}' /* XXX date-arg-str */ { if (ystack_pop(_yy) < 0) _YYERROR("revision_stmt"); - clicon_debug(2,"revision-stmt -> date-arg-str { revision-substmts }"); } + clicon_debug(3,"revision-stmt -> date-arg-str { revision-substmts }"); } ; revision_substmts : revision_substmts revision_substmt - { clicon_debug(2,"revision-substmts -> revision-substmts revision-substmt }"); } + { clicon_debug(3,"revision-substmts -> revision-substmts revision-substmt }"); } | revision_substmt - { clicon_debug(2,"revision-substmts -> }"); } + { clicon_debug(3,"revision-substmts -> }"); } ; -revision_substmt : description_stmt { clicon_debug(2,"revision-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"revision-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"revision-substmt -> unknown-stmt");} - | { clicon_debug(2,"revision-substmt -> "); } +revision_substmt : description_stmt { clicon_debug(3,"revision-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"revision-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"revision-substmt -> unknown-stmt");} + | { clicon_debug(3,"revision-substmt -> "); } ; /* revision */ revision_stmts : revision_stmts revision_stmt - { clicon_debug(2,"revision-stmts -> revision-stmts revision-stmt"); } + { clicon_debug(3,"revision-stmts -> revision-stmts revision-stmt"); } | revision_stmt - { clicon_debug(2,"revision-stmts -> "); } + { clicon_debug(3,"revision-stmts -> "); } ; revision_date_stmt : K_REVISION_DATE string stmtend /* XXX date-arg-str */ { if (ysp_add(_yy, Y_REVISION_DATE, $2, NULL) == NULL) _YYERROR("revision_date_stmt"); - clicon_debug(2,"revision-date-stmt -> date;"); } + clicon_debug(3,"revision-date-stmt -> date;"); } ; extension_stmt : K_EXTENSION identifier_str ';' { if (ysp_add(_yy, Y_EXTENSION, $2, NULL) == NULL) _YYERROR("extension_stmt"); - clicon_debug(2,"extenstion-stmt -> EXTENSION id-str ;"); } + clicon_debug(3,"extenstion-stmt -> EXTENSION id-str ;"); } | K_EXTENSION identifier_str { if (ysp_add_push(_yy, Y_EXTENSION, $2, NULL) == NULL) _YYERROR("extension_stmt"); } '{' extension_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("extension_stmt"); - clicon_debug(2,"extension-stmt -> EXTENSION id-str { extension-substmts }"); } + clicon_debug(3,"extension-stmt -> EXTENSION id-str { extension-substmts }"); } ; /* extension substmts */ extension_substmts : extension_substmts extension_substmt - { clicon_debug(2,"extension-substmts -> extension-substmts extension-substmt"); } + { clicon_debug(3,"extension-substmts -> extension-substmts extension-substmt"); } | extension_substmt - { clicon_debug(2,"extension-substmts -> extension-substmt"); } + { clicon_debug(3,"extension-substmts -> extension-substmt"); } ; -extension_substmt : argument_stmt { clicon_debug(2,"extension-substmt -> argument-stmt"); } - | status_stmt { clicon_debug(2,"extension-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"extension-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"extension-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"extension-substmt -> unknown-stmt");} - | { clicon_debug(2,"extension-substmt -> "); } +extension_substmt : argument_stmt { clicon_debug(3,"extension-substmt -> argument-stmt"); } + | status_stmt { clicon_debug(3,"extension-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"extension-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"extension-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"extension-substmt -> unknown-stmt");} + | { clicon_debug(3,"extension-substmt -> "); } ; argument_stmt : K_ARGUMENT identifier_str ';' { if (ysp_add(_yy, Y_ARGUMENT, $2, NULL) == NULL) _YYERROR("argument_stmt"); - clicon_debug(2,"argument-stmt -> ARGUMENT identifier ;"); } + clicon_debug(3,"argument-stmt -> ARGUMENT identifier ;"); } | K_ARGUMENT identifier_str { if (ysp_add_push(_yy, Y_ARGUMENT, $2, NULL) == NULL) _YYERROR("argument_stmt"); } '{' argument_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("argument_stmt"); - clicon_debug(2,"argument-stmt -> ARGUMENT { argument-substmts }"); } + clicon_debug(3,"argument-stmt -> ARGUMENT { argument-substmts }"); } ; /* argument substmts */ argument_substmts : argument_substmts argument_substmt - { clicon_debug(2,"argument-substmts -> argument-substmts argument-substmt"); } + { clicon_debug(3,"argument-substmts -> argument-substmts argument-substmt"); } | argument_substmt - { clicon_debug(2,"argument-substmts -> argument-substmt"); } + { clicon_debug(3,"argument-substmts -> argument-substmt"); } ; -argument_substmt : yin_element_stmt1 { clicon_debug(2,"argument-substmt -> yin-element-stmt1");} - | unknown_stmt { clicon_debug(2,"argument-substmt -> unknown-stmt");} +argument_substmt : yin_element_stmt1 { clicon_debug(3,"argument-substmt -> yin-element-stmt1");} + | unknown_stmt { clicon_debug(3,"argument-substmt -> unknown-stmt");} ; @@ -643,65 +643,65 @@ yin_element_stmt1 : K_YIN_ELEMENT bool_str stmtend {free($2);} /* Identity */ identity_stmt : K_IDENTITY identifier_str ';' { if (ysp_add(_yy, Y_IDENTITY, $2, NULL) == NULL) _YYERROR("identity_stmt"); - clicon_debug(2,"identity-stmt -> IDENTITY string ;"); } + clicon_debug(3,"identity-stmt -> IDENTITY string ;"); } | K_IDENTITY identifier_str { if (ysp_add_push(_yy, Y_IDENTITY, $2, NULL) == NULL) _YYERROR("identity_stmt"); } '{' identity_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("identity_stmt"); - clicon_debug(2,"identity-stmt -> IDENTITY string { identity-substmts }"); } + clicon_debug(3,"identity-stmt -> IDENTITY string { identity-substmts }"); } ; identity_substmts : identity_substmts identity_substmt - { clicon_debug(2,"identity-substmts -> identity-substmts identity-substmt"); } + { clicon_debug(3,"identity-substmts -> identity-substmts identity-substmt"); } | identity_substmt - { clicon_debug(2,"identity-substmts -> identity-substmt"); } + { clicon_debug(3,"identity-substmts -> identity-substmt"); } ; -identity_substmt : if_feature_stmt { clicon_debug(2,"identity-substmt -> if-feature-stmt"); } - | base_stmt { clicon_debug(2,"identity-substmt -> base-stmt"); } - | status_stmt { clicon_debug(2,"identity-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"identity-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"identity-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"identity-substmt -> unknown-stmt");} - | { clicon_debug(2,"identity-substmt -> "); } +identity_substmt : if_feature_stmt { clicon_debug(3,"identity-substmt -> if-feature-stmt"); } + | base_stmt { clicon_debug(3,"identity-substmt -> base-stmt"); } + | status_stmt { clicon_debug(3,"identity-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"identity-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"identity-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"identity-substmt -> unknown-stmt");} + | { clicon_debug(3,"identity-substmt -> "); } ; base_stmt : K_BASE identifier_ref_str stmtend { if (ysp_add(_yy, Y_BASE, $2, NULL)== NULL) _YYERROR("base_stmt"); - clicon_debug(2,"base-stmt -> BASE identifier-ref-arg-str"); } + clicon_debug(3,"base-stmt -> BASE identifier-ref-arg-str"); } ; /* Feature */ feature_stmt : K_FEATURE identifier_str ';' { if (ysp_add(_yy, Y_FEATURE, $2, NULL) == NULL) _YYERROR("feature_stmt"); - clicon_debug(2,"feature-stmt -> FEATURE id-arg-str ;"); } + clicon_debug(3,"feature-stmt -> FEATURE id-arg-str ;"); } | K_FEATURE identifier_str { if (ysp_add_push(_yy, Y_FEATURE, $2, NULL) == NULL) _YYERROR("feature_stmt"); } '{' feature_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("feature_stmt"); - clicon_debug(2,"feature-stmt -> FEATURE id-arg-str { feature-substmts }"); } + clicon_debug(3,"feature-stmt -> FEATURE id-arg-str { feature-substmts }"); } ; /* feature substmts */ feature_substmts : feature_substmts feature_substmt - { clicon_debug(2,"feature-substmts -> feature-substmts feature-substmt"); } + { clicon_debug(3,"feature-substmts -> feature-substmts feature-substmt"); } | feature_substmt - { clicon_debug(2,"feature-substmts -> feature-substmt"); } + { clicon_debug(3,"feature-substmts -> feature-substmt"); } ; -feature_substmt : if_feature_stmt { clicon_debug(2,"feature-substmt -> if-feature-stmt"); } - | status_stmt { clicon_debug(2,"feature-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"feature-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"feature-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"feature-substmt -> unknown-stmt");} - | { clicon_debug(2,"feature-substmt -> "); } +feature_substmt : if_feature_stmt { clicon_debug(3,"feature-substmt -> if-feature-stmt"); } + | status_stmt { clicon_debug(3,"feature-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"feature-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"feature-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"feature-substmt -> unknown-stmt");} + | { clicon_debug(3,"feature-substmt -> "); } ; /* if-feature-stmt = if-feature-keyword sep if-feature-expr-str */ if_feature_stmt : K_IF_FEATURE string stmtend { if (ysp_add(_yy, Y_IF_FEATURE, $2, NULL) == NULL) _YYERROR("if_feature_stmt"); - clicon_debug(2,"if-feature-stmt -> IF-FEATURE identifier-ref-arg-str"); } + clicon_debug(3,"if-feature-stmt -> IF-FEATURE identifier-ref-arg-str"); } ; /* Typedef */ @@ -709,35 +709,35 @@ typedef_stmt : K_TYPEDEF identifier_str { if (ysp_add_push(_yy, Y_TYPEDEF, $2, NULL) == NULL) _YYERROR("typedef_stmt"); } '{' typedef_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("typedef_stmt"); - clicon_debug(2,"typedef-stmt -> TYPEDEF id-arg-str { typedef-substmts }"); } + clicon_debug(3,"typedef-stmt -> TYPEDEF id-arg-str { typedef-substmts }"); } ; typedef_substmts : typedef_substmts typedef_substmt - { clicon_debug(2,"typedef-substmts -> typedef-substmts typedef-substmt"); } + { clicon_debug(3,"typedef-substmts -> typedef-substmts typedef-substmt"); } | typedef_substmt - { clicon_debug(2,"typedef-substmts -> typedef-substmt"); } + { clicon_debug(3,"typedef-substmts -> typedef-substmt"); } ; -typedef_substmt : type_stmt { clicon_debug(2,"typedef-substmt -> type-stmt"); } - | units_stmt { clicon_debug(2,"typedef-substmt -> units-stmt"); } - | default_stmt { clicon_debug(2,"typedef-substmt -> default-stmt"); } - | status_stmt { clicon_debug(2,"typedef-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"typedef-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"typedef-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"typedef-substmt -> unknown-stmt");} - | { clicon_debug(2,"typedef-substmt -> "); } +typedef_substmt : type_stmt { clicon_debug(3,"typedef-substmt -> type-stmt"); } + | units_stmt { clicon_debug(3,"typedef-substmt -> units-stmt"); } + | default_stmt { clicon_debug(3,"typedef-substmt -> default-stmt"); } + | status_stmt { clicon_debug(3,"typedef-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"typedef-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"typedef-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"typedef-substmt -> unknown-stmt");} + | { clicon_debug(3,"typedef-substmt -> "); } ; /* Type */ type_stmt : K_TYPE identifier_ref_str ';' { if (ysp_add(_yy, Y_TYPE, $2, NULL) == NULL) _YYERROR("type_stmt"); - clicon_debug(2,"type-stmt -> TYPE identifier-ref-arg-str ;");} + clicon_debug(3,"type-stmt -> TYPE identifier-ref-arg-str ;");} | K_TYPE identifier_ref_str { if (ysp_add_push(_yy, Y_TYPE, $2, NULL) == NULL) _YYERROR("type_stmt"); } '{' type_body_stmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("type_stmt"); - clicon_debug(2,"type-stmt -> TYPE identifier-ref-arg-str { type-body-stmts }");} + clicon_debug(3,"type-stmt -> TYPE identifier-ref-arg-str { type-body-stmts }");} ; /* type-body-stmts is a little special since it is a choice of @@ -745,278 +745,278 @@ type_stmt : K_TYPE identifier_ref_str ';' type-body-stmts and each individual specification as a simple. */ type_body_stmts : type_body_stmts type_body_stmt - { clicon_debug(2,"type-body-stmts -> type-body-stmts type-body-stmt"); } + { clicon_debug(3,"type-body-stmts -> type-body-stmts type-body-stmt"); } | - { clicon_debug(2,"type-body-stmts -> "); } + { clicon_debug(3,"type-body-stmts -> "); } ; type_body_stmt/* numerical-restrictions */ - : range_stmt { clicon_debug(2,"type-body-stmt -> range-stmt"); } + : range_stmt { clicon_debug(3,"type-body-stmt -> range-stmt"); } /* decimal64-specification */ - | fraction_digits_stmt { clicon_debug(2,"type-body-stmt -> fraction-digits-stmt"); } + | fraction_digits_stmt { clicon_debug(3,"type-body-stmt -> fraction-digits-stmt"); } /* string-restrictions */ - | length_stmt { clicon_debug(2,"type-body-stmt -> length-stmt"); } - | pattern_stmt { clicon_debug(2,"type-body-stmt -> pattern-stmt"); } + | length_stmt { clicon_debug(3,"type-body-stmt -> length-stmt"); } + | pattern_stmt { clicon_debug(3,"type-body-stmt -> pattern-stmt"); } /* enum-specification */ - | enum_stmt { clicon_debug(2,"type-body-stmt -> enum-stmt"); } + | enum_stmt { clicon_debug(3,"type-body-stmt -> enum-stmt"); } /* leafref-specifications */ - | path_stmt { clicon_debug(2,"type-body-stmt -> path-stmt"); } - | require_instance_stmt { clicon_debug(2,"type-body-stmt -> require-instance-stmt"); } + | path_stmt { clicon_debug(3,"type-body-stmt -> path-stmt"); } + | require_instance_stmt { clicon_debug(3,"type-body-stmt -> require-instance-stmt"); } /* identityref-specification */ - | base_stmt { clicon_debug(2,"type-body-stmt -> base-stmt"); } + | base_stmt { clicon_debug(3,"type-body-stmt -> base-stmt"); } /* instance-identifier-specification (see require-instance-stmt above */ /* bits-specification */ - | bit_stmt { clicon_debug(2,"type-body-stmt -> bit-stmt"); } + | bit_stmt { clicon_debug(3,"type-body-stmt -> bit-stmt"); } /* union-specification */ - | type_stmt { clicon_debug(2,"type-body-stmt -> type-stmt"); } + | type_stmt { clicon_debug(3,"type-body-stmt -> type-stmt"); } /* Cisco uses this (eg Cisco-IOS-XR-sysadmin-nto-misc-set-hostname.yang) but I dont see this is in the RFC */ - | unknown_stmt { clicon_debug(2,"type-body-stmt -> unknown-stmt");} + | unknown_stmt { clicon_debug(3,"type-body-stmt -> unknown-stmt");} ; /* range-stmt */ range_stmt : K_RANGE string ';' /* XXX range-arg-str */ { if (ysp_add(_yy, Y_RANGE, $2, NULL) == NULL) _YYERROR("range_stmt"); - clicon_debug(2,"range-stmt -> RANGE string ;"); } + clicon_debug(3,"range-stmt -> RANGE string ;"); } | K_RANGE string { if (ysp_add_push(_yy, Y_RANGE, $2, NULL) == NULL) _YYERROR("range_stmt"); } '{' range_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("range_stmt"); - clicon_debug(2,"range-stmt -> RANGE string { range-substmts }"); } + clicon_debug(3,"range-stmt -> RANGE string { range-substmts }"); } ; range_substmts : range_substmts range_substmt - { clicon_debug(2,"range-substmts -> range-substmts range-substmt"); } + { clicon_debug(3,"range-substmts -> range-substmts range-substmt"); } | range_substmt - { clicon_debug(2,"range-substmts -> range-substmt"); } + { clicon_debug(3,"range-substmts -> range-substmt"); } ; -range_substmt : error_message_stmt { clicon_debug(2,"range-substmt -> error-message-stmt");} - | description_stmt { clicon_debug(2,"range-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"range-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"range-substmt -> unknown-stmt");} - | { clicon_debug(2,"range-substmt -> "); } +range_substmt : error_message_stmt { clicon_debug(3,"range-substmt -> error-message-stmt");} + | description_stmt { clicon_debug(3,"range-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"range-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"range-substmt -> unknown-stmt");} + | { clicon_debug(3,"range-substmt -> "); } ; /* fraction-digits-stmt = fraction-digits-keyword fraction-digits-arg-str */ fraction_digits_stmt : K_FRACTION_DIGITS string stmtend { if (ysp_add(_yy, Y_FRACTION_DIGITS, $2, NULL) == NULL) _YYERROR("fraction_digits_stmt"); - clicon_debug(2,"fraction-digits-stmt -> FRACTION-DIGITS string"); } + clicon_debug(3,"fraction-digits-stmt -> FRACTION-DIGITS string"); } ; /* meta */ -meta_stmts : meta_stmts meta_stmt { clicon_debug(2,"meta-stmts -> meta-stmts meta-stmt"); } - | meta_stmt { clicon_debug(2,"meta-stmts -> meta-stmt"); } +meta_stmts : meta_stmts meta_stmt { clicon_debug(3,"meta-stmts -> meta-stmts meta-stmt"); } + | meta_stmt { clicon_debug(3,"meta-stmts -> meta-stmt"); } ; -meta_stmt : organization_stmt { clicon_debug(2,"meta-stmt -> organization-stmt"); } - | contact_stmt { clicon_debug(2,"meta-stmt -> contact-stmt"); } - | description_stmt { clicon_debug(2,"meta-stmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"meta-stmt -> reference-stmt"); } +meta_stmt : organization_stmt { clicon_debug(3,"meta-stmt -> organization-stmt"); } + | contact_stmt { clicon_debug(3,"meta-stmt -> contact-stmt"); } + | description_stmt { clicon_debug(3,"meta-stmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"meta-stmt -> reference-stmt"); } ; /* length-stmt */ length_stmt : K_LENGTH string ';' /* XXX length-arg-str */ { if (ysp_add(_yy, Y_LENGTH, $2, NULL) == NULL) _YYERROR("length_stmt"); - clicon_debug(2,"length-stmt -> LENGTH string ;"); } + clicon_debug(3,"length-stmt -> LENGTH string ;"); } | K_LENGTH string { if (ysp_add_push(_yy, Y_LENGTH, $2, NULL) == NULL) _YYERROR("length_stmt"); } '{' length_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("length_stmt"); - clicon_debug(2,"length-stmt -> LENGTH string { length-substmts }"); } + clicon_debug(3,"length-stmt -> LENGTH string { length-substmts }"); } ; length_substmts : length_substmts length_substmt - { clicon_debug(2,"length-substmts -> length-substmts length-substmt"); } + { clicon_debug(3,"length-substmts -> length-substmts length-substmt"); } | length_substmt - { clicon_debug(2,"length-substmts -> length-substmt"); } + { clicon_debug(3,"length-substmts -> length-substmt"); } ; -length_substmt : error_message_stmt { clicon_debug(2,"length-substmt -> error-message-stmt");} - | description_stmt { clicon_debug(2,"length-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"length-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"length-substmt -> unknown-stmt");} - | { clicon_debug(2,"length-substmt -> "); } +length_substmt : error_message_stmt { clicon_debug(3,"length-substmt -> error-message-stmt");} + | description_stmt { clicon_debug(3,"length-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"length-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"length-substmt -> unknown-stmt");} + | { clicon_debug(3,"length-substmt -> "); } ; /* Pattern */ pattern_stmt : K_PATTERN string ';' { if (ysp_add(_yy, Y_PATTERN, $2, NULL) == NULL) _YYERROR("pattern_stmt"); - clicon_debug(2,"pattern-stmt -> PATTERN string ;"); } + clicon_debug(3,"pattern-stmt -> PATTERN string ;"); } | K_PATTERN string { if (ysp_add_push(_yy, Y_PATTERN, $2, NULL) == NULL) _YYERROR("pattern_stmt"); } '{' pattern_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("pattern_stmt"); - clicon_debug(2,"pattern-stmt -> PATTERN string { pattern-substmts }"); } + clicon_debug(3,"pattern-stmt -> PATTERN string { pattern-substmts }"); } ; pattern_substmts : pattern_substmts pattern_substmt - { clicon_debug(2,"pattern-substmts -> pattern-substmts pattern-substmt"); } + { clicon_debug(3,"pattern-substmts -> pattern-substmts pattern-substmt"); } | pattern_substmt - { clicon_debug(2,"pattern-substmts -> pattern-substmt"); } + { clicon_debug(3,"pattern-substmts -> pattern-substmt"); } ; -pattern_substmt : modifier_stmt { clicon_debug(2,"pattern-substmt -> modifier-stmt");} - | error_message_stmt { clicon_debug(2,"pattern-substmt -> error-message-stmt");} - | error_app_tag_stmt { clicon_debug(2,"pattern-substmt -> error-app-tag-stmt");} - | description_stmt { clicon_debug(2,"pattern-substmt -> description-stmt");} - | reference_stmt { clicon_debug(2,"pattern-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"pattern-substmt -> unknown-stmt");} +pattern_substmt : modifier_stmt { clicon_debug(3,"pattern-substmt -> modifier-stmt");} + | error_message_stmt { clicon_debug(3,"pattern-substmt -> error-message-stmt");} + | error_app_tag_stmt { clicon_debug(3,"pattern-substmt -> error-app-tag-stmt");} + | description_stmt { clicon_debug(3,"pattern-substmt -> description-stmt");} + | reference_stmt { clicon_debug(3,"pattern-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"pattern-substmt -> unknown-stmt");} - | { clicon_debug(2,"pattern-substmt -> "); } + | { clicon_debug(3,"pattern-substmt -> "); } ; modifier_stmt : K_MODIFIER string stmtend { if (ysp_add(_yy, Y_MODIFIER, $2, NULL)== NULL) _YYERROR("modifier_stmt"); - clicon_debug(2,"modifier-stmt -> MODIFIER string"); } + clicon_debug(3,"modifier-stmt -> MODIFIER string"); } ; default_stmt : K_DEFAULT string stmtend { if (ysp_add(_yy, Y_DEFAULT, $2, NULL)== NULL) _YYERROR("default_stmt"); - clicon_debug(2,"default-stmt -> DEFAULT string"); } + clicon_debug(3,"default-stmt -> DEFAULT string"); } ; /* enum-stmt */ enum_stmt : K_ENUM string ';' { if (ysp_add(_yy, Y_ENUM, $2, NULL) == NULL) _YYERROR("enum_stmt"); - clicon_debug(2,"enum-stmt -> ENUM string ;"); } + clicon_debug(3,"enum-stmt -> ENUM string ;"); } | K_ENUM string { if (ysp_add_push(_yy, Y_ENUM, $2, NULL) == NULL) _YYERROR("enum_stmt"); } '{' enum_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("enum_stmt"); - clicon_debug(2,"enum-stmt -> ENUM string { enum-substmts }"); } + clicon_debug(3,"enum-stmt -> ENUM string { enum-substmts }"); } ; enum_substmts : enum_substmts enum_substmt - { clicon_debug(2,"enum-substmts -> enum-substmts enum-substmt"); } + { clicon_debug(3,"enum-substmts -> enum-substmts enum-substmt"); } | enum_substmt - { clicon_debug(2,"enum-substmts -> enum-substmt"); } + { clicon_debug(3,"enum-substmts -> enum-substmt"); } ; -enum_substmt : if_feature_stmt { clicon_debug(2,"enum-substmt -> if-feature-stmt"); } - | value_stmt { clicon_debug(2,"enum-substmt -> value-stmt"); } - | status_stmt { clicon_debug(2,"enum-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"enum-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"enum-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"enum-substmt -> unknown-stmt");} - | { clicon_debug(2,"enum-substmt -> "); } +enum_substmt : if_feature_stmt { clicon_debug(3,"enum-substmt -> if-feature-stmt"); } + | value_stmt { clicon_debug(3,"enum-substmt -> value-stmt"); } + | status_stmt { clicon_debug(3,"enum-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"enum-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"enum-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"enum-substmt -> unknown-stmt");} + | { clicon_debug(3,"enum-substmt -> "); } ; path_stmt : K_PATH string stmtend /* XXX: path-arg-str */ { if (ysp_add(_yy, Y_PATH, $2, NULL)== NULL) _YYERROR("path_stmt"); - clicon_debug(2,"path-stmt -> PATH string"); } + clicon_debug(3,"path-stmt -> PATH string"); } ; require_instance_stmt : K_REQUIRE_INSTANCE bool_str stmtend { if (ysp_add(_yy, Y_REQUIRE_INSTANCE, $2, NULL)== NULL) _YYERROR("require_instance_stmt"); - clicon_debug(2,"require-instance-stmt -> REQUIRE-INSTANCE string"); } + clicon_debug(3,"require-instance-stmt -> REQUIRE-INSTANCE string"); } ; /* bit-stmt */ bit_stmt : K_BIT identifier_str ';' { if (ysp_add(_yy, Y_BIT, $2, NULL) == NULL) _YYERROR("bit_stmt"); - clicon_debug(2,"bit-stmt -> BIT string ;"); } + clicon_debug(3,"bit-stmt -> BIT string ;"); } | K_BIT identifier_str { if (ysp_add_push(_yy, Y_BIT, $2, NULL) == NULL) _YYERROR("bit_stmt"); } '{' bit_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("bit_stmt"); - clicon_debug(2,"bit-stmt -> BIT string { bit-substmts }"); } + clicon_debug(3,"bit-stmt -> BIT string { bit-substmts }"); } ; bit_substmts : bit_substmts bit_substmt - { clicon_debug(2,"bit-substmts -> bit-substmts bit-substmt"); } + { clicon_debug(3,"bit-substmts -> bit-substmts bit-substmt"); } | bit_substmt - { clicon_debug(2,"bit-substmts -> bit-substmt"); } + { clicon_debug(3,"bit-substmts -> bit-substmt"); } ; -bit_substmt : if_feature_stmt { clicon_debug(2,"bit-substmt -> if-feature-stmt"); } - | position_stmt { clicon_debug(2,"bit-substmt -> positition-stmt"); } - | status_stmt { clicon_debug(2,"bit-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"bit-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"bit-substmt -> reference-stmt"); } - | { clicon_debug(2,"bit-substmt -> "); } +bit_substmt : if_feature_stmt { clicon_debug(3,"bit-substmt -> if-feature-stmt"); } + | position_stmt { clicon_debug(3,"bit-substmt -> positition-stmt"); } + | status_stmt { clicon_debug(3,"bit-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"bit-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"bit-substmt -> reference-stmt"); } + | { clicon_debug(3,"bit-substmt -> "); } ; /* position-stmt = position-keyword position-value-arg-str */ position_stmt : K_POSITION integer_value_str stmtend { if (ysp_add(_yy, Y_POSITION, $2, NULL) == NULL) _YYERROR("position_stmt"); - clicon_debug(2,"position-stmt -> POSITION integer-value"); } + clicon_debug(3,"position-stmt -> POSITION integer-value"); } ; /* status-stmt = status-keyword sep status-arg-str XXX: current-keyword*/ status_stmt : K_STATUS string stmtend { if (ysp_add(_yy, Y_STATUS, $2, NULL) == NULL) _YYERROR("status_stmt"); - clicon_debug(2,"status-stmt -> STATUS string"); } + clicon_debug(3,"status-stmt -> STATUS string"); } ; config_stmt : K_CONFIG bool_str stmtend { if (ysp_add(_yy, Y_CONFIG, $2, NULL) == NULL) _YYERROR("config_stmt"); - clicon_debug(2,"config-stmt -> CONFIG config-arg-str"); } + clicon_debug(3,"config-stmt -> CONFIG config-arg-str"); } ; /* mandatory-stmt = mandatory-keyword mandatory-arg-str */ mandatory_stmt : K_MANDATORY bool_str stmtend { yang_stmt *ys; if ((ys = ysp_add(_yy, Y_MANDATORY, $2, NULL))== NULL) _YYERROR("mandatory_stmt"); - clicon_debug(2,"mandatory-stmt -> MANDATORY mandatory-arg-str ;");} + clicon_debug(3,"mandatory-stmt -> MANDATORY mandatory-arg-str ;");} ; presence_stmt : K_PRESENCE string stmtend { yang_stmt *ys; if ((ys = ysp_add(_yy, Y_PRESENCE, $2, NULL))== NULL) _YYERROR("presence_stmt"); - clicon_debug(2,"presence-stmt -> PRESENCE string ;");} + clicon_debug(3,"presence-stmt -> PRESENCE string ;");} ; /* ordered-by-stmt = ordered-by-keyword sep ordered-by-arg-str */ ordered_by_stmt : K_ORDERED_BY string stmtend { yang_stmt *ys; if ((ys = ysp_add(_yy, Y_ORDERED_BY, $2, NULL))== NULL) _YYERROR("ordered_by_stmt"); - clicon_debug(2,"ordered-by-stmt -> ORDERED-BY ordered-by-arg ;");} + clicon_debug(3,"ordered-by-stmt -> ORDERED-BY ordered-by-arg ;");} ; /* must-stmt */ must_stmt : K_MUST string ';' { if (ysp_add(_yy, Y_MUST, $2, NULL) == NULL) _YYERROR("must_stmt"); - clicon_debug(2,"must-stmt -> MUST string ;"); } + clicon_debug(3,"must-stmt -> MUST string ;"); } | K_MUST string { if (ysp_add_push(_yy, Y_MUST, $2, NULL) == NULL) _YYERROR("must_stmt"); } '{' must_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("must_stmt"); - clicon_debug(2,"must-stmt -> MUST string { must-substmts }"); } + clicon_debug(3,"must-stmt -> MUST string { must-substmts }"); } ; must_substmts : must_substmts must_substmt - { clicon_debug(2,"must-substmts -> must-substmts must-substmt"); } + { clicon_debug(3,"must-substmts -> must-substmts must-substmt"); } | must_substmt - { clicon_debug(2,"must-substmts -> must-substmt"); } + { clicon_debug(3,"must-substmts -> must-substmt"); } ; -must_substmt : error_message_stmt { clicon_debug(2,"must-substmt -> error-message-stmt"); } - | error_app_tag_stmt { clicon_debug(2,"must-substmt -> error-app-tag-stmt"); } - | description_stmt { clicon_debug(2,"must-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"must-substmt -> reference-stmt"); } - | { clicon_debug(2,"must-substmt -> "); } +must_substmt : error_message_stmt { clicon_debug(3,"must-substmt -> error-message-stmt"); } + | error_app_tag_stmt { clicon_debug(3,"must-substmt -> error-app-tag-stmt"); } + | description_stmt { clicon_debug(3,"must-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"must-substmt -> reference-stmt"); } + | { clicon_debug(3,"must-substmt -> "); } ; /* error-message-stmt */ error_message_stmt : K_ERROR_MESSAGE string stmtend { if (ysp_add(_yy, Y_ERROR_MESSAGE, $2, NULL) == NULL) _YYERROR("error_message_stmt"); - clicon_debug(2,"error-message-stmt -> ERROR-MESSAGE string"); } + clicon_debug(3,"error-message-stmt -> ERROR-MESSAGE string"); } ; error_app_tag_stmt : K_ERROR_APP_TAG string stmtend { if (ysp_add(_yy, Y_ERROR_MESSAGE, $2, NULL) == NULL) _YYERROR("error_message_stmt"); - clicon_debug(2,"error-app-tag-stmt -> ERROR-APP-TAG string"); } + clicon_debug(3,"error-app-tag-stmt -> ERROR-APP-TAG string"); } ; /* min-elements-stmt = min-elements-keyword min-value-arg-str */ min_elements_stmt : K_MIN_ELEMENTS integer_value_str stmtend { if (ysp_add(_yy, Y_MIN_ELEMENTS, $2, NULL)== NULL) _YYERROR("min_elements_stmt"); - clicon_debug(2,"min-elements-stmt -> MIN-ELEMENTS integer ;");} + clicon_debug(3,"min-elements-stmt -> MIN-ELEMENTS integer ;");} ; /* max-elements-stmt = max-elements-keyword ("unbounded"|integer-value) @@ -1024,12 +1024,12 @@ min_elements_stmt : K_MIN_ELEMENTS integer_value_str stmtend */ max_elements_stmt : K_MAX_ELEMENTS string stmtend { if (ysp_add(_yy, Y_MAX_ELEMENTS, $2, NULL)== NULL) _YYERROR("max_elements_stmt"); - clicon_debug(2,"max-elements-stmt -> MIN-ELEMENTS integer ;");} + clicon_debug(3,"max-elements-stmt -> MIN-ELEMENTS integer ;");} ; value_stmt : K_VALUE integer_value_str stmtend { if (ysp_add(_yy, Y_VALUE, $2, NULL) == NULL) _YYERROR("value_stmt"); - clicon_debug(2,"value-stmt -> VALUE integer-value"); } + clicon_debug(3,"value-stmt -> VALUE integer-value"); } ; /* Grouping */ @@ -1037,324 +1037,324 @@ grouping_stmt : K_GROUPING identifier_str { if (ysp_add_push(_yy, Y_GROUPING, $2, NULL) == NULL) _YYERROR("grouping_stmt"); } '{' grouping_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("grouping_stmt"); - clicon_debug(2,"grouping-stmt -> GROUPING id-arg-str { grouping-substmts }"); } + clicon_debug(3,"grouping-stmt -> GROUPING id-arg-str { grouping-substmts }"); } ; grouping_substmts : grouping_substmts grouping_substmt - { clicon_debug(2,"grouping-substmts -> grouping-substmts grouping-substmt"); } + { clicon_debug(3,"grouping-substmts -> grouping-substmts grouping-substmt"); } | grouping_substmt - { clicon_debug(2,"grouping-substmts -> grouping-substmt"); } + { clicon_debug(3,"grouping-substmts -> grouping-substmt"); } ; -grouping_substmt : status_stmt { clicon_debug(2,"grouping-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"grouping-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"grouping-substmt -> reference-stmt"); } - | typedef_stmt { clicon_debug(2,"grouping-substmt -> typedef-stmt"); } - | grouping_stmt { clicon_debug(2,"grouping-substmt -> grouping-stmt"); } - | data_def_stmt { clicon_debug(2,"grouping-substmt -> data-def-stmt"); } - | action_stmt { clicon_debug(2,"grouping-substmt -> action-stmt"); } - | notification_stmt { clicon_debug(2,"grouping-substmt -> notification-stmt"); } - | unknown_stmt { clicon_debug(2,"container-substmt -> unknown-stmt");} - | { clicon_debug(2,"grouping-substmt -> "); } +grouping_substmt : status_stmt { clicon_debug(3,"grouping-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"grouping-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"grouping-substmt -> reference-stmt"); } + | typedef_stmt { clicon_debug(3,"grouping-substmt -> typedef-stmt"); } + | grouping_stmt { clicon_debug(3,"grouping-substmt -> grouping-stmt"); } + | data_def_stmt { clicon_debug(3,"grouping-substmt -> data-def-stmt"); } + | action_stmt { clicon_debug(3,"grouping-substmt -> action-stmt"); } + | notification_stmt { clicon_debug(3,"grouping-substmt -> notification-stmt"); } + | unknown_stmt { clicon_debug(3,"container-substmt -> unknown-stmt");} + | { clicon_debug(3,"grouping-substmt -> "); } ; /* container */ container_stmt : K_CONTAINER identifier_str ';' { if (ysp_add(_yy, Y_CONTAINER, $2, NULL) == NULL) _YYERROR("container_stmt"); - clicon_debug(2,"container-stmt -> CONTAINER id-arg-str ;");} + clicon_debug(3,"container-stmt -> CONTAINER id-arg-str ;");} | K_CONTAINER identifier_str { if (ysp_add_push(_yy, Y_CONTAINER, $2, NULL) == NULL) _YYERROR("container_stmt"); } '{' container_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("container_stmt"); - clicon_debug(2,"container-stmt -> CONTAINER id-arg-str { container-substmts }");} + clicon_debug(3,"container-stmt -> CONTAINER id-arg-str { container-substmts }");} ; container_substmts : container_substmts container_substmt | container_substmt ; -container_substmt : when_stmt { clicon_debug(2,"container-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"container-substmt -> if-feature-stmt"); } - | must_stmt { clicon_debug(2,"container-substmt -> must-stmt"); } - | presence_stmt { clicon_debug(2,"container-substmt -> presence-stmt"); } - | config_stmt { clicon_debug(2,"container-substmt -> config-stmt"); } - | status_stmt { clicon_debug(2,"container-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"container-substmt -> description-stmt");} - | reference_stmt { clicon_debug(2,"container-substmt -> reference-stmt"); } - | typedef_stmt { clicon_debug(2,"container-substmt -> typedef-stmt"); } - | grouping_stmt { clicon_debug(2,"container-substmt -> grouping-stmt"); } - | data_def_stmt { clicon_debug(2,"container-substmt -> data-def-stmt");} - | action_stmt { clicon_debug(2,"container-substmt -> action-stmt");} - | notification_stmt { clicon_debug(2,"container-substmt -> notification-stmt");} - | unknown_stmt { clicon_debug(2,"container-substmt -> unknown-stmt");} - | { clicon_debug(2,"container-substmt ->");} +container_substmt : when_stmt { clicon_debug(3,"container-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"container-substmt -> if-feature-stmt"); } + | must_stmt { clicon_debug(3,"container-substmt -> must-stmt"); } + | presence_stmt { clicon_debug(3,"container-substmt -> presence-stmt"); } + | config_stmt { clicon_debug(3,"container-substmt -> config-stmt"); } + | status_stmt { clicon_debug(3,"container-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"container-substmt -> description-stmt");} + | reference_stmt { clicon_debug(3,"container-substmt -> reference-stmt"); } + | typedef_stmt { clicon_debug(3,"container-substmt -> typedef-stmt"); } + | grouping_stmt { clicon_debug(3,"container-substmt -> grouping-stmt"); } + | data_def_stmt { clicon_debug(3,"container-substmt -> data-def-stmt");} + | action_stmt { clicon_debug(3,"container-substmt -> action-stmt");} + | notification_stmt { clicon_debug(3,"container-substmt -> notification-stmt");} + | unknown_stmt { clicon_debug(3,"container-substmt -> unknown-stmt");} + | { clicon_debug(3,"container-substmt ->");} ; leaf_stmt : K_LEAF identifier_str ';' { if (ysp_add(_yy, Y_LEAF, $2, NULL) == NULL) _YYERROR("leaf_stmt"); - clicon_debug(2,"leaf-stmt -> LEAF id-arg-str ;");} + clicon_debug(3,"leaf-stmt -> LEAF id-arg-str ;");} | K_LEAF identifier_str { if (ysp_add_push(_yy, Y_LEAF, $2, NULL) == NULL) _YYERROR("leaf_stmt"); } '{' leaf_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("leaf_stmt"); - clicon_debug(2,"leaf-stmt -> LEAF id-arg-str { lead-substmts }");} + clicon_debug(3,"leaf-stmt -> LEAF id-arg-str { lead-substmts }");} ; leaf_substmts : leaf_substmts leaf_substmt | leaf_substmt ; -leaf_substmt : when_stmt { clicon_debug(2,"leaf-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"leaf-substmt -> if-feature-stmt"); } - | type_stmt { clicon_debug(2,"leaf-substmt -> type-stmt"); } - | units_stmt { clicon_debug(2,"leaf-substmt -> units-stmt"); } - | must_stmt { clicon_debug(2,"leaf-substmt -> must-stmt"); } - | default_stmt { clicon_debug(2,"leaf-substmt -> default-stmt"); } - | config_stmt { clicon_debug(2,"leaf-substmt -> config-stmt"); } - | mandatory_stmt { clicon_debug(2,"leaf-substmt -> mandatory-stmt"); } - | status_stmt { clicon_debug(2,"leaf-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"leaf-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"leaf-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"leaf-substmt -> unknown-stmt");} - | { clicon_debug(2,"leaf-substmt ->"); } +leaf_substmt : when_stmt { clicon_debug(3,"leaf-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"leaf-substmt -> if-feature-stmt"); } + | type_stmt { clicon_debug(3,"leaf-substmt -> type-stmt"); } + | units_stmt { clicon_debug(3,"leaf-substmt -> units-stmt"); } + | must_stmt { clicon_debug(3,"leaf-substmt -> must-stmt"); } + | default_stmt { clicon_debug(3,"leaf-substmt -> default-stmt"); } + | config_stmt { clicon_debug(3,"leaf-substmt -> config-stmt"); } + | mandatory_stmt { clicon_debug(3,"leaf-substmt -> mandatory-stmt"); } + | status_stmt { clicon_debug(3,"leaf-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"leaf-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"leaf-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"leaf-substmt -> unknown-stmt");} + | { clicon_debug(3,"leaf-substmt ->"); } ; /* leaf-list */ leaf_list_stmt : K_LEAF_LIST identifier_str ';' { if (ysp_add(_yy, Y_LEAF_LIST, $2, NULL) == NULL) _YYERROR("leaf_list_stmt"); - clicon_debug(2,"leaf-list-stmt -> LEAF id-arg-str ;");} + clicon_debug(3,"leaf-list-stmt -> LEAF id-arg-str ;");} | K_LEAF_LIST identifier_str { if (ysp_add_push(_yy, Y_LEAF_LIST, $2, NULL) == NULL) _YYERROR("leaf_list_stmt"); } '{' leaf_list_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("leaf_list_stmt"); - clicon_debug(2,"leaf-list-stmt -> LEAF-LIST id-arg-str { lead-substmts }");} + clicon_debug(3,"leaf-list-stmt -> LEAF-LIST id-arg-str { lead-substmts }");} ; leaf_list_substmts : leaf_list_substmts leaf_list_substmt | leaf_list_substmt ; -leaf_list_substmt : when_stmt { clicon_debug(2,"leaf-list-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"leaf-list-substmt -> if-feature-stmt"); } - | type_stmt { clicon_debug(2,"leaf-list-substmt -> type-stmt"); } - | units_stmt { clicon_debug(2,"leaf-list-substmt -> units-stmt"); } - | must_stmt { clicon_debug(2,"leaf-list-substmt -> must-stmt"); } - | default_stmt { clicon_debug(2,"leaf-list-substmt -> default-stmt"); } - | config_stmt { clicon_debug(2,"leaf-list-substmt -> config-stmt"); } - | min_elements_stmt { clicon_debug(2,"leaf-list-substmt -> min-elements-stmt"); } - | max_elements_stmt { clicon_debug(2,"leaf-list-substmt -> max-elements-stmt"); } - | ordered_by_stmt { clicon_debug(2,"leaf-list-substmt -> ordered-by-stmt"); } - | status_stmt { clicon_debug(2,"leaf-list-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"leaf-list-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"leaf-list-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"leaf-list-substmt -> unknown-stmt");} - | { clicon_debug(2,"leaf-list-stmt ->"); } +leaf_list_substmt : when_stmt { clicon_debug(3,"leaf-list-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"leaf-list-substmt -> if-feature-stmt"); } + | type_stmt { clicon_debug(3,"leaf-list-substmt -> type-stmt"); } + | units_stmt { clicon_debug(3,"leaf-list-substmt -> units-stmt"); } + | must_stmt { clicon_debug(3,"leaf-list-substmt -> must-stmt"); } + | default_stmt { clicon_debug(3,"leaf-list-substmt -> default-stmt"); } + | config_stmt { clicon_debug(3,"leaf-list-substmt -> config-stmt"); } + | min_elements_stmt { clicon_debug(3,"leaf-list-substmt -> min-elements-stmt"); } + | max_elements_stmt { clicon_debug(3,"leaf-list-substmt -> max-elements-stmt"); } + | ordered_by_stmt { clicon_debug(3,"leaf-list-substmt -> ordered-by-stmt"); } + | status_stmt { clicon_debug(3,"leaf-list-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"leaf-list-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"leaf-list-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"leaf-list-substmt -> unknown-stmt");} + | { clicon_debug(3,"leaf-list-stmt ->"); } ; list_stmt : K_LIST identifier_str ';' { if (ysp_add(_yy, Y_LIST, $2, NULL) == NULL) _YYERROR("list_stmt"); - clicon_debug(2,"list-stmt -> LIST id-arg-str ;"); } + clicon_debug(3,"list-stmt -> LIST id-arg-str ;"); } | K_LIST identifier_str { if (ysp_add_push(_yy, Y_LIST, $2, NULL) == NULL) _YYERROR("list_stmt"); } '{' list_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("list_stmt"); - clicon_debug(2,"list-stmt -> LIST id-arg-str { list-substmts }"); } + clicon_debug(3,"list-stmt -> LIST id-arg-str { list-substmts }"); } ; list_substmts : list_substmts list_substmt - { clicon_debug(2,"list-substmts -> list-substmts list-substmt"); } + { clicon_debug(3,"list-substmts -> list-substmts list-substmt"); } | list_substmt - { clicon_debug(2,"list-substmts -> list-substmt"); } + { clicon_debug(3,"list-substmts -> list-substmt"); } ; -list_substmt : when_stmt { clicon_debug(2,"list-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"list-substmt -> if-feature-stmt"); } - | must_stmt { clicon_debug(2,"list-substmt -> must-stmt"); } - | key_stmt { clicon_debug(2,"list-substmt -> key-stmt"); } - | unique_stmt { clicon_debug(2,"list-substmt -> unique-stmt"); } - | config_stmt { clicon_debug(2,"list-substmt -> config-stmt"); } - | min_elements_stmt { clicon_debug(2,"list-substmt -> min-elements-stmt"); } - | max_elements_stmt { clicon_debug(2,"list-substmt -> max-elements-stmt"); } - | ordered_by_stmt { clicon_debug(2,"list-substmt -> ordered-by-stmt"); } - | status_stmt { clicon_debug(2,"list-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"list-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"list-substmt -> reference-stmt"); } - | typedef_stmt { clicon_debug(2,"list-substmt -> typedef-stmt"); } - | grouping_stmt { clicon_debug(2,"list-substmt -> grouping-stmt"); } - | data_def_stmt { clicon_debug(2,"list-substmt -> data-def-stmt"); } - | action_stmt { clicon_debug(2,"list-substmt -> action-stmt"); } - | notification_stmt { clicon_debug(2,"list-substmt -> notification-stmt"); } - | unknown_stmt { clicon_debug(2,"list-substmt -> unknown-stmt");} - | { clicon_debug(2,"list-substmt -> "); } +list_substmt : when_stmt { clicon_debug(3,"list-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"list-substmt -> if-feature-stmt"); } + | must_stmt { clicon_debug(3,"list-substmt -> must-stmt"); } + | key_stmt { clicon_debug(3,"list-substmt -> key-stmt"); } + | unique_stmt { clicon_debug(3,"list-substmt -> unique-stmt"); } + | config_stmt { clicon_debug(3,"list-substmt -> config-stmt"); } + | min_elements_stmt { clicon_debug(3,"list-substmt -> min-elements-stmt"); } + | max_elements_stmt { clicon_debug(3,"list-substmt -> max-elements-stmt"); } + | ordered_by_stmt { clicon_debug(3,"list-substmt -> ordered-by-stmt"); } + | status_stmt { clicon_debug(3,"list-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"list-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"list-substmt -> reference-stmt"); } + | typedef_stmt { clicon_debug(3,"list-substmt -> typedef-stmt"); } + | grouping_stmt { clicon_debug(3,"list-substmt -> grouping-stmt"); } + | data_def_stmt { clicon_debug(3,"list-substmt -> data-def-stmt"); } + | action_stmt { clicon_debug(3,"list-substmt -> action-stmt"); } + | notification_stmt { clicon_debug(3,"list-substmt -> notification-stmt"); } + | unknown_stmt { clicon_debug(3,"list-substmt -> unknown-stmt");} + | { clicon_debug(3,"list-substmt -> "); } ; /* key-stmt = key-keyword sep key-arg-str */ key_stmt : K_KEY string stmtend { if (ysp_add(_yy, Y_KEY, $2, NULL)== NULL) _YYERROR("key_stmt"); - clicon_debug(2,"key-stmt -> KEY id-arg-str ;");} + clicon_debug(3,"key-stmt -> KEY id-arg-str ;");} ; /* unique-stmt = unique-keyword unique-arg-str */ unique_stmt : K_UNIQUE string stmtend { if (ysp_add(_yy, Y_UNIQUE, $2, NULL)== NULL) _YYERROR("unique_stmt"); - clicon_debug(2,"key-stmt -> KEY id-arg-str ;");} + clicon_debug(3,"key-stmt -> KEY id-arg-str ;");} ; /* choice */ choice_stmt : K_CHOICE identifier_str ';' { if (ysp_add(_yy, Y_CHOICE, $2, NULL) == NULL) _YYERROR("choice_stmt"); - clicon_debug(2,"choice-stmt -> CHOICE id-arg-str ;"); } + clicon_debug(3,"choice-stmt -> CHOICE id-arg-str ;"); } | K_CHOICE identifier_str { if (ysp_add_push(_yy, Y_CHOICE, $2, NULL) == NULL) _YYERROR("choice_stmt"); } '{' choice_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("choice_stmt"); - clicon_debug(2,"choice-stmt -> CHOICE id-arg-str { choice-substmts }"); } + clicon_debug(3,"choice-stmt -> CHOICE id-arg-str { choice-substmts }"); } ; choice_substmts : choice_substmts choice_substmt - { clicon_debug(2,"choice-substmts -> choice-substmts choice-substmt"); } + { clicon_debug(3,"choice-substmts -> choice-substmts choice-substmt"); } | choice_substmt - { clicon_debug(2,"choice-substmts -> choice-substmt"); } + { clicon_debug(3,"choice-substmts -> choice-substmt"); } ; -choice_substmt : when_stmt { clicon_debug(2,"choice-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"choice-substmt -> if-feature-stmt"); } - | default_stmt { clicon_debug(2,"choice-substmt -> default-stmt"); } - | config_stmt { clicon_debug(2,"choice-substmt -> config-stmt"); } - | mandatory_stmt { clicon_debug(2,"choice-substmt -> mandatory-stmt"); } - | status_stmt { clicon_debug(2,"choice-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"choice-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"choice-substmt -> reference-stmt"); } - | short_case_stmt { clicon_debug(2,"choice-substmt -> short-case-stmt");} - | case_stmt { clicon_debug(2,"choice-substmt -> case-stmt");} - | unknown_stmt { clicon_debug(2,"choice-substmt -> unknown-stmt");} - | { clicon_debug(2,"choice-substmt -> "); } +choice_substmt : when_stmt { clicon_debug(3,"choice-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"choice-substmt -> if-feature-stmt"); } + | default_stmt { clicon_debug(3,"choice-substmt -> default-stmt"); } + | config_stmt { clicon_debug(3,"choice-substmt -> config-stmt"); } + | mandatory_stmt { clicon_debug(3,"choice-substmt -> mandatory-stmt"); } + | status_stmt { clicon_debug(3,"choice-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"choice-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"choice-substmt -> reference-stmt"); } + | short_case_stmt { clicon_debug(3,"choice-substmt -> short-case-stmt");} + | case_stmt { clicon_debug(3,"choice-substmt -> case-stmt");} + | unknown_stmt { clicon_debug(3,"choice-substmt -> unknown-stmt");} + | { clicon_debug(3,"choice-substmt -> "); } ; /* case */ case_stmt : K_CASE identifier_str ';' { if (ysp_add(_yy, Y_CASE, $2, NULL) == NULL) _YYERROR("case_stmt"); - clicon_debug(2,"case-stmt -> CASE id-arg-str ;"); } + clicon_debug(3,"case-stmt -> CASE id-arg-str ;"); } | K_CASE identifier_str { if (ysp_add_push(_yy, Y_CASE, $2, NULL) == NULL) _YYERROR("case_stmt"); } '{' case_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("case_stmt"); - clicon_debug(2,"case-stmt -> CASE id-arg-str { case-substmts }"); } + clicon_debug(3,"case-stmt -> CASE id-arg-str { case-substmts }"); } ; case_substmts : case_substmts case_substmt - { clicon_debug(2,"case-substmts -> case-substmts case-substmt"); } + { clicon_debug(3,"case-substmts -> case-substmts case-substmt"); } | case_substmt - { clicon_debug(2,"case-substmts -> case-substmt"); } + { clicon_debug(3,"case-substmts -> case-substmt"); } ; -case_substmt : when_stmt { clicon_debug(2,"case-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"case-substmt -> if-feature-stmt"); } - | status_stmt { clicon_debug(2,"case-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"case-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"case-substmt -> reference-stmt"); } - | data_def_stmt { clicon_debug(2,"case-substmt -> data-def-stmt");} - | unknown_stmt { clicon_debug(2,"case-substmt -> unknown-stmt");} - | { clicon_debug(2,"case-substmt -> "); } +case_substmt : when_stmt { clicon_debug(3,"case-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"case-substmt -> if-feature-stmt"); } + | status_stmt { clicon_debug(3,"case-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"case-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"case-substmt -> reference-stmt"); } + | data_def_stmt { clicon_debug(3,"case-substmt -> data-def-stmt");} + | unknown_stmt { clicon_debug(3,"case-substmt -> unknown-stmt");} + | { clicon_debug(3,"case-substmt -> "); } ; anydata_stmt : K_ANYDATA identifier_str ';' { if (ysp_add(_yy, Y_ANYDATA, $2, NULL) == NULL) _YYERROR("anydata_stmt"); - clicon_debug(2,"anydata-stmt -> ANYDATA id-arg-str ;"); } + clicon_debug(3,"anydata-stmt -> ANYDATA id-arg-str ;"); } | K_ANYDATA identifier_str { if (ysp_add_push(_yy, Y_ANYDATA, $2, NULL) == NULL) _YYERROR("anydata_stmt"); } '{' anyxml_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("anydata_stmt"); - clicon_debug(2,"anydata-stmt -> ANYDATA id-arg-str { anyxml-substmts }"); } + clicon_debug(3,"anydata-stmt -> ANYDATA id-arg-str { anyxml-substmts }"); } ; /* anyxml */ anyxml_stmt : K_ANYXML identifier_str ';' { if (ysp_add(_yy, Y_ANYXML, $2, NULL) == NULL) _YYERROR("anyxml_stmt"); - clicon_debug(2,"anyxml-stmt -> ANYXML id-arg-str ;"); } + clicon_debug(3,"anyxml-stmt -> ANYXML id-arg-str ;"); } | K_ANYXML identifier_str { if (ysp_add_push(_yy, Y_ANYXML, $2, NULL) == NULL) _YYERROR("anyxml_stmt"); } '{' anyxml_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("anyxml_stmt"); - clicon_debug(2,"anyxml-stmt -> ANYXML id-arg-str { anyxml-substmts }"); } + clicon_debug(3,"anyxml-stmt -> ANYXML id-arg-str { anyxml-substmts }"); } ; anyxml_substmts : anyxml_substmts anyxml_substmt - { clicon_debug(2,"anyxml-substmts -> anyxml-substmts anyxml-substmt"); } + { clicon_debug(3,"anyxml-substmts -> anyxml-substmts anyxml-substmt"); } | anyxml_substmt - { clicon_debug(2,"anyxml-substmts -> anyxml-substmt"); } + { clicon_debug(3,"anyxml-substmts -> anyxml-substmt"); } ; -anyxml_substmt : when_stmt { clicon_debug(2,"anyxml-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"anyxml-substmt -> if-feature-stmt"); } - | must_stmt { clicon_debug(2,"anyxml-substmt -> must-stmt"); } - | config_stmt { clicon_debug(2,"anyxml-substmt -> config-stmt"); } - | mandatory_stmt { clicon_debug(2,"anyxml-substmt -> mandatory-stmt"); } - | status_stmt { clicon_debug(2,"anyxml-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"anyxml-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"anyxml-substmt -> reference-stmt"); } - | ustring ':' ustring ';' { free($1); free($3); clicon_debug(2,"anyxml-substmt -> anyxml extension"); } - | unknown_stmt { clicon_debug(2,"anyxml-substmt -> unknown-stmt");} +anyxml_substmt : when_stmt { clicon_debug(3,"anyxml-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"anyxml-substmt -> if-feature-stmt"); } + | must_stmt { clicon_debug(3,"anyxml-substmt -> must-stmt"); } + | config_stmt { clicon_debug(3,"anyxml-substmt -> config-stmt"); } + | mandatory_stmt { clicon_debug(3,"anyxml-substmt -> mandatory-stmt"); } + | status_stmt { clicon_debug(3,"anyxml-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"anyxml-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"anyxml-substmt -> reference-stmt"); } + | ustring ':' ustring ';' { free($1); free($3); clicon_debug(3,"anyxml-substmt -> anyxml extension"); } + | unknown_stmt { clicon_debug(3,"anyxml-substmt -> unknown-stmt");} ; /* uses-stmt = uses-keyword identifier-ref-arg-str */ uses_stmt : K_USES identifier_ref_str ';' { if (ysp_add(_yy, Y_USES, $2, NULL) == NULL) _YYERROR("uses_stmt"); - clicon_debug(2,"uses-stmt -> USES id-arg-str ;"); } + clicon_debug(3,"uses-stmt -> USES id-arg-str ;"); } | K_USES identifier_ref_str { if (ysp_add_push(_yy, Y_USES, $2, NULL) == NULL) _YYERROR("uses_stmt"); } '{' uses_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("uses_stmt"); - clicon_debug(2,"uses-stmt -> USES id-arg-str { uses-substmts }"); } + clicon_debug(3,"uses-stmt -> USES id-arg-str { uses-substmts }"); } ; uses_substmts : uses_substmts uses_substmt - { clicon_debug(2,"uses-substmts -> uses-substmts uses-substmt"); } + { clicon_debug(3,"uses-substmts -> uses-substmts uses-substmt"); } | uses_substmt - { clicon_debug(2,"uses-substmts -> uses-substmt"); } + { clicon_debug(3,"uses-substmts -> uses-substmt"); } ; -uses_substmt : when_stmt { clicon_debug(2,"uses-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"uses-substmt -> if-feature-stmt"); } - | status_stmt { clicon_debug(2,"uses-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"uses-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"uses-substmt -> reference-stmt"); } - | refine_stmt { clicon_debug(2,"uses-substmt -> refine-stmt"); } - | uses_augment_stmt { clicon_debug(2,"uses-substmt -> uses-augment-stmt"); } - | unknown_stmt { clicon_debug(2,"uses-substmt -> unknown-stmt");} - | { clicon_debug(2,"uses-substmt -> "); } +uses_substmt : when_stmt { clicon_debug(3,"uses-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"uses-substmt -> if-feature-stmt"); } + | status_stmt { clicon_debug(3,"uses-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"uses-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"uses-substmt -> reference-stmt"); } + | refine_stmt { clicon_debug(3,"uses-substmt -> refine-stmt"); } + | uses_augment_stmt { clicon_debug(3,"uses-substmt -> uses-augment-stmt"); } + | unknown_stmt { clicon_debug(3,"uses-substmt -> unknown-stmt");} + | { clicon_debug(3,"uses-substmt -> "); } ; /* refine-stmt = refine-keyword sep refine-arg-str */ refine_stmt : K_REFINE desc_schema_nodeid_strs ';' { if (ysp_add(_yy, Y_REFINE, $2, NULL) == NULL) _YYERROR("refine_stmt"); - clicon_debug(2,"refine-stmt -> REFINE id-arg-str ;"); } + clicon_debug(3,"refine-stmt -> REFINE id-arg-str ;"); } | K_REFINE desc_schema_nodeid_strs { if (ysp_add_push(_yy, Y_REFINE, $2, NULL) == NULL) _YYERROR("refine_stmt"); } '{' refine_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("refine_stmt"); - clicon_debug(2,"refine-stmt -> REFINE id-arg-str { refine-substmts }"); } + clicon_debug(3,"refine-stmt -> REFINE id-arg-str { refine-substmts }"); } ; refine_substmts : refine_substmts refine_substmt - { clicon_debug(2,"refine-substmts -> refine-substmts refine-substmt"); } + { clicon_debug(3,"refine-substmts -> refine-substmts refine-substmt"); } | refine_substmt - { clicon_debug(2,"refine-substmts -> refine-substmt"); } + { clicon_debug(3,"refine-substmts -> refine-substmt"); } ; -refine_substmt : if_feature_stmt { clicon_debug(2,"refine-substmt -> if-feature-stmt"); } - | must_stmt { clicon_debug(2,"refine-substmt -> must-stmt"); } - | presence_stmt { clicon_debug(2,"refine-substmt -> presence-stmt"); } - | default_stmt { clicon_debug(2,"refine-substmt -> default-stmt"); } - | config_stmt { clicon_debug(2,"refine-substmt -> config-stmt"); } - | mandatory_stmt { clicon_debug(2,"refine-substmt -> mandatory-stmt"); } - | min_elements_stmt { clicon_debug(2,"refine-substmt -> min-elements-stmt"); } - | max_elements_stmt { clicon_debug(2,"refine-substmt -> max-elements-stmt"); } - | description_stmt { clicon_debug(2,"refine-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"refine-substmt -> reference-stmt"); } - | unknown_stmt { clicon_debug(2,"refine-substmt -> unknown-stmt");} - | { clicon_debug(2,"refine-substmt -> "); } +refine_substmt : if_feature_stmt { clicon_debug(3,"refine-substmt -> if-feature-stmt"); } + | must_stmt { clicon_debug(3,"refine-substmt -> must-stmt"); } + | presence_stmt { clicon_debug(3,"refine-substmt -> presence-stmt"); } + | default_stmt { clicon_debug(3,"refine-substmt -> default-stmt"); } + | config_stmt { clicon_debug(3,"refine-substmt -> config-stmt"); } + | mandatory_stmt { clicon_debug(3,"refine-substmt -> mandatory-stmt"); } + | min_elements_stmt { clicon_debug(3,"refine-substmt -> min-elements-stmt"); } + | max_elements_stmt { clicon_debug(3,"refine-substmt -> max-elements-stmt"); } + | description_stmt { clicon_debug(3,"refine-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"refine-substmt -> reference-stmt"); } + | unknown_stmt { clicon_debug(3,"refine-substmt -> unknown-stmt");} + | { clicon_debug(3,"refine-substmt -> "); } ; /* uses-augment-stmt = augment-keyword augment-arg-str @@ -1364,7 +1364,7 @@ uses_augment_stmt : K_AUGMENT string { if (ysp_add_push(_yy, Y_AUGMENT, $2, NULL) == NULL) _YYERROR("uses_augment_stmt"); } '{' augment_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("uses_augment_stmt"); - clicon_debug(2,"uses-augment-stmt -> AUGMENT desc-schema-node-str { augment-substmts }"); } + clicon_debug(3,"uses-augment-stmt -> AUGMENT desc-schema-node-str { augment-substmts }"); } /* augment-stmt = augment-keyword sep augment-arg-str @@ -1375,116 +1375,116 @@ augment_stmt : K_AUGMENT string { if (ysp_add_push(_yy, Y_AUGMENT, $2, NULL) == NULL) _YYERROR("augment_stmt"); } '{' augment_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("augment_stmt"); - clicon_debug(2,"augment-stmt -> AUGMENT abs-schema-node-str { augment-substmts }"); } + clicon_debug(3,"augment-stmt -> AUGMENT abs-schema-node-str { augment-substmts }"); } ; augment_substmts : augment_substmts augment_substmt - { clicon_debug(2,"augment-substmts -> augment-substmts augment-substmt"); } + { clicon_debug(3,"augment-substmts -> augment-substmts augment-substmt"); } | augment_substmt - { clicon_debug(2,"augment-substmts -> augment-substmt"); } + { clicon_debug(3,"augment-substmts -> augment-substmt"); } ; -augment_substmt : when_stmt { clicon_debug(2,"augment-substmt -> when-stmt"); } - | if_feature_stmt { clicon_debug(2,"augment-substmt -> if-feature-stmt"); } - | status_stmt { clicon_debug(2,"augment-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"augment-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"augment-substmt -> reference-stmt"); } - | data_def_stmt { clicon_debug(2,"augment-substmt -> data-def-stmt"); } - | case_stmt { clicon_debug(2,"augment-substmt -> case-stmt");} - | action_stmt { clicon_debug(2,"augment-substmt -> action-stmt");} - | notification_stmt { clicon_debug(2,"augment-substmt -> notification-stmt");} - | { clicon_debug(2,"augment-substmt -> "); } +augment_substmt : when_stmt { clicon_debug(3,"augment-substmt -> when-stmt"); } + | if_feature_stmt { clicon_debug(3,"augment-substmt -> if-feature-stmt"); } + | status_stmt { clicon_debug(3,"augment-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"augment-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"augment-substmt -> reference-stmt"); } + | data_def_stmt { clicon_debug(3,"augment-substmt -> data-def-stmt"); } + | case_stmt { clicon_debug(3,"augment-substmt -> case-stmt");} + | action_stmt { clicon_debug(3,"augment-substmt -> action-stmt");} + | notification_stmt { clicon_debug(3,"augment-substmt -> notification-stmt");} + | { clicon_debug(3,"augment-substmt -> "); } ; /* when */ when_stmt : K_WHEN string ';' { if (ysp_add(_yy, Y_WHEN, $2, NULL) == NULL) _YYERROR("when_stmt"); - clicon_debug(2,"when-stmt -> WHEN string ;"); } + clicon_debug(3,"when-stmt -> WHEN string ;"); } | K_WHEN string { if (ysp_add_push(_yy, Y_WHEN, $2, NULL) == NULL) _YYERROR("when_stmt"); } '{' when_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("when_stmt"); - clicon_debug(2,"when-stmt -> WHEN string { when-substmts }"); } + clicon_debug(3,"when-stmt -> WHEN string { when-substmts }"); } ; when_substmts : when_substmts when_substmt - { clicon_debug(2,"when-substmts -> when-substmts when-substmt"); } + { clicon_debug(3,"when-substmts -> when-substmts when-substmt"); } | when_substmt - { clicon_debug(2,"when-substmts -> when-substmt"); } + { clicon_debug(3,"when-substmts -> when-substmt"); } ; -when_substmt : description_stmt { clicon_debug(2,"when-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"when-substmt -> reference-stmt"); } - | { clicon_debug(2,"when-substmt -> "); } +when_substmt : description_stmt { clicon_debug(3,"when-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"when-substmt -> reference-stmt"); } + | { clicon_debug(3,"when-substmt -> "); } ; /* rpc */ rpc_stmt : K_RPC identifier_str ';' { if (ysp_add(_yy, Y_RPC, $2, NULL) == NULL) _YYERROR("rpc_stmt"); - clicon_debug(2,"rpc-stmt -> RPC id-arg-str ;"); } + clicon_debug(3,"rpc-stmt -> RPC id-arg-str ;"); } | K_RPC identifier_str { if (ysp_add_push(_yy, Y_RPC, $2, NULL) == NULL) _YYERROR("rpc_stmt"); } '{' rpc_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("rpc_stmt"); - clicon_debug(2,"rpc-stmt -> RPC id-arg-str { rpc-substmts }"); } + clicon_debug(3,"rpc-stmt -> RPC id-arg-str { rpc-substmts }"); } ; rpc_substmts : rpc_substmts rpc_substmt - { clicon_debug(2,"rpc-substmts -> rpc-substmts rpc-substmt"); } + { clicon_debug(3,"rpc-substmts -> rpc-substmts rpc-substmt"); } | rpc_substmt - { clicon_debug(2,"rpc-substmts -> rpc-substmt"); } + { clicon_debug(3,"rpc-substmts -> rpc-substmt"); } ; -rpc_substmt : if_feature_stmt { clicon_debug(2,"rpc-substmt -> if-feature-stmt"); } - | status_stmt { clicon_debug(2,"rpc-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"rpc-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"rpc-substmt -> reference-stmt"); } - | typedef_stmt { clicon_debug(2,"rpc-substmt -> typedef-stmt"); } - | grouping_stmt { clicon_debug(2,"rpc-substmt -> grouping-stmt"); } - | input_stmt { clicon_debug(2,"rpc-substmt -> input-stmt"); } - | output_stmt { clicon_debug(2,"rpc-substmt -> output-stmt"); } - | unknown_stmt { clicon_debug(2,"rpc-substmt -> unknown-stmt");} - | { clicon_debug(2,"rpc-substmt -> "); } +rpc_substmt : if_feature_stmt { clicon_debug(3,"rpc-substmt -> if-feature-stmt"); } + | status_stmt { clicon_debug(3,"rpc-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"rpc-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"rpc-substmt -> reference-stmt"); } + | typedef_stmt { clicon_debug(3,"rpc-substmt -> typedef-stmt"); } + | grouping_stmt { clicon_debug(3,"rpc-substmt -> grouping-stmt"); } + | input_stmt { clicon_debug(3,"rpc-substmt -> input-stmt"); } + | output_stmt { clicon_debug(3,"rpc-substmt -> output-stmt"); } + | unknown_stmt { clicon_debug(3,"rpc-substmt -> unknown-stmt");} + | { clicon_debug(3,"rpc-substmt -> "); } ; /* action */ action_stmt : K_ACTION identifier_str ';' { if (ysp_add(_yy, Y_ACTION, $2, NULL) == NULL) _YYERROR("action_stmt"); - clicon_debug(2,"action-stmt -> ACTION id-arg-str ;"); } + clicon_debug(3,"action-stmt -> ACTION id-arg-str ;"); } | K_ACTION identifier_str { if (ysp_add_push(_yy, Y_ACTION, $2, NULL) == NULL) _YYERROR("action_stmt"); } '{' rpc_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("action_stmt"); - clicon_debug(2,"action-stmt -> ACTION id-arg-str { rpc-substmts }"); } + clicon_debug(3,"action-stmt -> ACTION id-arg-str { rpc-substmts }"); } ; /* notification */ notification_stmt : K_NOTIFICATION identifier_str ';' { if (ysp_add(_yy, Y_NOTIFICATION, $2, NULL) == NULL) _YYERROR("notification_stmt"); - clicon_debug(2,"notification-stmt -> NOTIFICATION id-arg-str ;"); } + clicon_debug(3,"notification-stmt -> NOTIFICATION id-arg-str ;"); } | K_NOTIFICATION identifier_str { if (ysp_add_push(_yy, Y_NOTIFICATION, $2, NULL) == NULL) _YYERROR("notification_stmt"); } '{' notification_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("notification_stmt"); - clicon_debug(2,"notification-stmt -> NOTIFICATION id-arg-str { notification-substmts }"); } + clicon_debug(3,"notification-stmt -> NOTIFICATION id-arg-str { notification-substmts }"); } ; notification_substmts : notification_substmts notification_substmt - { clicon_debug(2,"notification-substmts -> notification-substmts notification-substmt"); } + { clicon_debug(3,"notification-substmts -> notification-substmts notification-substmt"); } | notification_substmt - { clicon_debug(2,"notification-substmts -> notification-substmt"); } + { clicon_debug(3,"notification-substmts -> notification-substmt"); } ; -notification_substmt : if_feature_stmt { clicon_debug(2,"notification-substmt -> if-feature-stmt"); } - | must_stmt { clicon_debug(2,"notification-substmt -> must-stmt"); } - | status_stmt { clicon_debug(2,"notification-substmt -> status-stmt"); } - | description_stmt { clicon_debug(2,"notification-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"notification-substmt -> reference-stmt"); } - | typedef_stmt { clicon_debug(2,"notification-substmt -> typedef-stmt"); } - | grouping_stmt { clicon_debug(2,"notification-substmt -> grouping-stmt"); } - | data_def_stmt { clicon_debug(2,"notification-substmt -> data-def-stmt"); } - | unknown_stmt { clicon_debug(2,"notification-substmt -> unknown-stmt");} - | { clicon_debug(2,"notification-substmt -> "); } +notification_substmt : if_feature_stmt { clicon_debug(3,"notification-substmt -> if-feature-stmt"); } + | must_stmt { clicon_debug(3,"notification-substmt -> must-stmt"); } + | status_stmt { clicon_debug(3,"notification-substmt -> status-stmt"); } + | description_stmt { clicon_debug(3,"notification-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"notification-substmt -> reference-stmt"); } + | typedef_stmt { clicon_debug(3,"notification-substmt -> typedef-stmt"); } + | grouping_stmt { clicon_debug(3,"notification-substmt -> grouping-stmt"); } + | data_def_stmt { clicon_debug(3,"notification-substmt -> data-def-stmt"); } + | unknown_stmt { clicon_debug(3,"notification-substmt -> unknown-stmt");} + | { clicon_debug(3,"notification-substmt -> "); } ; /* deviation /oc-sys:system/oc-sys:config/oc-sys:hostname { @@ -1497,18 +1497,18 @@ deviation_stmt : K_DEVIATION string { if (ysp_add_push(_yy, Y_DEVIATION, $2, NULL) == NULL) _YYERROR("deviation_stmt"); } '{' deviation_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("deviation_stmt"); - clicon_debug(2,"deviation-stmt -> DEVIATION id-arg-str { notification-substmts }"); } + clicon_debug(3,"deviation-stmt -> DEVIATION id-arg-str { notification-substmts }"); } ; deviation_substmts : deviation_substmts deviation_substmt - { clicon_debug(2,"deviation-substmts -> deviation-substmts deviation-substmt"); } + { clicon_debug(3,"deviation-substmts -> deviation-substmts deviation-substmt"); } | deviation_substmt - { clicon_debug(2,"deviation-substmts -> deviation-substmt"); } + { clicon_debug(3,"deviation-substmts -> deviation-substmt"); } ; -deviation_substmt : description_stmt { clicon_debug(2,"deviation-substmt -> description-stmt"); } - | reference_stmt { clicon_debug(2,"deviation-substmt -> reference-stmt"); } - | deviate_stmt { clicon_debug(2,"deviation-substmt -> deviate-stmt"); } +deviation_substmt : description_stmt { clicon_debug(3,"deviation-substmt -> description-stmt"); } + | reference_stmt { clicon_debug(3,"deviation-substmt -> reference-stmt"); } + | deviate_stmt { clicon_debug(3,"deviation-substmt -> deviate-stmt"); } ; /* RFC7950 differentiates between deviate-not-supported, deviate-add, @@ -1517,12 +1517,12 @@ deviation_substmt : description_stmt { clicon_debug(2,"deviation-substmt -> des */ deviate_stmt : K_DEVIATE string ';' { if (ysp_add(_yy, Y_DEVIATE, $2, NULL) == NULL) _YYERROR("notification_stmt"); - clicon_debug(2,"deviate-not-supported-stmt -> DEVIATE string ;"); } + clicon_debug(3,"deviate-not-supported-stmt -> DEVIATE string ;"); } | K_DEVIATE string { if (ysp_add_push(_yy, Y_DEVIATE, $2, NULL) == NULL) _YYERROR("deviate_stmt"); } '{' deviate_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("deviate_stmt"); - clicon_debug(2,"deviate-stmt -> DEVIATE string { deviate-substmts }"); } + clicon_debug(3,"deviate-stmt -> DEVIATE string { deviate-substmts }"); } ; /* RFC7950 differentiates between deviate-not-supported, deviate-add, @@ -1530,21 +1530,21 @@ deviate_stmt : K_DEVIATE string ';' * deviate-substmt rule. For now, until "deviate" gets supported. */ deviate_substmts : deviate_substmts deviate_substmt - { clicon_debug(2,"deviate-substmts -> deviate-substmts deviate-substmt"); } + { clicon_debug(3,"deviate-substmts -> deviate-substmts deviate-substmt"); } | deviate_substmt - { clicon_debug(2,"deviate-substmts -> deviate-substmt"); } + { clicon_debug(3,"deviate-substmts -> deviate-substmt"); } ; /* Bundled */ -deviate_substmt : type_stmt { clicon_debug(2,"deviate-substmt -> type-stmt"); } - | units_stmt { clicon_debug(2,"deviate-substmt -> units-stmt"); } - | must_stmt { clicon_debug(2,"deviate-substmt -> must-stmt"); } - | unique_stmt { clicon_debug(2,"deviate-substmt -> unique-stmt"); } - | default_stmt { clicon_debug(2,"deviate-substmt -> default-stmt"); } - | config_stmt { clicon_debug(2,"deviate-substmt -> config-stmt"); } - | mandatory_stmt { clicon_debug(2,"deviate-substmt -> mandatory-stmt"); } - | min_elements_stmt { clicon_debug(2,"deviate-substmt -> min-elements-stmt"); } - | max_elements_stmt { clicon_debug(2,"deviate-substmt -> max-elements-stmt"); } - | { clicon_debug(2,"deviate-substmt -> "); } +deviate_substmt : type_stmt { clicon_debug(3,"deviate-substmt -> type-stmt"); } + | units_stmt { clicon_debug(3,"deviate-substmt -> units-stmt"); } + | must_stmt { clicon_debug(3,"deviate-substmt -> must-stmt"); } + | unique_stmt { clicon_debug(3,"deviate-substmt -> unique-stmt"); } + | default_stmt { clicon_debug(3,"deviate-substmt -> default-stmt"); } + | config_stmt { clicon_debug(3,"deviate-substmt -> config-stmt"); } + | mandatory_stmt { clicon_debug(3,"deviate-substmt -> mandatory-stmt"); } + | min_elements_stmt { clicon_debug(3,"deviate-substmt -> min-elements-stmt"); } + | max_elements_stmt { clicon_debug(3,"deviate-substmt -> max-elements-stmt"); } + | { clicon_debug(3,"deviate-substmt -> "); } ; @@ -1559,140 +1559,140 @@ deviate_substmt : type_stmt { clicon_debug(2,"deviate-substmt -> type-st unknown_stmt : ustring ':' ustring optsep ';' { char *id; if ((id=string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt"); if (ysp_add(_yy, Y_UNKNOWN, id, NULL) == NULL) _YYERROR("unknown_stmt"); - clicon_debug(2,"unknown-stmt -> ustring : ustring"); + clicon_debug(3,"unknown-stmt -> ustring : ustring"); } | ustring ':' ustring SEP string optsep ';' { char *id; if ((id=string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt"); if (ysp_add(_yy, Y_UNKNOWN, id, $5) == NULL){ _YYERROR("unknwon_stmt"); } - clicon_debug(2,"unknown-stmt -> ustring : ustring string"); + clicon_debug(3,"unknown-stmt -> ustring : ustring string"); } | ustring ':' ustring optsep { char *id; if ((id=string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt"); if (ysp_add_push(_yy, Y_UNKNOWN, id, NULL) == NULL) _YYERROR("unknown_stmt"); } '{' yang_stmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("unknown_stmt"); - clicon_debug(2,"unknown-stmt -> ustring : ustring { yang-stmts }"); } + clicon_debug(3,"unknown-stmt -> ustring : ustring { yang-stmts }"); } | ustring ':' ustring SEP string optsep { char *id; if ((id=string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt"); if (ysp_add_push(_yy, Y_UNKNOWN, id, $5) == NULL) _YYERROR("unknown_stmt"); } '{' yang_stmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("unknown_stmt"); - clicon_debug(2,"unknown-stmt -> ustring : ustring string { yang-stmts }"); } + clicon_debug(3,"unknown-stmt -> ustring : ustring string { yang-stmts }"); } ; -yang_stmts : yang_stmts yang_stmt { clicon_debug(2,"yang-stmts -> yang-stmts yang-stmt"); } - | yang_stmt { clicon_debug(2,"yang-stmts -> yang-stmt");} +yang_stmts : yang_stmts yang_stmt { clicon_debug(3,"yang-stmts -> yang-stmts yang-stmt"); } + | yang_stmt { clicon_debug(3,"yang-stmts -> yang-stmt");} ; -yang_stmt : action_stmt { clicon_debug(2,"yang-stmt -> action-stmt");} - | anydata_stmt { clicon_debug(2,"yang-stmt -> anydata-stmt");} - | anyxml_stmt { clicon_debug(2,"yang-stmt -> anyxml-stmt");} - | argument_stmt { clicon_debug(2,"yang-stmt -> argument-stmt");} - | augment_stmt { clicon_debug(2,"yang-stmt -> augment-stmt");} - | base_stmt { clicon_debug(2,"yang-stmt -> base-stmt");} - | bit_stmt { clicon_debug(2,"yang-stmt -> bit-stmt");} - | case_stmt { clicon_debug(2,"yang-stmt -> case-stmt");} - | choice_stmt { clicon_debug(2,"yang-stmt -> choice-stmt");} - | config_stmt { clicon_debug(2,"yang-stmt -> config-stmt");} - | contact_stmt { clicon_debug(2,"yang-stmt -> contact-stmt");} - | container_stmt { clicon_debug(2,"yang-stmt -> container-stmt");} - | default_stmt { clicon_debug(2,"yang-stmt -> default-stmt");} - | description_stmt { clicon_debug(2,"yang-stmt -> description-stmt");} - | deviate_stmt { clicon_debug(2,"yang-stmt -> deviate-stmt");} +yang_stmt : action_stmt { clicon_debug(3,"yang-stmt -> action-stmt");} + | anydata_stmt { clicon_debug(3,"yang-stmt -> anydata-stmt");} + | anyxml_stmt { clicon_debug(3,"yang-stmt -> anyxml-stmt");} + | argument_stmt { clicon_debug(3,"yang-stmt -> argument-stmt");} + | augment_stmt { clicon_debug(3,"yang-stmt -> augment-stmt");} + | base_stmt { clicon_debug(3,"yang-stmt -> base-stmt");} + | bit_stmt { clicon_debug(3,"yang-stmt -> bit-stmt");} + | case_stmt { clicon_debug(3,"yang-stmt -> case-stmt");} + | choice_stmt { clicon_debug(3,"yang-stmt -> choice-stmt");} + | config_stmt { clicon_debug(3,"yang-stmt -> config-stmt");} + | contact_stmt { clicon_debug(3,"yang-stmt -> contact-stmt");} + | container_stmt { clicon_debug(3,"yang-stmt -> container-stmt");} + | default_stmt { clicon_debug(3,"yang-stmt -> default-stmt");} + | description_stmt { clicon_debug(3,"yang-stmt -> description-stmt");} + | deviate_stmt { clicon_debug(3,"yang-stmt -> deviate-stmt");} /* deviate is not yet implemented, the above may be replaced by the following lines - | deviate_add_stmt { clicon_debug(2,"yang-stmt -> deviate-add-stmt");} - | deviate_delete_stmt { clicon_debug(2,"yang-stmt -> deviate-add-stmt");} - | deviate_replace_stmt { clicon_debug(2,"yang-stmt -> deviate-add-stmt");} + | deviate_add_stmt { clicon_debug(3,"yang-stmt -> deviate-add-stmt");} + | deviate_delete_stmt { clicon_debug(3,"yang-stmt -> deviate-add-stmt");} + | deviate_replace_stmt { clicon_debug(3,"yang-stmt -> deviate-add-stmt");} */ - | deviation_stmt { clicon_debug(2,"yang-stmt -> deviation-stmt");} - | enum_stmt { clicon_debug(2,"yang-stmt -> enum-stmt");} - | error_app_tag_stmt { clicon_debug(2,"yang-stmt -> error-app-tag-stmt");} - | error_message_stmt { clicon_debug(2,"yang-stmt -> error-message-stmt");} - | extension_stmt { clicon_debug(2,"yang-stmt -> extension-stmt");} - | feature_stmt { clicon_debug(2,"yang-stmt -> feature-stmt");} - | fraction_digits_stmt { clicon_debug(2,"yang-stmt -> fraction-digits-stmt");} - | grouping_stmt { clicon_debug(2,"yang-stmt -> grouping-stmt");} - | identity_stmt { clicon_debug(2,"yang-stmt -> identity-stmt");} - | if_feature_stmt { clicon_debug(2,"yang-stmt -> if-feature-stmt");} - | import_stmt { clicon_debug(2,"yang-stmt -> import-stmt");} - | include_stmt { clicon_debug(2,"yang-stmt -> include-stmt");} - | input_stmt { clicon_debug(2,"yang-stmt -> input-stmt");} - | key_stmt { clicon_debug(2,"yang-stmt -> key-stmt");} - | leaf_list_stmt { clicon_debug(2,"yang-stmt -> leaf-list-stmt");} - | leaf_stmt { clicon_debug(2,"yang-stmt -> leaf-stmt");} - | length_stmt { clicon_debug(2,"yang-stmt -> length-stmt");} - | list_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | mandatory_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | max_elements_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | min_elements_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | modifier_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | module_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | must_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | namespace_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | notification_stmt { clicon_debug(2,"yang-stmt -> notification-stmt");} - | ordered_by_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | organization_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | output_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | path_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | pattern_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | position_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | prefix_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | presence_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | range_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | reference_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | refine_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | require_instance_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | revision_date_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | revision_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | rpc_stmt { clicon_debug(2,"yang-stmt -> rpc-stmt");} - | status_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | submodule_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | typedef_stmt { clicon_debug(2,"yang-stmt -> typedef-stmt");} - | type_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | unique_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | units_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | uses_augment_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | uses_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | value_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | when_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} - | yang_version_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} -/* | yin_element_stmt { clicon_debug(2,"yang-stmt -> list-stmt");} */ + | deviation_stmt { clicon_debug(3,"yang-stmt -> deviation-stmt");} + | enum_stmt { clicon_debug(3,"yang-stmt -> enum-stmt");} + | error_app_tag_stmt { clicon_debug(3,"yang-stmt -> error-app-tag-stmt");} + | error_message_stmt { clicon_debug(3,"yang-stmt -> error-message-stmt");} + | extension_stmt { clicon_debug(3,"yang-stmt -> extension-stmt");} + | feature_stmt { clicon_debug(3,"yang-stmt -> feature-stmt");} + | fraction_digits_stmt { clicon_debug(3,"yang-stmt -> fraction-digits-stmt");} + | grouping_stmt { clicon_debug(3,"yang-stmt -> grouping-stmt");} + | identity_stmt { clicon_debug(3,"yang-stmt -> identity-stmt");} + | if_feature_stmt { clicon_debug(3,"yang-stmt -> if-feature-stmt");} + | import_stmt { clicon_debug(3,"yang-stmt -> import-stmt");} + | include_stmt { clicon_debug(3,"yang-stmt -> include-stmt");} + | input_stmt { clicon_debug(3,"yang-stmt -> input-stmt");} + | key_stmt { clicon_debug(3,"yang-stmt -> key-stmt");} + | leaf_list_stmt { clicon_debug(3,"yang-stmt -> leaf-list-stmt");} + | leaf_stmt { clicon_debug(3,"yang-stmt -> leaf-stmt");} + | length_stmt { clicon_debug(3,"yang-stmt -> length-stmt");} + | list_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | mandatory_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | max_elements_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | min_elements_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | modifier_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | module_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | must_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | namespace_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | notification_stmt { clicon_debug(3,"yang-stmt -> notification-stmt");} + | ordered_by_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | organization_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | output_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | path_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | pattern_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | position_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | prefix_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | presence_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | range_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | reference_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | refine_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | require_instance_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | revision_date_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | revision_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | rpc_stmt { clicon_debug(3,"yang-stmt -> rpc-stmt");} + | status_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | submodule_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | typedef_stmt { clicon_debug(3,"yang-stmt -> typedef-stmt");} + | type_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | unique_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | units_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | uses_augment_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | uses_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | value_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | when_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} + | yang_version_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} +/* | yin_element_stmt { clicon_debug(3,"yang-stmt -> list-stmt");} */ ; /* body */ -body_stmts : body_stmts body_stmt { clicon_debug(2,"body-stmts -> body-stmts body-stmt"); } - | body_stmt { clicon_debug(2,"body-stmts -> body-stmt");} +body_stmts : body_stmts body_stmt { clicon_debug(3,"body-stmts -> body-stmts body-stmt"); } + | body_stmt { clicon_debug(3,"body-stmts -> body-stmt");} ; -body_stmt : extension_stmt { clicon_debug(2,"body-stmt -> extension-stmt");} - | feature_stmt { clicon_debug(2,"body-stmt -> feature-stmt");} - | identity_stmt { clicon_debug(2,"body-stmt -> identity-stmt");} - | typedef_stmt { clicon_debug(2,"body-stmt -> typedef-stmt");} - | grouping_stmt { clicon_debug(2,"body-stmt -> grouping-stmt");} - | data_def_stmt { clicon_debug(2,"body-stmt -> data-def-stmt");} - | augment_stmt { clicon_debug(2,"body-stmt -> augment-stmt");} - | rpc_stmt { clicon_debug(2,"body-stmt -> rpc-stmt");} - | notification_stmt { clicon_debug(2,"body-stmt -> notification-stmt");} - | deviation_stmt { clicon_debug(2,"body-stmt -> deviation-stmt");} +body_stmt : extension_stmt { clicon_debug(3,"body-stmt -> extension-stmt");} + | feature_stmt { clicon_debug(3,"body-stmt -> feature-stmt");} + | identity_stmt { clicon_debug(3,"body-stmt -> identity-stmt");} + | typedef_stmt { clicon_debug(3,"body-stmt -> typedef-stmt");} + | grouping_stmt { clicon_debug(3,"body-stmt -> grouping-stmt");} + | data_def_stmt { clicon_debug(3,"body-stmt -> data-def-stmt");} + | augment_stmt { clicon_debug(3,"body-stmt -> augment-stmt");} + | rpc_stmt { clicon_debug(3,"body-stmt -> rpc-stmt");} + | notification_stmt { clicon_debug(3,"body-stmt -> notification-stmt");} + | deviation_stmt { clicon_debug(3,"body-stmt -> deviation-stmt");} ; -data_def_stmt : container_stmt { clicon_debug(2,"data-def-stmt -> container-stmt");} - | leaf_stmt { clicon_debug(2,"data-def-stmt -> leaf-stmt");} - | leaf_list_stmt { clicon_debug(2,"data-def-stmt -> leaf-list-stmt");} - | list_stmt { clicon_debug(2,"data-def-stmt -> list-stmt");} - | choice_stmt { clicon_debug(2,"data-def-stmt -> choice-stmt");} - | anydata_stmt { clicon_debug(2,"data-def-stmt -> anydata-stmt");} - | anyxml_stmt { clicon_debug(2,"data-def-stmt -> anyxml-stmt");} - | uses_stmt { clicon_debug(2,"data-def-stmt -> uses-stmt");} +data_def_stmt : container_stmt { clicon_debug(3,"data-def-stmt -> container-stmt");} + | leaf_stmt { clicon_debug(3,"data-def-stmt -> leaf-stmt");} + | leaf_list_stmt { clicon_debug(3,"data-def-stmt -> leaf-list-stmt");} + | list_stmt { clicon_debug(3,"data-def-stmt -> list-stmt");} + | choice_stmt { clicon_debug(3,"data-def-stmt -> choice-stmt");} + | anydata_stmt { clicon_debug(3,"data-def-stmt -> anydata-stmt");} + | anyxml_stmt { clicon_debug(3,"data-def-stmt -> anyxml-stmt");} + | uses_stmt { clicon_debug(3,"data-def-stmt -> uses-stmt");} ; /* short-case */ -short_case_stmt : container_stmt { clicon_debug(2,"short-case-substmt -> container-stmt"); } - | leaf_stmt { clicon_debug(2,"short-case-substmt -> leaf-stmt"); } - | leaf_list_stmt { clicon_debug(2,"short-case-substmt -> leaf-list-stmt"); } - | list_stmt { clicon_debug(2,"short-case-substmt -> list-stmt"); } - | anydata_stmt { clicon_debug(2,"short-case-substmt -> anydata-stmt");} - | anyxml_stmt { clicon_debug(2,"short-case-substmt -> anyxml-stmt");} +short_case_stmt : container_stmt { clicon_debug(3,"short-case-substmt -> container-stmt"); } + | leaf_stmt { clicon_debug(3,"short-case-substmt -> leaf-stmt"); } + | leaf_list_stmt { clicon_debug(3,"short-case-substmt -> leaf-list-stmt"); } + | list_stmt { clicon_debug(3,"short-case-substmt -> list-stmt"); } + | anydata_stmt { clicon_debug(3,"short-case-substmt -> anydata-stmt");} + | anyxml_stmt { clicon_debug(3,"short-case-substmt -> anyxml-stmt");} ; @@ -1701,19 +1701,19 @@ input_stmt : K_INPUT { if (ysp_add_push(_yy, Y_INPUT, NULL, NULL) == NULL) _YYERROR("input_stmt"); } '{' input_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("input_stmt"); - clicon_debug(2,"input-stmt -> INPUT { input-substmts }"); } + clicon_debug(3,"input-stmt -> INPUT { input-substmts }"); } ; input_substmts : input_substmts input_substmt - { clicon_debug(2,"input-substmts -> input-substmts input-substmt"); } + { clicon_debug(3,"input-substmts -> input-substmts input-substmt"); } | input_substmt - { clicon_debug(2,"input-substmts -> input-substmt"); } + { clicon_debug(3,"input-substmts -> input-substmt"); } ; -input_substmt : typedef_stmt { clicon_debug(2,"input-substmt -> typedef-stmt"); } - | grouping_stmt { clicon_debug(2,"input-substmt -> grouping-stmt"); } - | data_def_stmt { clicon_debug(2,"input-substmt -> data-def-stmt"); } - | { clicon_debug(2,"input-substmt -> "); } +input_substmt : typedef_stmt { clicon_debug(3,"input-substmt -> typedef-stmt"); } + | grouping_stmt { clicon_debug(3,"input-substmt -> grouping-stmt"); } + | data_def_stmt { clicon_debug(3,"input-substmt -> data-def-stmt"); } + | { clicon_debug(3,"input-substmt -> "); } ; /* output */ @@ -1721,11 +1721,11 @@ output_stmt : K_OUTPUT /* XXX reuse input-substatements since they are same */ { if (ysp_add_push(_yy, Y_OUTPUT, NULL, NULL) == NULL) _YYERROR("output_stmt"); } '{' input_substmts '}' { if (ystack_pop(_yy) < 0) _YYERROR("output_stmt"); - clicon_debug(2,"output-stmt -> OUTPUT { input-substmts }"); } + clicon_debug(3,"output-stmt -> OUTPUT { input-substmts }"); } ; -string : qstrings { $$=$1; clicon_debug(2,"string -> qstrings (%s)", $1); } - | ustring { $$=$1; clicon_debug(2,"string -> ustring (%s)", $1); } +string : qstrings { $$=$1; clicon_debug(3,"string -> qstrings (%s)", $1); } + | ustring { $$=$1; clicon_debug(3,"string -> ustring (%s)", $1); } ; /* quoted string */ @@ -1735,16 +1735,16 @@ qstrings : qstrings '+' qstring $$ = realloc($1, len + strlen($3) + 1); sprintf($$+len, "%s", $3); free($3); - clicon_debug(2,"qstrings-> qstrings + qstring"); + clicon_debug(3,"qstrings-> qstrings + qstring"); } | qstring - { $$=$1; clicon_debug(2,"qstrings-> qstring"); } + { $$=$1; clicon_debug(3,"qstrings-> qstring"); } ; -qstring : '"' ustring '"' { $$=$2; clicon_debug(2,"string-> \" ustring \"");} - | '"' '"' { $$=strdup(""); clicon_debug(2,"string-> \" \"");} - | SQ ustring SQ { $$=$2; clicon_debug(2,"string-> ' ustring '"); } - | SQ SQ { $$=strdup(""); clicon_debug(2,"string-> ' '");} +qstring : '"' ustring '"' { $$=$2; clicon_debug(3,"string-> \" ustring \"");} + | '"' '"' { $$=strdup(""); clicon_debug(3,"string-> \" \"");} + | SQ ustring SQ { $$=$2; clicon_debug(3,"string-> ' ustring '"); } + | SQ SQ { $$=strdup(""); clicon_debug(3,"string-> ' '");} ; /* unquoted string */ @@ -1754,7 +1754,7 @@ ustring : ustring CHARS $$ = realloc($1, len+strlen($2) + 1); sprintf($$+len, "%s", $2); free($2); - clicon_debug(2,"ustring-> string + CHARS"); + clicon_debug(3,"ustring-> string + CHARS"); } | CHARS {$$=$1; } @@ -1762,10 +1762,10 @@ ustring : ustring CHARS abs_schema_nodeid : abs_schema_nodeid '/' node_identifier { if (($$=string_del_join($1, "/", $3)) == NULL) _YYERROR("abs_schema_nodeid"); - clicon_debug(2,"absolute-schema-nodeid -> absolute-schema-nodeid / node-identifier"); } + clicon_debug(3,"absolute-schema-nodeid -> absolute-schema-nodeid / node-identifier"); } | '/' node_identifier { if (($$=string_del_join(NULL, "/", $2)) == NULL) _YYERROR("abs_schema_nodeid"); - clicon_debug(2,"absolute-schema-nodeid -> / node-identifier"); } + clicon_debug(3,"absolute-schema-nodeid -> / node-identifier"); } ; desc_schema_nodeid_strs : desc_schema_nodeid_strs '+' desc_schema_nodeid_str @@ -1774,35 +1774,35 @@ desc_schema_nodeid_strs : desc_schema_nodeid_strs '+' desc_schema_nodeid_str $$ = realloc($1, len + strlen($3) + 1); sprintf($$+len, "%s", $3); free($3); - clicon_debug(2,"desc-schema-nodeid-strs-> desc-schema-nodeid-strs + desc-schema-nodeid-str"); + clicon_debug(3,"desc-schema-nodeid-strs-> desc-schema-nodeid-strs + desc-schema-nodeid-str"); } | desc_schema_nodeid_str - { $$=$1; clicon_debug(2,"desc-schema-nodeid-strs-> desc-schema-nodeid-str"); } + { $$=$1; clicon_debug(3,"desc-schema-nodeid-strs-> desc-schema-nodeid-str"); } ; desc_schema_nodeid_str : desc_schema_nodeid - { $$=$1; clicon_debug(2,"descendant-schema-nodeid-str -> descendant-schema-nodeid"); } + { $$=$1; clicon_debug(3,"descendant-schema-nodeid-str -> descendant-schema-nodeid"); } | '"' desc_schema_nodeid '"' - { $$=$2; clicon_debug(2,"descendant-schema-nodeid-str -> descendant-schema-nodeid"); } + { $$=$2; clicon_debug(3,"descendant-schema-nodeid-str -> descendant-schema-nodeid"); } ; /* descendant-schema-nodeid */ desc_schema_nodeid : node_identifier - { $$= $1; clicon_debug(2,"descendant-schema-nodeid -> node_identifier"); } + { $$= $1; clicon_debug(3,"descendant-schema-nodeid -> node_identifier"); } | node_identifier abs_schema_nodeid - { if (($$=string_del_join($1, " ", $2)) == NULL) _YYERROR("desc_schema_nodeid");clicon_debug(2,"descendant-schema-nodeid -> node_identifier abs_schema_nodeid"); } + { if (($$=string_del_join($1, " ", $2)) == NULL) _YYERROR("desc_schema_nodeid");clicon_debug(3,"descendant-schema-nodeid -> node_identifier abs_schema_nodeid"); } ; identifier_str : '"' IDENTIFIER '"' { $$ = $2; - clicon_debug(2,"identifier_str -> \" IDENTIFIER \" ");} + clicon_debug(3,"identifier_str -> \" IDENTIFIER \" ");} | IDENTIFIER { $$ = $1; - clicon_debug(2,"identifier_str -> IDENTIFIER ");} + clicon_debug(3,"identifier_str -> IDENTIFIER ");} ; identifier_ref_str : '"' identifier_ref '"' { $$ = $2; - clicon_debug(2,"identifier_ref_str -> \" identifier_ref \" ");} + clicon_debug(3,"identifier_ref_str -> \" identifier_ref \" ");} | identifier_ref { $$ = $1; - clicon_debug(2,"identifier_ref_str -> identifier_ref ");} + clicon_debug(3,"identifier_ref_str -> identifier_ref ");} ; integer_value_str : '"' INT '"' { $$=$2; } @@ -1810,18 +1810,18 @@ integer_value_str : '"' INT '"' { $$=$2; } ; bool_str : '"' BOOL '"' { $$ = $2; - clicon_debug(2,"bool_str -> \" BOOL \" ");} + clicon_debug(3,"bool_str -> \" BOOL \" ");} | BOOL { $$ = $1; - clicon_debug(2,"bool_str -> BOOL ");} + clicon_debug(3,"bool_str -> BOOL ");} ; /* node-identifier = [prefix ":"] identifier */ node_identifier : IDENTIFIER - { $$=$1; clicon_debug(2,"identifier-ref-arg-str -> string"); } + { $$=$1; clicon_debug(3,"identifier-ref-arg-str -> string"); } | IDENTIFIER ':' IDENTIFIER { if (($$=string_del_join($1, ":", $3)) == NULL) _YYERROR("node_identifier"); - clicon_debug(2,"identifier-ref-arg-str -> prefix : string"); } + clicon_debug(3,"identifier-ref-arg-str -> prefix : string"); } ; /* ;;; Basic Rules */