diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2016-12-16 22:30:36 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-01-23 21:52:43 +0100 |
commit | 0bf5b1cbe3812e748d459fa4c4fb6596e072e7bd (patch) | |
tree | 192e6f292edc83b74016c74547a3cd76101710b2 /lib/command_parse.y | |
parent | lib: parser: free Mr. T (diff) | |
download | frr-0bf5b1cbe3812e748d459fa4c4fb6596e072e7bd.tar.xz frr-0bf5b1cbe3812e748d459fa4c4fb6596e072e7bd.zip |
lib: parser: simplify OPTION_TKN & SELECTOR_TKN
These are functionally identical as "fork" tokens.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/command_parse.y')
-rw-r--r-- | lib/command_parse.y | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/command_parse.y b/lib/command_parse.y index c920e1138..478ba0537 100644 --- a/lib/command_parse.y +++ b/lib/command_parse.y @@ -274,8 +274,8 @@ placeholder_token: selector: '<' selector_seq_seq '>' { $$ = malloc (sizeof (struct subgraph)); - $$->start = new_token_node (ctx, SELECTOR_TKN, NULL, NULL); - $$->end = new_token_node (ctx, NUL_TKN, NULL, NULL); + $$->start = new_token_node (ctx, FORK_TKN, NULL, NULL); + $$->end = new_token_node (ctx, JOIN_TKN, NULL, NULL); for (unsigned int i = 0; i < vector_active ($2->start->to); i++) { struct graph_node *sn = vector_slot ($2->start->to, i), @@ -329,8 +329,8 @@ selector_seq_seq: selector: '{' selector_seq_seq '}' { $$ = malloc (sizeof (struct subgraph)); - $$->start = new_token_node (ctx, SELECTOR_TKN, NULL, NULL); - $$->end = new_token_node (ctx, NUL_TKN, NULL, NULL); + $$->start = new_token_node (ctx, FORK_TKN, NULL, NULL); + $$->end = new_token_node (ctx, JOIN_TKN, NULL, NULL); graph_add_edge ($$->start, $$->end); for (unsigned int i = 0; i < vector_active ($2->start->to); i++) { @@ -377,8 +377,8 @@ option: '[' option_token_seq ']' { // make a new option $$ = malloc (sizeof (struct subgraph)); - $$->start = new_token_node (ctx, OPTION_TKN, NULL, NULL); - $$->end = new_token_node (ctx, NUL_TKN, NULL, NULL); + $$->start = new_token_node (ctx, FORK_TKN, NULL, NULL); + $$->end = new_token_node (ctx, JOIN_TKN, NULL, NULL); // add a path through the sequence to the end graph_add_edge ($$->start, $2->start); graph_add_edge ($2->end, $$->end); @@ -575,8 +575,7 @@ cmp_token (struct cmd_token *first, struct cmd_token *second) * cases; ultimately this forks the graph, but the matcher can handle * this regardless */ - case SELECTOR_TKN: - case OPTION_TKN: + case FORK_TKN: return 0; /* end nodes are always considered equal, since each node may only @@ -584,7 +583,7 @@ cmp_token (struct cmd_token *first, struct cmd_token *second) */ case START_TKN: case END_TKN: - case NUL_TKN: + case JOIN_TKN: default: break; } |