From 34c359422cc2d556478f4252c66aa880f8adb8b1 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 6 May 2010 17:32:19 -0700 Subject: additional fix --- src/cli_def.l | 5 ++--- src/cli_parse.y | 3 +-- src/cli_val.h | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/cli_def.l b/src/cli_def.l index ef5a278..a7de87d 100644 --- a/src/cli_def.l +++ b/src/cli_def.l @@ -257,8 +257,7 @@ RE_TYPE_NAME (txt|u32|ipv4|ipv4net|ipv6|ipv6net|bool|macaddr) /* values */ RE_VAL_U32 [0-9]+ RE_VAL_BOOL (true|false) -RE_VAL_TEXT [a-zA-Z]+ -RE_VAL_PRIORITY (PARENT|{RE_VAL_U32}) +RE_VAL_PRIORITY (PARENT) /* operators */ RE_OP_COND (==|!=|<|>|<=|>=|in) @@ -446,7 +445,7 @@ RE_ACT_FIELD (help|syntax|commit|delete|update|activate|create|begin|end|comp_he return VAR; } -{RE_VAL_PRIORITY} { yy_cli_parse_lval.val.free_me = TRUE; yy_cli_parse_lval.val.val = strdup(yy_cli_def_text); return PRIORITY_VALUE;} +{RE_VAL_PRIORITY} { return return_value(PRIORITY_TYPE); } {RE_VAL_U32} { return return_value(INT_TYPE); } {RE_IPV4} { return return_value(IPV4_TYPE); } {RE_IPV4NET} { return return_value(IPV4NET_TYPE); } diff --git a/src/cli_parse.y b/src/cli_parse.y index 50b1313..0f32928 100644 --- a/src/cli_parse.y +++ b/src/cli_parse.y @@ -43,7 +43,6 @@ static void cli_deferror(const char *); %token DUMMY %left SEMI %token VALUE -%token PRIORITY_VALUE %token TYPE_DEF %token VAR %token STRING @@ -175,7 +174,7 @@ default_cause: DEFAULT STRING yy_cli_parse_error((const char *)"Bad default\n"); parse_defp->def_default = $2; } -priority_stmt: PRIORITY PRIORITY_VALUE +priority_stmt: PRIORITY VALUE { char *tmp = $2.val; long long int cval = 0; diff --git a/src/cli_val.h b/src/cli_val.h index e6182e7..728b307 100644 --- a/src/cli_val.h +++ b/src/cli_val.h @@ -30,7 +30,8 @@ typedef enum { MACADDR_TYPE, DOMAIN_TYPE, /*end of addr types */ TEXT_TYPE, - BOOL_TYPE + BOOL_TYPE, + PRIORITY_TYPE }vtw_type_e; typedef enum { -- cgit v1.2.3