Fix parsing of hierarchical identifiers

the lexor didn't allow numbers in the IDENTIFIER name,
and the parser wasn't very nice with IDENTIFIER errors.

Signed-off-by: Stephen Williams <steve@icarus.com>
This commit is contained in:
Stephen Williams 2007-11-27 21:42:20 -08:00
parent 2a269f1bb7
commit 26f1d50248
2 changed files with 5 additions and 1 deletions

View File

@ -65,7 +65,7 @@ static int yywrap(void)
return REAL_NUMBER;
}
[a-zA-Z]+ {
[a-zA-Z][a-zA-Z0-9]* {
return lookup_keyword(yytext);
}

View File

@ -198,6 +198,10 @@ cell_instance
{ $$ = strdup(""); }
| '(' K_INSTANCE '*' ')'
{ $$ = 0; }
| '(' K_INSTANCE error ')'
{ vpi_printf("%s:%d:SDF ERROR: Invalid/malformed INSTANCE argument\n",
sdf_parse_path, @2.first_line);
$$ = strdup(""); }
;
timing_spec_list