CliXoN
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
clixon_yang_parse.y File Reference
#include "clixon_config.h"
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <assert.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#include <cligen/cligen.h>
#include "clixon_queue.h"
#include "clixon_hash.h"
#include "clixon_handle.h"
#include "clixon_err.h"
#include "clixon_log.h"
#include "clixon_yang.h"
#include "clixon_yang_parse.h"

Macros

#define _YY   ((struct clicon_yang_yacc_arg *)_yy)
 
#define _YYERROR(msg)   {clicon_debug(2, "YYERROR %s '%s' %d", (msg), clixon_yang_parsetext, _YY->yy_linenum); YYERROR;}
 
#define YY_(msgid)   msgid
 

Functions

int clicon_yang_debug (int d)
 
void clixon_yang_parseerror (void *_yy, char *s)
 
int yang_parse_init (struct clicon_yang_yacc_arg *yy, yang_spec *ysp)
 
int yang_parse_exit (struct clicon_yang_yacc_arg *yy)
 
int ystack_pop (struct clicon_yang_yacc_arg *yy)
 
struct ys_stackystack_push (struct clicon_yang_yacc_arg *yy, yang_node *yn)
 
static yang_stmt * ysp_add (struct clicon_yang_yacc_arg *yy, enum rfc_6020 keyword, char *argument)
 
static yang_stmt * ysp_add_push (struct clicon_yang_yacc_arg *yy, int keyword, char *argument)
 
static char * prefix_id_join (char *prefix, char *id)
 
 clicon_debug (2,"unknown-stmt")
 
 _YYERROR ("0")
 
