From 48cdbcaea2a826688ec9fb4df1af2cfb38352f9b Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Mon, 25 Mar 2013 20:27:23 +0100 Subject: 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 --- trafgen_parser.y | 2 ++ 1 file changed, 2 insertions(+) (limited to 'trafgen_parser.y') diff --git a/trafgen_parser.y b/trafgen_parser.y index b0e7e33..37c9a15 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;} ; -- cgit v1.2.3-54-g00ecf