diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2011-01-10 11:41:54 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2011-01-10 11:41:54 -0800 |
commit | f780a3fe2703874219e70e7cf443846fd85e9a67 (patch) | |
tree | 4e7e6389e6f2caef498003655423a63542d05150 /src | |
parent | 0986ef490b95b55157e59eefb755198b931d9837 (diff) | |
download | vyatta-cfg-f780a3fe2703874219e70e7cf443846fd85e9a67.tar.gz vyatta-cfg-f780a3fe2703874219e70e7cf443846fd85e9a67.zip |
reset initial parser state
Diffstat (limited to 'src')
-rw-r--r-- | src/cparse/cparse.ypp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cparse/cparse.ypp b/src/cparse/cparse.ypp index 66ddfd3..b1958e9 100644 --- a/src/cparse/cparse.ypp +++ b/src/cparse/cparse.ypp @@ -190,11 +190,20 @@ cparse::parse_file(FILE *fin, Cstore& cs) cparse_debug = 1; #endif // ENABLE_PARSER_TRACE + // initial state cparse_set_in(fin); cstore = &cs; - - // root node + ndeact = 0; + ncomment = NULL; + nname = NULL; + nval = NULL; + node_map.clear(); + pcomps.clear(); + pcomp_is_value.clear(); + cur_path.clear(); + cur_node = NULL; cur_parent = new CfgNode(pcomps, nname, nval, ncomment, ndeact, cstore); + if (cparse_parse() != 0) { // parsing failed return NULL; |