1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Trivial 15-line bison excercise: Implemented expressions including

user-defined numeric symbols. Whenever possible, use `expr' instead
of `NUM' to get full express ion power :-)
This commit is contained in:
Martin Mares
1998-11-27 21:32:45 +00:00
parent c74c0e3cdf
commit 0b62c3a7c7
6 changed files with 42 additions and 7 deletions

View File

@@ -54,9 +54,10 @@ proto_name:
proto_item:
/* EMPTY */
| PREFERENCE NUM {
| PREFERENCE expr {
if ($2 < 0 || $2 > 255) cf_error("Invalid preference");
this_proto->preference = $2;
die("pref=%d", $2);
}
;