Print a better message for instance port expression errors.

This patch adds code to print an error message when there is
a syntax error in the port expression list.
This commit is contained in:
Cary R 2008-08-22 19:32:01 -07:00 committed by Stephen Williams
parent 92dd13a225
commit be3d7b435d
1 changed files with 26 additions and 0 deletions

26
parse.y
View File

@ -1502,6 +1502,32 @@ gate_instance
delete rng;
$$ = tmp;
}
| IDENTIFIER '(' error ')'
{ lgate*tmp = new lgate;
tmp->name = $1;
tmp->parms = 0;
tmp->parms_by_name = 0;
tmp->file = @1.text;
tmp->lineno = @1.first_line;
yyerror(@2, "error: Syntax error in instance port "
"expression(s).");
delete[]$1;
$$ = tmp;
}
| IDENTIFIER range '(' error ')'
{ lgate*tmp = new lgate;
tmp->name = $1;
tmp->parms = 0;
tmp->parms_by_name = 0;
tmp->file = @1.text;
tmp->lineno = @1.first_line;
yyerror(@3, "error: Syntax error in instance port "
"expression(s).");
delete[]$1;
$$ = tmp;
}
;
gate_instance_list