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

Grammar simplification straw poll

2 views
Skip to first unread message

Michiel Salters

unread,
Jun 4, 2002, 1:17:02 PM6/4/02
to
I'm wondering if it's worth to simplify the grammar of
conditional statements slightly. Currently there's a special
production to generate declarations in if-statements:

condition:
expression
type-specifier-seq declarator = assignment-expression

This could be simplified, I think, by "reusing" the
decl-specifier-seq_opt init-declarator-lis_opt parts from
simple-declaration ( thus everything except the ; ).

This would allow

if ( T a(b) )
{
// use a
}

just as the following currently is legal

for( T a(b) ;; )
{
// use a
}

I coudn't see an obvious parsing problem, but that of course
doesn't prove anything.

[ This issue was brought up in a Dutch programming forum ]

Regards,
--
Michiel Salters

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std...@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]

0 new messages