Skip to content

Commit 2a881d3

Browse files
committed
[#3378] Updated syntaxes
1 parent 4f35701 commit 2a881d3

File tree

4 files changed

+14
-36
lines changed

4 files changed

+14
-36
lines changed

src/bin/dhcp4/dhcp4_lexer.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
15661566
15671567
\"ip-address\" {
15681568
switch(driver.ctx_) {
1569-
case isc::dhcp::Parser4Context::RELAY:
15701569
case isc::dhcp::Parser4Context::RESERVATIONS:
15711570
return isc::dhcp::Dhcp4Parser::make_IP_ADDRESS(driver.loc_);
15721571
default:

src/bin/dhcp4/dhcp4_parser.yy

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ using namespace std;
195195
POOL_ID "pool-id"
196196

197197
RESERVATIONS "reservations"
198+
IP_ADDRESS "ip-address"
198199
DUID "duid"
199200
HW_ADDRESS "hw-address"
200201
CIRCUIT_ID "circuit-id"
@@ -203,7 +204,6 @@ using namespace std;
203204
FLEX_ID "flex-id"
204205

205206
RELAY "relay"
206-
IP_ADDRESS "ip-address"
207207
IP_ADDRESSES "ip-addresses"
208208

209209
HOOKS_LIBRARIES "hooks-libraries"
@@ -2333,17 +2333,6 @@ ip_address: IP_ADDRESS {
23332333
ctx.leave();
23342334
};
23352335

2336-
ip_addresses: IP_ADDRESSES {
2337-
ctx.unique("ip-addresses", ctx.loc2pos(@1));
2338-
ElementPtr l(new ListElement(ctx.loc2pos(@1)));
2339-
ctx.stack_.back()->set("ip-addresses", l);
2340-
ctx.stack_.push_back(l);
2341-
ctx.enter(ctx.NO_KEYWORD);
2342-
} COLON list_strings {
2343-
ctx.stack_.pop_back();
2344-
ctx.leave();
2345-
};
2346-
23472336
duid: DUID {
23482337
ctx.unique("duid", ctx.loc2pos(@1));
23492338
ctx.enter(ctx.NO_KEYWORD);
@@ -2423,10 +2412,20 @@ relay: RELAY {
24232412
ctx.leave();
24242413
};
24252414

2426-
relay_map: ip_address
2427-
| ip_addresses
2415+
relay_map: ip_addresses
24282416
;
24292417

2418+
ip_addresses: IP_ADDRESSES {
2419+
ctx.unique("ip-addresses", ctx.loc2pos(@1));
2420+
ElementPtr l(new ListElement(ctx.loc2pos(@1)));
2421+
ctx.stack_.back()->set("ip-addresses", l);
2422+
ctx.stack_.push_back(l);
2423+
ctx.enter(ctx.NO_KEYWORD);
2424+
} COLON list_strings {
2425+
ctx.stack_.pop_back();
2426+
ctx.leave();
2427+
};
2428+
24302429
// --- end of relay definitions ------------------------------
24312430

24322431
// --- client classes ----------------------------------------

src/bin/dhcp6/dhcp6_lexer.ll

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,15 +1908,6 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
19081908
}
19091909
}
19101910
1911-
\"ip-address\" {
1912-
switch(driver.ctx_) {
1913-
case isc::dhcp::Parser6Context::RELAY:
1914-
return isc::dhcp::Dhcp6Parser::make_IP_ADDRESS(driver.loc_);
1915-
default:
1916-
return isc::dhcp::Dhcp6Parser::make_STRING("ip-address", driver.loc_);
1917-
}
1918-
}
1919-
19201911
\"hooks-libraries\" {
19211912
switch(driver.ctx_) {
19221913
case isc::dhcp::Parser6Context::DHCP6:

src/bin/dhcp6/dhcp6_parser.yy

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ using namespace std;
200200
FLEX_ID "flex-id"
201201

202202
RELAY "relay"
203-
IP_ADDRESS "ip-address"
204203

205204
HOOKS_LIBRARIES "hooks-libraries"
206205
LIBRARY "library"
@@ -2480,19 +2479,9 @@ relay: RELAY {
24802479
ctx.leave();
24812480
};
24822481

2483-
relay_map: ip_address
2484-
| ip_addresses
2482+
relay_map: ip_addresses
24852483
;
24862484

2487-
ip_address: IP_ADDRESS {
2488-
ctx.unique("ip-address", ctx.loc2pos(@1));
2489-
ctx.enter(ctx.NO_KEYWORD);
2490-
} COLON STRING {
2491-
ElementPtr addr(new StringElement($4, ctx.loc2pos(@4)));
2492-
ctx.stack_.back()->set("ip-address", addr);
2493-
ctx.leave();
2494-
};
2495-
24962485
// --- end of relay definitions ------------------------------
24972486

24982487
// --- client classes ----------------------------------------

0 commit comments

Comments
 (0)