From: Tomek Mrugalski Date: Sun, 13 Nov 2016 01:46:53 +0000 (+0900) Subject: advanced.json is now parsed properly again X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f39ac37fbbdb558b57cf3fe61ab28b765990fa58;p=thirdparty%2Fkea.git advanced.json is now parsed properly again --- diff --git a/src/bin/dhcp6/Makefile.am b/src/bin/dhcp6/Makefile.am index a7fc484843..7b5bc22c0b 100644 --- a/src/bin/dhcp6/Makefile.am +++ b/src/bin/dhcp6/Makefile.am @@ -122,7 +122,7 @@ parser: dhcp6_lexer.cc location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_pa # This is especially useful if yydebug_ is set to 1 as that variable # will cause parser to print out its internal state. location.hh position.hh stack.hh dhcp6_parser.cc dhcp6_parser.h: dhcp6_parser.yy - $(YACC) --defines=dhcp6_parser.h -o dhcp6_parser.cc dhcp6_parser.yy + $(YACC) --defines=dhcp6_parser.h --report=all --report-file=dhcp6_parser.report -o dhcp6_parser.cc dhcp6_parser.yy dhcp6_lexer.cc: dhcp6_lexer.ll $(LEX) --prefix parser6_ -o dhcp6_lexer.cc dhcp6_lexer.ll diff --git a/src/bin/dhcp6/dhcp6_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy index 81cf5b7f1f..e6a31a5113 100644 --- a/src/bin/dhcp6/dhcp6_parser.yy +++ b/src/bin/dhcp6/dhcp6_parser.yy @@ -284,10 +284,19 @@ mac_sources: MAC_SOURCES { ElementPtr l(new ListElement()); ctx.stack_.back()->set("mac-sources", l); ctx.stack_.push_back(l); -} COLON list { +} COLON LSQUARE_BRACKET mac_sources_list RSQUARE_BRACKET { ctx.stack_.pop_back(); }; +mac_sources_list: mac_sources_value +| mac_sources_list COMMA mac_sources_value; + +mac_sources_value: DUID { + ElementPtr duid(new StringElement("duid")); ctx.stack_.back()->add(duid); +}| STRING { + ElementPtr duid(new StringElement($1)); ctx.stack_.back()->add(duid); +}; + host_reservation_identifiers: HOST_RESERVATION_IDENTIFIERS COLON LSQUARE_BRACKET { ElementPtr l(new ListElement()); ctx.stack_.back()->set("host-reservation-identifiers", l); @@ -401,8 +410,7 @@ option_data_entry: LCURLY_BRACKET { // This defines parameters specified inside the map that itself // is an entry in option-data list. -option_data_params: {} -| option_data_param +option_data_params: option_data_param | option_data_params COMMA option_data_param; option_data_param: @@ -550,7 +558,7 @@ ip_addresses: IP_ADDRESSES COLON { ElementPtr l(new ListElement()); ctx.stack_.back()->set("ip-addresses", l); ctx.stack_.push_back(l); -} list { +} list { ctx.stack_.pop_back(); }; @@ -558,7 +566,7 @@ prefixes: PREFIXES COLON { ElementPtr l(new ListElement()); ctx.stack_.back()->set("prefixes", l); ctx.stack_.push_back(l); -} list { +} list { ctx.stack_.pop_back(); };