Fixed: YANG parsing: unknown-stmt was not allowed within another unknown-stmt
This commit is contained in:
parent
abaf122bfc
commit
648b416cb9
2 changed files with 13 additions and 7 deletions
|
|
@ -1629,7 +1629,7 @@ unknown_stmt : ustring ':' ustring optsep ';'
|
||||||
if ((id=clixon_string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt");
|
if ((id=clixon_string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt");
|
||||||
free($3);
|
free($3);
|
||||||
if (ysp_add_push(_yy, Y_UNKNOWN, id, NULL) == NULL) _YYERROR("unknown_stmt"); }
|
if (ysp_add_push(_yy, Y_UNKNOWN, id, NULL) == NULL) _YYERROR("unknown_stmt"); }
|
||||||
'{' yang_stmts '}'
|
'{' unknown_substmts '}'
|
||||||
{ if (ystack_pop(_yy) < 0) _YYERROR("unknown_stmt");
|
{ if (ystack_pop(_yy) < 0) _YYERROR("unknown_stmt");
|
||||||
_PARSE_DEBUG("unknown-stmt -> ustring : ustring { yang-stmts }"); }
|
_PARSE_DEBUG("unknown-stmt -> ustring : ustring { yang-stmts }"); }
|
||||||
| ustring ':' ustring sep string optsep
|
| ustring ':' ustring sep string optsep
|
||||||
|
|
@ -1638,15 +1638,21 @@ unknown_stmt : ustring ':' ustring optsep ';'
|
||||||
if ((id=clixon_string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt");
|
if ((id=clixon_string_del_join($1, ":", $3)) == NULL) _YYERROR("unknown_stmt");
|
||||||
free($3);
|
free($3);
|
||||||
if (ysp_add_push(_yy, Y_UNKNOWN, id, $5) == NULL) _YYERROR("unknown_stmt"); }
|
if (ysp_add_push(_yy, Y_UNKNOWN, id, $5) == NULL) _YYERROR("unknown_stmt"); }
|
||||||
'{' yang_stmts '}'
|
'{' unknown_substmts '}'
|
||||||
{ if (ystack_pop(_yy) < 0) _YYERROR("unknown_stmt");
|
{ if (ystack_pop(_yy) < 0) _YYERROR("unknown_stmt");
|
||||||
_PARSE_DEBUG("unknown-stmt -> ustring : ustring string { yang-stmts }"); }
|
_PARSE_DEBUG("unknown-stmt -> ustring : ustring string { yang-stmts }"); }
|
||||||
;
|
;
|
||||||
|
|
||||||
yang_stmts : yang_stmts yang_stmt { _PARSE_DEBUG("yang-stmts -> yang-stmts yang-stmt"); }
|
unknown_substmts : unknown_substmts unknown_substmt
|
||||||
| yang_stmt { _PARSE_DEBUG("yang-stmts -> yang-stmt");}
|
{ _PARSE_DEBUG("unknown-substmts -> unknown-substmts unknown-substmt"); }
|
||||||
|
| unknown_substmt
|
||||||
|
{ _PARSE_DEBUG("unknown-substmts -> unknown-substmt"); }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
unknown_substmt : yang_stmt { _PARSE_DEBUG("unknown-substmt -> yang-stmt");}
|
||||||
|
| unknown_stmt { _PARSE_DEBUG("unknown-substmt -> unknown-stmt");}
|
||||||
|
;
|
||||||
|
|
||||||
yang_stmt : action_stmt { _PARSE_DEBUG("yang-stmt -> action-stmt");}
|
yang_stmt : action_stmt { _PARSE_DEBUG("yang-stmt -> action-stmt");}
|
||||||
| anydata_stmt { _PARSE_DEBUG("yang-stmt -> anydata-stmt");}
|
| anydata_stmt { _PARSE_DEBUG("yang-stmt -> anydata-stmt");}
|
||||||
| anyxml_stmt { _PARSE_DEBUG("yang-stmt -> anyxml-stmt");}
|
| anyxml_stmt { _PARSE_DEBUG("yang-stmt -> anyxml-stmt");}
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,9 @@ EOF
|
||||||
|
|
||||||
new "yangmodels parse: -f $cfg"
|
new "yangmodels parse: -f $cfg"
|
||||||
|
|
||||||
# Publishged IEEE YANGs
|
# Published IEEE YANGs
|
||||||
# 1906.1 something w spaces
|
# 1906.1 something w spaces
|
||||||
for d in 802 802.1 802.3; do
|
for d in 1906.1 802 802.1 802.3; do
|
||||||
new "Published IEEE Yangs: ${YANG_STANDARD_DIR}/ieee/published/$d"
|
new "Published IEEE Yangs: ${YANG_STANDARD_DIR}/ieee/published/$d"
|
||||||
expectpart "$($clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=${YANG_STANDARD_DIR}/ieee/published/$d show version)" 0 "${CLIXON_VERSION}"
|
expectpart "$($clixon_cli -D $DBG -1f $cfg -o CLICON_YANG_MAIN_DIR=${YANG_STANDARD_DIR}/ieee/published/$d show version)" 0 "${CLIXON_VERSION}"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue