[sv-ec] typedef grammar incomplete


Subject: [sv-ec] typedef grammar incomplete
From: Paul Graham (pgraham@cadence.com)
Date: Mon Dec 08 2003 - 08:17:11 PST


I don't see any productions in the grammar to support the typedef examples
given in section 3.9:

    typedef enum type_declaration_identifier;
    typedef struct type_declaration_identifier;
    typedef union type_declaration_identifier;
    typedef class type_declaration_identifier; ** only this one is allowed **

It looks like you need to add another production:

    type_declaration ::=
        ...
        | "typedef" type_kind type_identifier

    type_kind ::=
        enum | struct | union | class

(though "type_kind" has a funny sound to it :-)

Paul



This archive was generated by hypermail 2b28 : Mon Dec 08 2003 - 08:18:00 PST