C++ standard

R

Ron

C++ has a standard: ISO/IEC 14882. This standard, anyway, reports just an
"informative" grammar (Annex A) that is incomplete since describes a
superset of valid c++ costructs.

So my question is: if someone need to write a complete parser what can be
used as reference?

Greetings.
 
A

Alf P. Steinbach

R

Ron

thanks for your answers.
I think Ron meant
if someone need to write a complete _compiler_ (sans code
generation) what can be used as _a language_ reference

This was the meaning, sorry if it wasn't clear enough.
Backed up by compilation of test cases with compilers known to be pretty
standard-conforming.

Yes. This may be the best way.

The problem is that the parser has to build production trees following a set
of rules defined in the grammar, but the one shared with the standard
documentation is not usable. So it's required to write another.
Now, the standard grammar may be used just as model to develop an usable
one. But then, how can a programmer be sure that his C++ parser based on
his (derived) C++ grammar is 100% ISO/IEC compatible? I think it's
impossible, since doesn't exist an unambiguous description of the language,
but only of a supereset of it.

Thanks for your attention.

Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top