Re: [sv-bc] "." operator?

From: Rishiyur S. Nikhil <nikhil@bluespec.com>
Date: Fri Apr 30 2004 - 10:50:12 PDT

In a phrase: x.y

there is no impediment to x being an expression, either semantically
or practically. In fact, when we select a member of an element of
an array, e.g., arr[23].y
the LHS is indeed an expression (arr[23]).

However, y cannot be an expression: it has to be a known member name.

Since y cannot be an expression, I don't think of '.' as an operator,
i.e., it's RHS is not an expression, it is always a member name.
In a sense, one could think of '.y' as a post-fix operator on an expression.

Nikhil

Francoise Martinolle wrote:

> Is the " . "an operator?
>
> Can you write the following:
> typedef struct
> {
> logic MEMBER
> integer DATA;
> } mystruct;
>
> mystruct S1, S2;
> reg r;
>
> *r = (cond ? S1 : S2).MEMBER;
>
>
> *In any case, I did not find anything in the formal BNF which allows the
> above; however the . is listed as an operator in table 7.2
>
> Francoise
> '
Received on Fri Apr 30 10:50:15 2004

This archive was generated by hypermail 2.1.8 : Fri Apr 30 2004 - 10:50:19 PDT