From: Paul Graham (pgraham@cadence.com)
Date: Fri Oct 19 2001 - 13:52:57 PDT
Precedence: bulk
> Having said all that, I don't know why we couldn't
> allow keywords into attributes... but we would need
> to add language such as given in 2.7.4 or 2.7.5 to
> explicitly allow it.
It would be a bit of a pain for the parser. As an example, in vhdl there
are predefined attribute names which look like x'length, y'delayed, and also
user-defined attribute names, like x'myattr. All user-defined attributes
have to be non-keyword identifiers. All predefined attribute names are
non-keyword names, with the exception of 'range. So a parser for vhdl attribute
names will look something like:
attribute_name : prefix ' identifier | prefix ' RANGE
Note the extra production to handle 'range. Now imagine if all 50 or so
keywords were allowed as attribute names.
You could do some trick in the parser like setting a flag which disables
keyword recognition between (* and *), but that's gross, and would slow down
keyword recognition in the general case. It would also require a special
check with the 'always @(*)' construct.
So, I'm quite happy to disallow the use of a keyword as an attribute.
Paul
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:54:47 PDT
and
sponsored by Boyd Technology, Inc.