Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

alias declaration

0 views
Skip to first unread message

Bernhard Mohr

unread,
Dec 9, 1998, 3:00:00 AM12/9/98
to
An alias is declared like this (LRM 4.3.3):

alias_declaration::=
alias alias_designator [: subtype_indication]
is name [signature];

later int the LRM (4.3.3.2 b) there is written:

A signature is required if the name denotes a subprogram
(including an operator) or enumberation literal.

How can a enumeration literal be a name? Is it legal to have
the following alias defined ?

alias zero is true [return boolean];
alias low is '0' [return bit];


Maybe the correct syntax declaration of an alias shoud be

alias_declaration::=
alias alias_designator [: subtype_indication]
is name | enumeration_literal [signature];


Benny

___________________________________________________________

_/_/_/_/ _/_/_/ DS Diagonal Systems AG
_/ _/ _/ Bernhard Mohr
_/ _/ _/_/ Tumigerstrasse 71
_/ _/ _/ CH-8606 Greifensee
_/_/_/_/ _/_/_/ Switzerland
Phone : +41-1-905-6060
DIAGONAL SYSTEMS Fax : +41-1-905-6069
Email : bern...@diagonal.ch
___________________________________________________________

me...@mench.com

unread,
Dec 11, 1998, 3:00:00 AM12/11/98
to
Bernhard Mohr <bern...@diagonal.ch> wrote:
> An alias is declared like this (LRM 4.3.3):

> alias_declaration::=
> alias alias_designator [: subtype_indication]
> is name [signature];

> later int the LRM (4.3.3.2 b) there is written:
>
> A signature is required if the name denotes a subprogram
> (including an operator) or enumberation literal.

> How can a enumeration literal be a name? Is it legal to have
> the following alias defined ?

An enumeration literal can either be an identifier (for example, True)
or a character literal (for example, '0').

An identifier is a name (see Chapter 6).

A character literal can be part of a name; for example, it is part of
a selected name: Std.Standard.'0' (which is ambiguous, since it can
denote either the literal in Std.Standard.Bit or Std.Standard.Character).

But a character literal is not a name (again, see Chapter 6).

> alias zero is true [return boolean];
> alias low is '0' [return bit];

The first example is legal, the second is not (since '0' is not a name).

> Maybe the correct syntax declaration of an alias shoud be

> alias_declaration::=
> alias alias_designator [: subtype_indication]
> is name | enumeration_literal [signature];

Perhaps; the only thing this change allows is to make the second
example legal. Note that

alias low is ieee.std_logic_1164.'0' [return std_ulogic];

is legal in either formulation.

Regards,

Paul

--
Paul Menchini | me...@mench.com | "Se tu sarai solo,
Menchini & Associates | www.mench.com | tu sarai tutto tuo."
P.O. Box 71767 | 919-479-1670[v] | -- Leonardo Da Vinci
Durham, NC 27722-1767 | 919-479-1671[f] |

0 new messages