From: Daniel Borkmann Date: Mon, 25 Mar 2013 19:27:23 +0000 (+0100) Subject: trafgen: parser: add possibility for negative numbers X-Git-Tag: v0.5.8-rc1~409 X-Git-Url: https://repo.or.cz/w/netsniff-ng.git/commitdiff_plain/48cdbcaea2a826688ec9fb4df1af2cfb38352f9b trafgen: parser: add possibility for negative numbers The previous commit reduced it, so now we allow it within cX() containers in order to negate a result, if someone needs that. Signed-off-by: Daniel Borkmann --- diff --git a/trafgen_parser.y b/trafgen_parser.y index b0e7e338..37c9a156 100644 --- a/trafgen_parser.y +++ b/trafgen_parser.y @@ -431,6 +431,8 @@ expression { $$ = $1 << $4; } | expression '>' '>' expression { $$ = $1 >> $4; } + | '-' expression + { $$ = -1 * $2; } | '(' expression ')' { $$ = $2;} ;