Topic: grammar rules for id-expression
Author: bfatyga@slab.cica.indiana.edu (Beata Winnicka)
Date: Tue, 9 Aug 1994 16:15:14 GMT Raw View
In the 25 January 1994 draft of the standard, the grammar rules for
id-expression do not allow expressions like ~int() to be id-expressions.
(see Box 24, page 5-2).
I am trying to rewrite the expression grammar to remove the ambiguity
arising in parsing ~ class-name() (this can be currently parsed using
either the "unqualified-id -> ~ class-name" rule or the "unary-expression
-> unary-operator cast-expression" rule) and I've been wondering if I have
to worry about other destructor expressions having ambiguous parse trees
as well.
So, what's the latest status of id-expression rules? Is it likely that the
grammar in the January draft will remain unchanged (and ~int() will be
disallowed as an id-expression) or should the "unqualified-id -> ~
class-name" rule be broadened to allow, for example:
"unqualified-id -> ~ simple-type-specifier"?
-- Beata Winnicka