Commit bfc64c5c authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

advanced.json is now parsed properly again

parent 878c2b1a
......@@ -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
......
......@@ -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();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment