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.
This commit is contained in:
Gregor Maier 2010-12-17 13:20:38 -08:00
parent fdaeea0ea9
commit a9f28fab74
2 changed files with 10 additions and 2 deletions

View file

@ -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})

View file

@ -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;