Google Groepen ondersteunt geen nieuwe Usenet-berichten of -abonnementen meer. Historische content blijft zichtbaar.

Grammar simplification straw poll

0 weergaven
Naar het eerste ongelezen bericht

Michiel Salters

ongelezen,
4 jun 2002, 13:17:0204-06-2002
aan
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 nieuwe berichten