submodule_stmt clicon_debug (2,"submodule -> id-arg-str { submodule-stmts }")
 
 clicon_debug (2,"revision-stmt -> date-arg-str ;")
 
 clicon_debug (2,"container-stmt -> CONTAINER id-arg-str ;")
 
 clicon_debug (2,"leaf-stmt -> LEAF id-arg-str ;")
 
 clicon_debug (2,"leaf-list-stmt -> LEAF id-arg-str ;")
 
 clicon_debug (2,"list-stmt -> LIST id-arg-str ;")
 
 clicon_debug (2,"choice-stmt -> CHOICE id-arg-str ;")
 
 clicon_debug (2,"case-stmt -> CASE id-arg-str ;")
 
 clicon_debug (2,"uses-stmt -> USES id-arg-str ;")
 
 clicon_debug (2,"refine-stmt -> REFINE id-arg-str ;")
 
 clicon_debug (2,"when-stmt -> WHEN string ;")
 
 clicon_debug (2,"rpc-stmt -> RPC id-arg-str ;")
 
 clicon_debug (2,"type-stmt -> TYPE identifier-ref-arg-str ;")
 
 clicon_debug (2,"length-stmt -> LENGTH string ;")
 
 clicon_debug (2,"pattern-stmt -> PATTERN string ;")
 
 clicon_debug (2,"feature-stmt -> FEATURE id-arg-str ;")
 
 clicon_debug (2,"identity-stmt -> IDENTITY string ;")
 
 clicon_debug (2,"range-stmt -> RANGE string ;")
 
 clicon_debug (2,"enum-stmt -> ENUM string ;")
 
 clicon_debug (2,"bit-stmt -> BIT string ;")
 
 clicon_debug (2,"must-stmt -> MUST string ;")
 
 clicon_debug (2,"yang-version-stmt -> YANG-VERSION string")
 
 clicon_debug (2,"fraction-digits-stmt -> FRACTION-DIGITS string")
 
 clicon_debug (2,"if-feature-stmt -> IF-FEATURE identifier-ref-arg-str")
 
 clicon_debug (2,"value-stmt -> VALUE integer-value")
 
 clicon_debug (2,"position-stmt -> POSITION integer-value")
 
 clicon_debug (2,"status-stmt -> STATUS string")
 
 clicon_debug (2,"config-stmt -> CONFIG config-arg-str")
 
 clicon_debug (2,"base-stmt -> BASE identifier-ref-arg-str")
 
 clicon_debug (2,"path-stmt -> PATH string")
 
 clicon_debug (2,"require-instance-stmt -> REQUIRE-INSTANCE string")
 
 clicon_debug (2,"units-stmt -> UNITS string")
 
 clicon_debug (2,"default-stmt -> DEFAULT string")
 
 clicon_debug (2,"contact-stmt -> CONTACT string")
 
 clicon_debug (2,"revision-date-stmt -> date;")
 
 clicon_debug (2,"include-stmt -> id-arg-str")
 
 clicon_debug (2,"namespace-stmt -> NAMESPACE string")
 
 clicon_debug (2,"prefix-stmt -> PREFIX string ;")
 
 clicon_debug (2,"description-stmt -> DESCRIPTION string ;")
 
 clicon_debug (2,"organization-stmt -> ORGANIZATION string ;")
 
 clicon_debug (2,"min-elements-stmt -> MIN-ELEMENTS integer ;")
 
 clicon_debug (2,"max-elements-stmt -> MIN-ELEMENTS integer ;")
 
 clicon_debug (2,"reference-stmt -> REFERENCE string ;")
 
 if ((ys=ysp_add(_yy, Y_MANDATORY, $2))==NULL) _YYERROR("102")
 
 clicon_debug (2,"mandatory-stmt -> MANDATORY mandatory-arg-str ;")
 
 if ((ys=ysp_add(_yy, Y_PRESENCE, $2))==NULL) _YYERROR("102")
 
 clicon_debug (2,"presence-stmt -> PRESENCE string ;")
 
 if ((ys=ysp_add(_yy, Y_ORDERED_BY, $2))==NULL) _YYERROR("102")
 
 clicon_debug (2,"ordered-by-stmt -> ORDERED-BY ordered-by-arg ;")
 
 clicon_debug (2,"key-stmt -> KEY id-arg-str ;") { if (ysp_add(_yy, Y_UNIQUE, $2)== NULL) _YYERROR("104")
 
identifier_ref_arg_str clicon_debug (2,"identifier-ref-arg-str -> string")
 
string clicon_debug (2,"identifier-ref-arg-str -> prefix : string")
 
 clicon_debug (2,"id-arg-str -> string")
 
 clicon_debug (2,"string -> qstrings (%s)", $1)
 
 clicon_debug (2,"string -> ustring (%s)", $1)
 
 sprintf ($$+len,"%s", $3)
 
 free ($3)
 
 clicon_debug (2,"qstrings-> qstrings + qstring")
 
 clicon_debug (2,"qstrings-> qstring")
 
 clicon_debug (2,"string-> \" ustring \"")
 

Variables

typedef_stmt typedef substmts
typedef substmts typedef 
substmt
 
typedef_substmt typedef
substmt type 
stmt
 
file __pad0__
 
 YYACCEPT
 
submodule_stmt MY_EOF { clicon_debug(2,"file->submodule-stmt")
 
unknown_stmt __pad1__
 
unknown_stmt unknown statement
 
module_stmt __pad2__
 
module_stmt Y_MODULE
 
module_stmt module_substmts
 
module_stmt module substmts
module substmts module 
substm
 
 module_substmt { clicon_debug(2,"module-substmts ->")
 
module_substmt __pad3__
 
module_substmt 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")
 
submodule_stmt __pad4__ { clicon_debug(2,"module-substmt ->")
 
submodule_stmt Y_SUBMODULE
 
submodule_substmts __pad5__
 
 submodule_substmt { clicon_debug(2,"submodule-stmts -> submodule-substmt")
 
submodule_substmt __pad6__
 
module_header_stmts __pad7__ { clicon_debug(2,"submodule-substmt ->")
 
 module_header_stmt { clicon_debug(2,"module-header-stmts -> ")
 
module_header_stmt __pad8__
 
 namespace_stmt { clicon_debug(2,"module-header-stmt -> namespace-stmt")
 
 prefix_stmt { clicon_debug(2,"module-header-stmt -> prefix-stmt")
 
submodule_header_stmts __pad9__
 
 submodule_header_stmt { clicon_debug(2,"submodule-header-stmts -> submodule-header-stmt")
 
submodule_header_stmt __pad10__
 
linkage_stmts __pad11__
 
 linkage_stmt { clicon_debug(2,"linkage-stmts -> linkage-stmt")
 
linkage_stmt __pad12__
 
 include_stmt { clicon_debug(2,"linkage-stmt -> include-stmt")
 
revision_stmts __pad13__
 
 revision_stmt { clicon_debug(2,"revision-stmts -> ")
 
revision_stmt __pad14__
 
revision_substmts __pad15__
 
 revision_substmt { clicon_debug(2,"revision-substmts -> }")
 
revision_substmt __pad16__
 
 reference_stmt { clicon_debug(2,"revision-substmt -> reference-stmt")
 
meta_stmts __pad17__ { clicon_debug(2,"revision-substmt -> ")
 
 meta_stmt { clicon_debug(2,"meta-stmts -> meta-stmt")
 
meta_stmt __pad18__
 
 contact_stmt { clicon_debug(2,"meta-stmt -> contact-stmt")
 
 description_stmt { clicon_debug(2,"meta-stmt -> description-stmt")
 
body_stmts __pad19__
 
 body_stmt { clicon_debug(2,"body-stmts -> body-stmt")
 
body_stmt __pad20__
 
 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")
 
data_def_stmt __pad21__
 
 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")
 
 uses_stmt { clicon_debug(2,"data-def-stmt -> uses-stmt")
 
container_stmt __pad22__
 
K_CONTAINER id_arg_str { if (ysp_add_push(_yy, Y_CONTAINER, $2) == NULL) _YYERROR("8")
 
container_substmts __pad23__
 
container_substmt __pad24__
 
 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")
 
leaf_stmt __pad25__ { clicon_debug(2,"container-substmt ->")
 
leaf_substmts __pad26__
 
leaf_substmt __pad27__
 
 type_stmt { clicon_debug(2,"leaf-substmt -> type-stmt")
 
 units_stmt { clicon_debug(2,"leaf-substmt -> units-stmt")
 
 default_stmt { clicon_debug(2,"leaf-substmt -> default-stmt")
 
 mandatory_stmt { clicon_debug(2,"leaf-substmt -> mandatory-stmt")
 
leaf_list_stmt __pad28__ { clicon_debug(2,"leaf-substmt ->")
 
leaf_list_substmts __pad29__
 
leaf_list_substmt __pad30__
 
 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")
 
list_stmt __pad31__ { clicon_debug(2,"leaf-list-stmt ->")
 
list_substmts __pad32__
 
 list_substmt { clicon_debug(2,"list-substmts -> list-substmt")
 
list_substmt __pad33__
 
 key_stmt { clicon_debug(2,"list-substmt -> key-stmt")
 
 unique_stmt { clicon_debug(2,"list-substmt -> unique-stmt")
 
choice_stmt __pad34__ { clicon_debug(2,"list-substmt -> ")
 
choice_substmts __pad35__
 
 choice_substmt { clicon_debug(2,"choice-substmts -> choice-substmt")
 
choice_substmt __pad36__
 
 short_case_stmt { clicon_debug(2,"choice-substmt -> short-case-stmt")
 
 case_stmt { clicon_debug(2,"choice-substmt -> case-stmt")
 
short_case_stmt __pad37__ { clicon_debug(2,"choice-substmt -> ")
 
case_stmt __pad38__
 
case_substmts __pad39__
 
 case_substmt { clicon_debug(2,"case-substmts -> case-substmt")
 
case_substmt __pad40__
 
uses_stmt __pad41__ { clicon_debug(2,"case-substmt -> ")
 
K_USES identifier_ref_arg_str { if (ysp_add_push(_yy, Y_USES, $2) == NULL) _YYERROR("20")
 
uses_substmts __pad42__
 
 uses_substmt { clicon_debug(2,"uses-substmts -> uses-substmt")
 
uses_substmt __pad43__
 
 refine_stmt { clicon_debug(2,"uses-substmt -> refine-stmt")
 
 uses_augment_stmt { clicon_debug(2,"uses-substmt -> uses-augment-stmt")
 
refine_stmt __pad44__ { clicon_debug(2,"uses-substmt -> ")
 
refine_substmts __pad45__
 
 refine_substmt { clicon_debug(2,"refine-substmts -> refine-substmt")
 
refine_substmt __pad46__
 
uses_augment_stmt __pad47__ { clicon_debug(2,"refine-substmt -> ")
 
augment_stmt __pad48__
 
augment_stmt Y_AUGMENT
 
augment_stmt augment_substmts
 
 augment_substmt { clicon_debug(2,"augment-substmts -> augment-substmt")
 
augment_substmt __pad49__
 
when_stmt __pad50__ { clicon_debug(2,"augment-substmt -> ")
 
when_substmts __pad51__
 
 when_substmt { clicon_debug(2,"when-substmts -> when-substmt")
 
when_substmt __pad52__
 
rpc_stmt __pad53__ { clicon_debug(2,"when-substmt -> ")
 
rpc_substmts __pad54__
 
 rpc_substmt { clicon_debug(2,"rpc-substmts -> rpc-substmt")
 
rpc_substmt __pad55__
 
 input_stmt { clicon_debug(2,"rpc-substmt -> input-stmt")
 
 output_stmt { clicon_debug(2,"rpc-substmt -> output-stmt")
 
input_stmt __pad56__ { clicon_debug(2,"rpc-substmt -> ")
 
input_stmt Y_INPUT
 
input_stmt NULL == NULL) _YYERROR("24")
 
input_substmts __pad57__
 
 input_substmt { clicon_debug(2,"input-substmts -> input-substmt")
 
input_substmt __pad58__
 
output_stmt __pad59__ { clicon_debug(2,"input-substmt -> ")
 
output_stmt Y_OUTPUT
 
typedef_stmt __pad60__
 
typedef_stmt Y_TYPEDEF
 
typedef_stmt typedef_substmts
 
 typedef_substmt { clicon_debug(2,"typedef-substmts -> typedef-substmt")
 
typedef_substmt __pad61__
 
type_stmt __pad62__ { clicon_debug(2,"typedef-substmt -> ")
 
type_body_stmts __pad63__
 
 type_body_stmt { clicon_debug(2,"type-body-stmts -> type-body-stmt")
 
type_body_stmt __pad64__
 
 fraction_digits_stmt { clicon_debug(2,"type-body-stmt -> fraction-digits-stmt")
 
 length_stmt { clicon_debug(2,"type-body-stmt -> length-stmt")
 
 pattern_stmt { clicon_debug(2,"type-body-stmt -> pattern-stmt")
 
 enum_stmt { clicon_debug(2,"type-body-stmt -> enum-stmt")
 
 path_stmt { clicon_debug(2,"type-body-stmt -> path-stmt")
 
 require_instance_stmt { clicon_debug(2,"type-body-stmt -> require-instance-stmt")
 
 base_stmt { clicon_debug(2,"type-body-stmt -> base-stmt")
 
 bit_stmt { clicon_debug(2,"type-body-stmt -> bit-stmt")
 
grouping_stmt __pad65__
 
grouping_stmt Y_GROUPING
 
grouping_stmt grouping_substmts
 
 grouping_substmt { clicon_debug(2,"grouping-substmts -> grouping-substmt")
 
grouping_substmt __pad66__
 
length_stmt __pad67__ { clicon_debug(2,"grouping-substmt -> ")
 
length_substmts __pad68__
 
 length_substmt { clicon_debug(2,"length-substmts -> length-substmt")
 
length_substmt __pad69__
 
pattern_stmt __pad70__ { clicon_debug(2,"length-substmt -> ")
 
pattern_substmts __pad71__
 
 pattern_substmt { clicon_debug(2,"pattern-substmts -> pattern-substmt")
 
pattern_substmt __pad72__
 
 error_message_stmt { clicon_debug(2,"pattern-substmt -> error-message-stmt")
 
feature_stmt __pad73__ { clicon_debug(2,"pattern-substmt -> ")
 
feature_substmts __pad74__
 
 feature_substmt { clicon_debug(2,"feature-substmts -> feature-substmt")
 
feature_substmt __pad75__
 
identity_stmt __pad76__ { clicon_debug(2,"feature-substmt -> ")
 
identity_substmts __pad77__
 
 identity_substmt { clicon_debug(2,"identity-substmts -> identity-substmt")
 
identity_substmt __pad78__
 
range_stmt __pad79__ { clicon_debug(2,"identity-substmt -> ")
 
range_substmts __pad80__
 
 range_substmt { clicon_debug(2,"range-substmts -> range-substmt")
 
range_substmt __pad81__
 
enum_stmt __pad82__ { clicon_debug(2,"range-substmt -> ")
 
enum_substmts __pad83__
 
 enum_substmt { clicon_debug(2,"enum-substmts -> enum-substmt")
 
enum_substmt __pad84__
 
bit_stmt __pad85__ { clicon_debug(2,"enum-substmt -> ")
 
bit_substmts __pad86__
 
 bit_substmt { clicon_debug(2,"bit-substmts -> bit-substmt")
 
bit_substmt __pad87__
 
must_stmt __pad88__ { clicon_debug(2,"bit-substmt -> ")
 
must_substmts __pad89__
 
 must_substmt { clicon_debug(2,"must-substmts -> must-substmt")
 
must_substmt __pad90__
 
error_message_stmt __pad91__ { clicon_debug(2,"must-substmt -> ")
 
import_stmt __pad92__ { if (ysp_add(_yy, Y_ERROR_MESSAGE, $2) == NULL) _YYERROR("68")
 
import_stmt Y_IMPORT
 
import_stmt import_substmts
 
 import_substmt { clicon_debug(2,"import-substmts ->")
 
import_substmt __pad93__
 
 revision_date_stmt { clicon_debug(2,"import-stmt -> revision-date-stmt")
 
yang_version_stmt __pad94__
 
fraction_digits_stmt __pad95__
 
if_feature_stmt __pad96__
 
value_stmt __pad97__
 
position_stmt __pad98__
 
status_stmt __pad99__
 
config_stmt __pad100__
 
base_stmt __pad101__
 
path_stmt __pad102__
 
require_instance_stmt __pad103__
 
units_stmt __pad104__
 
default_stmt __pad105__
 
contact_stmt __pad106__
 
revision_date_stmt __pad107__
 
include_stmt __pad108__
 
namespace_stmt __pad109__
 
prefix_stmt __pad110__
 
description_stmt __pad111__
 
organization_stmt __pad112__
 
min_elements_stmt __pad113__
 
max_elements_stmt __pad114__
 
reference_stmt __pad115__
 
mandatory_stmt __pad116__
 
presence_stmt __pad117__
 
ordered_by_stmt __pad118__
 
key_stmt __pad119__
 
unique_stmt __pad120__
 
config_arg_str __pad121__
 
integer_value __pad122__
 
identifier_ref_arg_str __pad123__
 
string __pad124__
 
id_arg_str __pad125__
 
string __pad126__
 
 ustring { $$=$1
 
qstrings __pad127__
 
 qstring { $$=$1
 
qstring __pad128__
 
ustring __pad129__
 
 CHAR {$$=$1
 

Macro Definition Documentation

#define _YY   ((struct clicon_yang_yacc_arg *)_yy)
#define _YYERROR (   msg)    {clicon_debug(2, "YYERROR %s '%s' %d", (msg), clixon_yang_parsetext, _YY->yy_linenum); YYERROR;}
#define YY_ (   msgid)    msgid

Function Documentation

_YYERROR ( "0"  )
clicon_debug ( ,
"unknown-stmt  
)
submodule_stmt clicon_debug ( ,
"submodule -> id-arg-str { submodule-stmts }"   
)
clicon_debug ( ,
"revision-stmt -> date-arg-str ;"   
)
clicon_debug ( ,
"container-stmt -> CONTAINER id-arg-str ;"   
)
clicon_debug ( ,
"leaf-stmt -> LEAF id-arg-str ;"   
)
clicon_debug ( ,
"leaf-list-stmt -> LEAF id-arg-str ;"   
)
clicon_debug ( ,
"list-stmt -> LIST id-arg-str ;"   
)
clicon_debug ( ,
"choice-stmt -> CHOICE id-arg-str ;"   
)
clicon_debug ( ,
"case-stmt -> CASE id-arg-str ;"   
)
clicon_debug ( ,
"uses-stmt -> USES id-arg-str ;"   
)
clicon_debug ( ,
"refine-stmt -> REFINE id-arg-str ;"   
)
clicon_debug ( ,
"when-stmt -> WHEN string ;"   
)
clicon_debug ( ,
"rpc-stmt -> RPC id-arg-str ;"   
)
clicon_debug ( ,
"type-stmt -> TYPE identifier-ref-arg-str ;"   
)
clicon_debug ( ,
"length-stmt -> LENGTH string ;"   
)
clicon_debug ( ,
"pattern-stmt -> PATTERN string ;"   
)
clicon_debug ( ,
"feature-stmt -> FEATURE id-arg-str ;"   
)
clicon_debug ( ,
"identity-stmt -> IDENTITY string ;"   
)
clicon_debug ( ,
"range-stmt -> RANGE string ;"   
)
clicon_debug ( ,
"enum-stmt -> ENUM string ;"   
)
clicon_debug ( ,
"bit-stmt -> BIT string ;"   
)
clicon_debug ( ,
"must-stmt -> MUST string ;"   
)
clicon_debug ( ,
"yang-version-stmt -> YANG-VERSION string  
)
clicon_debug ( ,
"fraction-digits-stmt -> FRACTION-DIGITS string  
)
clicon_debug ( ,
"if-feature-stmt -> IF-FEATURE identifier-ref-arg-str"   
)
clicon_debug ( ,
"value-stmt -> VALUE integer-value  
)
clicon_debug ( ,
"position-stmt -> POSITION integer-value  
)
clicon_debug ( ,
"status-stmt -> STATUS string  
)
clicon_debug ( ,
"config-stmt -> CONFIG config-arg-str"   
)
clicon_debug ( ,
"base-stmt -> BASE identifier-ref-arg-str"   
)
clicon_debug ( ,
"path-stmt -> PATH string  
)
clicon_debug ( ,
"require-instance-stmt -> REQUIRE-INSTANCE string  
)
clicon_debug ( ,
"units-stmt -> UNITS string  
)
clicon_debug ( ,
"default-stmt -> DEFAULT string  
)
clicon_debug ( ,
"contact-stmt -> CONTACT string  
)
clicon_debug ( ,
"revision-date-stmt -> date;"   
)
clicon_debug ( ,
"include-stmt -> id-arg-str"   
)
clicon_debug ( ,
"namespace-stmt -> NAMESPACE string  
)
clicon_debug ( ,
"prefix-stmt -> PREFIX string ;"   
)
clicon_debug ( ,
"description-stmt -> DESCRIPTION string ;"   
)
clicon_debug ( ,
"organization-stmt -> ORGANIZATION string ;"   
)
clicon_debug ( ,
"min-elements-stmt -> MIN-ELEMENTS integer ;"   
)
clicon_debug ( ,
"max-elements-stmt -> MIN-ELEMENTS integer ;"   
)
clicon_debug ( ,
"reference-stmt -> REFERENCE string ;"   
)
clicon_debug ( ,
"mandatory-stmt -> MANDATORY mandatory-arg-str ;"   
)
clicon_debug ( ,
"presence-stmt -> PRESENCE string ;"   
)
clicon_debug ( ,
"ordered-by-stmt -> ORDERED-BY ordered-by-arg ;"   
)
clicon_debug ( ,
"key-stmt -> KEY id-arg-str ;"   
) { if (ysp_add(_yy, Y_UNIQUE, $2)== NULL) _YYERROR("104")
identifier_ref_arg_str clicon_debug ( ,
"identifier-ref-arg-str -> string  
)
string clicon_debug ( ,
"identifier-ref-arg-str -> prefix : string  
)
clicon_debug ( ,
"id-arg-str -> string  
)
clicon_debug ( ,
"string -> qstrings (%s)"  ,
  $1 
)
clicon_debug ( ,
"string -> ustring (%s)"  ,
  $1 
)
clicon_debug ( ,
"qstrings-> qstrings + qstring  
)
clicon_debug ( ,
"qstrings-> qstring  
)
clicon_debug ( ,
"string-> \" ustring \""   
)
int clicon_yang_debug ( int  d)
void clixon_yang_parseerror ( void *  _yy,
char *  s 
)
free (   $3)
if ( (ys=ysp_add(_yy, Y_MANDATORY, $2))  = =NULL)
if ( (ys=ysp_add(_yy, Y_PRESENCE, $2))  = =NULL)
if ( (ys=ysp_add(_yy, Y_ORDERED_BY, $2))  = =NULL)
static char* prefix_id_join ( char *  prefix,
char *  id 
)
static
sprintf (   $$+,
"%s"  ,
  $3 
)
int yang_parse_exit ( struct clicon_yang_yacc_arg yy)
int yang_parse_init ( struct clicon_yang_yacc_arg yy,
yang_spec *  ysp 
)
static yang_stmt* ysp_add ( struct clicon_yang_yacc_arg yy,
enum rfc_6020  keyword,
char *  argument 
)
static

Add a yang statement to existing top-of-stack.

Note: consumes 'argument' which assumes it is malloced and not freed by caller

static yang_stmt* ysp_add_push ( struct clicon_yang_yacc_arg yy,
int  keyword,
char *  argument 
)
static

combination of ysp_add and ysp_push for sub-modules

int ystack_pop ( struct clicon_yang_yacc_arg yy)
struct ys_stack* ystack_push ( struct clicon_yang_yacc_arg yy,
yang_node *  yn 
)

Variable Documentation

file __pad0__
config_stmt __pad100__
base_stmt __pad101__
path_stmt __pad102__
units_stmt __pad104__
default_stmt __pad105__
contact_stmt __pad106__
revision_date_stmt __pad107__
include_stmt __pad108__
namespace_stmt __pad109__
prefix_stmt __pad110__
description_stmt __pad111__
organization_stmt __pad112__
min_elements_stmt __pad113__
max_elements_stmt __pad114__
reference_stmt __pad115__
mandatory_stmt __pad116__
presence_stmt __pad117__
ordered_by_stmt __pad118__
key_stmt __pad119__
linkage_stmts __pad11__
unique_stmt __pad120__
config_arg_str __pad121__
integer_value __pad122__
string __pad124__
id_arg_str __pad125__
string __pad126__
qstrings __pad127__
qstring __pad128__
ustring __pad129__
linkage_stmt __pad12__
revision_stmts __pad13__
revision_stmt __pad14__
revision_substmts __pad15__
Initial value:
{' revision_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("6");
clicon_debug(2,"revision-stmt -> date-arg-str { revision-substmts }"); }
revision_substmt __pad16__
meta_stmts __pad17__ { clicon_debug(2,"revision-substmt -> ")
meta_stmt __pad18__
body_stmts __pad19__
unknown_stmt __pad1__
body_stmt __pad20__
data_def_stmt __pad21__
container_stmt __pad22__
container_substmts __pad23__
Initial value:
{' container_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("9");
clicon_debug(2,"container-stmt -> CONTAINER id-arg-str { container-substmts }");}
container_substmt __pad24__
leaf_stmt __pad25__ { clicon_debug(2,"container-substmt ->")
leaf_substmts __pad26__
Initial value:
{' leaf_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("12");
clicon_debug(2,"leaf-stmt -> LEAF id-arg-str { lead-substmts }");}
leaf_substmt __pad27__
leaf_list_stmt __pad28__ { clicon_debug(2,"leaf-substmt ->")
leaf_list_substmts __pad29__
Initial value:
{' leaf_list_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("15");
clicon_debug(2,"leaf-list-stmt -> LEAF-LIST id-arg-str { lead-substmts }");}
module_stmt __pad2__
leaf_list_substmt __pad30__
list_stmt __pad31__ { clicon_debug(2,"leaf-list-stmt ->")
list_substmts __pad32__
Initial value:
{' list_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("18");
clicon_debug(2,"list-stmt -> LIST id-arg-str { list-substmts }"); }
list_substmt __pad33__
choice_stmt __pad34__ { clicon_debug(2,"list-substmt -> ")
choice_substmts __pad35__
Initial value:
{' choice_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("21");
clicon_debug(2,"choice-stmt -> CHOICE id-arg-str { choice-substmts }"); }
choice_substmt __pad36__
short_case_stmt __pad37__ { clicon_debug(2,"choice-substmt -> ")
case_stmt __pad38__
case_substmts __pad39__
Initial value:
{' case_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("21");
clicon_debug(2,"case-stmt -> CASE id-arg-str { case-substmts }"); }
module_substmt __pad3__
case_substmt __pad40__
uses_stmt __pad41__ { clicon_debug(2,"case-substmt -> ")
uses_substmts __pad42__
Initial value:
{' uses_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("21");
clicon_debug(2,"uses-stmt -> USES id-arg-str { uses-substmts }"); }
uses_substmt __pad43__
refine_stmt __pad44__ { clicon_debug(2,"uses-substmt -> ")
refine_substmts __pad45__
Initial value:
{' refine_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("23");
clicon_debug(2,"refine-stmt -> REFINE id-arg-str { refine-substmts }"); }
refine_substmt __pad46__
uses_augment_stmt __pad47__ { clicon_debug(2,"refine-substmt -> ")
augment_stmt __pad48__
augment_substmt __pad49__
submodule_stmt __pad4__ { clicon_debug(2,"module-substmt ->")
when_stmt __pad50__ { clicon_debug(2,"augment-substmt -> ")
when_substmts __pad51__
Initial value:
{' when_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("23");
clicon_debug(2,"when-stmt -> WHEN string { when-substmts }"); }
when_substmt __pad52__
rpc_stmt __pad53__ { clicon_debug(2,"when-substmt -> ")
rpc_substmts __pad54__
Initial value:
{' rpc_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("23");
clicon_debug(2,"rpc-stmt -> RPC id-arg-str { rpc-substmts }"); }
rpc_substmt __pad55__
input_stmt __pad56__ { clicon_debug(2,"rpc-substmt -> ")
input_substmts __pad57__
Initial value:
{' input_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("25");
clicon_debug(2,"input-stmt -> INPUT { input-substmts }"); }
input_substmt __pad58__
output_stmt __pad59__ { clicon_debug(2,"input-substmt -> ")
submodule_substmts __pad5__
typedef_stmt __pad60__
Initial value:
{' input_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("25");
clicon_debug(2,"output-stmt -> OUTPUT { input-substmts }"); }
typedef_substmt __pad61__
type_stmt __pad62__ { clicon_debug(2,"typedef-substmt -> ")
type_body_stmts __pad63__
Initial value:
{' type_body_stmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("28");
clicon_debug(2,"type-stmt -> TYPE identifier-ref-arg-str { type-body-stmts }");}
type_body_stmt __pad64__
grouping_stmt __pad65__
grouping_substmt __pad66__
length_stmt __pad67__ { clicon_debug(2,"grouping-substmt -> ")
length_substmts __pad68__
Initial value:
{' length_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("33");
clicon_debug(2,"length-stmt -> LENGTH string { length-substmts }"); }
length_substmt __pad69__
pattern_stmt __pad70__ { clicon_debug(2,"length-substmt -> ")
pattern_substmts __pad71__
Initial value:
{' pattern_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("36");
clicon_debug(2,"pattern-stmt -> PATTERN string { pattern-substmts }"); }
pattern_substmt __pad72__
feature_stmt __pad73__ { clicon_debug(2,"pattern-substmt -> ")
feature_substmts __pad74__
Initial value:
{' feature_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("52");
clicon_debug(2,"feature-stmt -> FEATURE id-arg-str { feature-substmts }"); }
feature_substmt __pad75__
identity_stmt __pad76__ { clicon_debug(2,"feature-substmt -> ")
identity_substmts __pad77__
Initial value:
{' identity_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("55");
clicon_debug(2,"identity-stmt -> IDENTITY string { identity-substmts }"); }
identity_substmt __pad78__
range_stmt __pad79__ { clicon_debug(2,"identity-substmt -> ")
module_header_stmts __pad7__ { clicon_debug(2,"submodule-substmt ->")
range_substmts __pad80__
Initial value:
{' range_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("58");
clicon_debug(2,"range-stmt -> RANGE string { range-substmts }"); }
range_substmt __pad81__
enum_stmt __pad82__ { clicon_debug(2,"range-substmt -> ")
enum_substmts __pad83__
Initial value:
{' enum_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("61");
clicon_debug(2,"enum-stmt -> ENUM string { enum-substmts }"); }
enum_substmt __pad84__
bit_stmt __pad85__ { clicon_debug(2,"enum-substmt -> ")
bit_substmts __pad86__
Initial value:
{' bit_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("64");
clicon_debug(2,"bit-stmt -> BIT string { bit-substmts }"); }
bit_substmt __pad87__
must_stmt __pad88__ { clicon_debug(2,"bit-substmt -> ")
must_substmts __pad89__
Initial value:
{' must_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("67");
clicon_debug(2,"must-stmt -> MUST string { must-substmts }"); }
must_substmt __pad90__
error_message_stmt __pad91__ { clicon_debug(2,"must-substmt -> ")
import_stmt __pad92__ { if (ysp_add(_yy, Y_ERROR_MESSAGE, $2) == NULL) _YYERROR("68")
import_substmt __pad93__
yang_version_stmt __pad94__
if_feature_stmt __pad96__
value_stmt __pad97__
position_stmt __pad98__
status_stmt __pad99__
submodule_header_stmts __pad9__
augment_stmt { clicon_debug(2,"body-stmt -> augment-stmt")
augment_substmt { clicon_debug(2,"augment-substmts -> augment-substmt")
augment_stmt augment_substmts
Initial value:
{' augment_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("23");
clicon_debug(2,"augment-stmt -> AUGMENT string { augment-substmts }"); }
base_stmt { clicon_debug(2,"type-body-stmt -> base-stmt")
bit_stmt { clicon_debug(2,"type-body-stmt -> bit-stmt")
bit_substmt { clicon_debug(2,"bit-substmts -> bit-substmt")
body_stmt { clicon_debug(2,"body-stmts -> body-stmt")
body_stmts { clicon_debug(2,"module-substmt -> body-stmts")
case_stmt { clicon_debug(2,"choice-substmt -> case-stmt")
case_substmt { clicon_debug(2,"case-substmts -> case-substmt")
CHAR {$$=$1
choice_stmt { clicon_debug(2,"data-def-stmt -> choice-stmt")
choice_substmt { clicon_debug(2,"choice-substmts -> choice-substmt")
config_stmt { clicon_debug(2,"container-substmt -> config-stmt")
contact_stmt { clicon_debug(2,"meta-stmt -> contact-stmt")
data_def_stmt { clicon_debug(2,"body-stmt -> data-def-stmt")
default_stmt { clicon_debug(2,"leaf-substmt -> default-stmt")
description_stmt { clicon_debug(2,"meta-stmt -> description-stmt")
enum_stmt { clicon_debug(2,"type-body-stmt -> enum-stmt")
enum_substmt { clicon_debug(2,"enum-substmts -> enum-substmt")
error_message_stmt { clicon_debug(2,"pattern-substmt -> error-message-stmt")
feature_substmt { clicon_debug(2,"feature-substmts -> feature-substmt")
fraction_digits_stmt { clicon_debug(2,"type-body-stmt -> fraction-digits-stmt")
grouping_stmt { clicon_debug(2,"body-stmt -> grouping-stmt")
grouping_substmt { clicon_debug(2,"grouping-substmts -> grouping-substmt")
grouping_stmt grouping_substmts
Initial value:
{' grouping_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("30");
clicon_debug(2,"grouping-stmt -> GROUPING id-arg-str { grouping-substmts }"); }
K_INCLUDE id_arg_str { if (ysp_add_push(_yy, Y_CONTAINER, $2) == NULL) _YYERROR("8")
K_TYPE identifier_ref_arg_str { if (ysp_add_push(_yy, Y_USES, $2) == NULL) _YYERROR("20")
identity_stmt { clicon_debug(2,"body-stmt -> identity-stmt")
identity_substmt { clicon_debug(2,"identity-substmts -> identity-substmt")
if_feature_stmt { clicon_debug(2,"container-substmt -> if-feature-stmt")
import_substmt { clicon_debug(2,"import-substmts ->")
import_stmt import_substmts
Initial value:
{' import_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("70");
clicon_debug(2,"import-stmt -> IMPORT id-arg-str { import-substmts }");}
include_stmt { clicon_debug(2,"linkage-stmt -> include-stmt")
input_stmt { clicon_debug(2,"rpc-substmt -> input-stmt")
input_substmt { clicon_debug(2,"input-substmts -> input-substmt")
int intval
key_stmt { clicon_debug(2,"list-substmt -> key-stmt")
leaf_list_stmt { clicon_debug(2,"data-def-stmt -> leaf-list-stmt")
leaf_stmt { clicon_debug(2,"data-def-stmt -> leaf-stmt")
length_stmt { clicon_debug(2,"type-body-stmt -> length-stmt")
length_substmt { clicon_debug(2,"length-substmts -> length-substmt")
linkage_stmt { clicon_debug(2,"linkage-stmts -> linkage-stmt")
linkage_stmts { clicon_debug(2,"module-substmt -> linake-stmts")
list_stmt { clicon_debug(2,"data-def-stmt -> list-stmt")
list_substmt { clicon_debug(2,"list-substmts -> list-substmt")
mandatory_stmt { clicon_debug(2,"leaf-substmt -> mandatory-stmt")
max_elements_stmt { clicon_debug(2,"leaf-list-substmt -> max-elements-stmt")
meta_stmt { clicon_debug(2,"meta-stmts -> meta-stmt")
meta_stmts { clicon_debug(2,"module-substmt -> meta-stmts")
min_elements_stmt { clicon_debug(2,"leaf-list-substmt -> min-elements-stmt")
module_header_stmt { clicon_debug(2,"module-header-stmts -> ")
module_substmt { clicon_debug(2,"module-substmts ->")
module_stmt module_substmts
Initial value:
{' module_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("2");
clicon_debug(2,"module -> id-arg-str { module-substmts }");}
must_stmt { clicon_debug(2,"container-substmt -> must-stmt")
must_substmt { clicon_debug(2,"must-substmts -> must-substmt")
submodule_stmt MY_EOF { clicon_debug(2,"file->submodule-stmt")
namespace_stmt { clicon_debug(2,"module-header-stmt -> namespace-stmt")
output_stmt NULL == NULL) _YYERROR("24")
ordered_by_stmt { clicon_debug(2,"leaf-list-substmt -> ordered-by-stmt")
output_stmt { clicon_debug(2,"rpc-substmt -> output-stmt")
path_stmt { clicon_debug(2,"type-body-stmt -> path-stmt")
pattern_stmt { clicon_debug(2,"type-body-stmt -> pattern-stmt")
pattern_substmt { clicon_debug(2,"pattern-substmts -> pattern-substmt")
prefix_stmt { clicon_debug(2,"module-header-stmt -> prefix-stmt")
presence_stmt { clicon_debug(2,"container-substmt -> presence-stmt")
qstring { $$=$1
range_substmt { clicon_debug(2,"range-substmts -> range-substmt")
reference_stmt { clicon_debug(2,"revision-substmt -> reference-stmt")
refine_stmt { clicon_debug(2,"uses-substmt -> refine-stmt")
refine_substmt { clicon_debug(2,"refine-substmts -> refine-substmt")
require_instance_stmt { clicon_debug(2,"type-body-stmt -> require-instance-stmt")
revision_date_stmt { clicon_debug(2,"import-stmt -> revision-date-stmt")
revision_stmt { clicon_debug(2,"revision-stmts -> ")
revision_stmts { clicon_debug(2,"module-substmt -> revision-stmts")
revision_substmt { clicon_debug(2,"revision-substmts -> }")
rpc_stmt { clicon_debug(2,"body-stmt -> rpc-stmt")
rpc_substmt { clicon_debug(2,"rpc-substmts -> rpc-substmt")
short_case_stmt { clicon_debug(2,"choice-substmt -> short-case-stmt")
unknown_stmt unknown statement
status_stmt { clicon_debug(2,"container-substmt -> status-stmt")
K_MUST string { if (ysp_add_push(_yy, Y_REVISION, $2) == NULL) _YYERROR("5")
submodule_header_stmt { clicon_debug(2,"submodule-header-stmts -> submodule-header-stmt")
submodule_substmt { clicon_debug(2,"submodule-stmts -> submodule-substmt")
import_stmt import substmts import substmts import substm
must_substmts must substmts must substmts must substmt
type_body_stmt { clicon_debug(2,"type-body-stmts -> type-body-stmt")
type_stmt { clicon_debug(2,"leaf-substmt -> type-stmt")
typedef_stmt { clicon_debug(2,"body-stmt -> typedef-stmt")
typedef_substmt { clicon_debug(2,"typedef-substmts -> typedef-substmt")
typedef_stmt typedef_substmts
Initial value:
{' typedef_substmts '}'
{ if (ystack_pop(_yy) < 0) _YYERROR("25");
clicon_debug(2,"typedef-stmt -> TYPEDEF id-arg-str { typedef-substmts }"); }
unique_stmt { clicon_debug(2,"list-substmt -> unique-stmt")
units_stmt { clicon_debug(2,"leaf-substmt -> units-stmt")
unknown_stmt { clicon_debug(2,"module-substmt -> unknown-stmt")
uses_augment_stmt { clicon_debug(2,"uses-substmt -> uses-augment-stmt")
uses_stmt { clicon_debug(2,"data-def-stmt -> uses-stmt")
uses_substmt { clicon_debug(2,"uses-substmts -> uses-substmt")
ustring { $$=$1
when_substmt { clicon_debug(2,"when-substmts -> when-substmt")
augment_stmt Y_AUGMENT
grouping_stmt Y_GROUPING
import_stmt Y_IMPORT
input_stmt Y_INPUT
module_stmt Y_MODULE
output_stmt Y_OUTPUT
submodule_stmt Y_SUBMODULE
typedef_stmt Y_TYPEDEF
YYACCEPT