From a9f28fab749452bf7b056b9a93c1d1f2f4495ee5 Mon Sep 17 00:00:00 2001 From: Gregor Maier Date: Fri, 17 Dec 2010 13:20:38 -0800 Subject: [PATCH] Minor tweaks for bif language. * Bif language: Can now specify hex constants as explicit enumerators. * Bifcl output files new also depend on the bifcl binary. --- src/CMakeLists.txt | 1 + src/builtin-func.l | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 856e8cad4d..3b371e1cd7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -103,6 +103,7 @@ macro(BIF_TARGET bifInput) COMMAND bifcl ARGS ${CMAKE_CURRENT_SOURCE_DIR}/${bifInput} || (rm -f ${bifOutputs} && exit 1) DEPENDS ${bifInput} + DEPENDS bifcl COMMENT "[BIFCL] Processing ${bifInput}" ) list(APPEND ALL_BIF_OUTPUTS ${bifOutputs}) diff --git a/src/builtin-func.l b/src/builtin-func.l index cbd925819b..aa5a281856 100644 --- a/src/builtin-func.l +++ b/src/builtin-func.l @@ -30,7 +30,8 @@ int check_c_mode(int t) WS [ \t]+ ID [A-Za-z_][A-Za-z_0-9]* ESCSEQ (\\([^\n]|[0-7]+|x[[:xdigit:]]+)) -INT [[:digit:]]+ +D [[:digit:]]+ +HEX [0-9a-fA-F]+ %option nodefault @@ -80,11 +81,17 @@ INT [[:digit:]]+ "T" yylval.val = 1; return TOK_BOOL; "F" yylval.val = 0; return TOK_BOOL; -{INT} { +{D} { yylval.str = copy_string(yytext); return TOK_INT; } +"0x"{HEX} { + yylval.str = copy_string(yytext); + return TOK_INT; + } + + {ID} { yylval.str = copy_string(yytext); return TOK_ID;