Topic: Repitition in grammer


Author: cv_curious <phdscholar80@yahoo.com>
Date: Fri, 16 Sep 2011 19:46:20 -0700 (PDT)
Raw View
Referring to Appendix A of ISO/IEC 14882:2011, the following seems to
have been repeated twice in A.1 and A.6:

typedef-name:
       identifier

Is this intentional? Is their any 'officially' maintained version
available in plain text format and proper BNF notation meant for
writers of parsers/pretty printers?? It is SUCH a pain to manually go
through almost 1000 lines of grammar and hand-edit it to comply with
parser tools. Anyone have any suggestions in this regard?


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]




Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?=<daniel.kruegler@googlemail.com>
Date: Tue, 20 Sep 2011 10:10:52 -0700 (PDT)
Raw View
Am 17.09.2011 04:46, schrieb cv_curious:
>  Referring to Appendix A of ISO/IEC 14882:2011, the following seems to
>  have been repeated twice in A.1 and A.6:
>
>  typedef-name:
>          identifier

This is not the only place of a repetition, e.g. /class-name/ is defined
in both A.1 and A.8 as another example.

>  Is this intentional?

I think it is intentional. Note that the grammar summary in annex A is
sub-divided into several non-exclusive categories, like "keywords" and
"declarations" and "classes", etc.

>  Is their any 'officially' maintained version
>  available in plain text format and proper BNF notation meant for
>  writers of parsers/pretty printers??

Not that I know of. Annex A for sure is *not*. The introduction clearly
says

"This summary of C++ syntax is intended to be an aid to comprehension.
It is not an exact statement of the language."

Further, the complete annex A has the attribute "informative" and is
considered as a non-normative, purely informative addition to the
standard document. This is conform to ISO/IEC rules (see 5.1.3 of
"ISO/IEC Directives, Part 2" from

http://preview.tinyurl.com/3a4qh3

>  It is SUCH a pain to manually go
>  through almost 1000 lines of grammar and hand-edit it to comply with
>  parser tools. Anyone have any suggestions in this regard?

Unfortunately, I have not.

HTH&  Greetings from Bremen,

Daniel Kr   gler


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]




Author: Joshua Maurice<joshuamaurice@gmail.com>
Date: Wed, 21 Sep 2011 11:08:05 -0700 (PDT)
Raw View
On Sep 16, 7:46 pm, cv_curious<phdschola...@yahoo.com>  wrote:
>  Referring to Appendix A of ISO/IEC 14882:2011, the following seems to
>  have been repeated twice in A.1 and A.6:
>
>  typedef-name:
>          identifier
>
>  Is this intentional? Is their any 'officially' maintained version
>  available in plain text format and proper BNF notation meant for
>  writers of parsers/pretty printers?? It is SUCH a pain to manually go
>  through almost 1000 lines of grammar and hand-edit it to comply with
>  parser tools. Anyone have any suggestions in this regard?

Do note that C++ is not traditionally what is called "a context free
grammar". AFAIK, most commercial parsers have some interesting hacks
to make it work out decently well. You can get a pretty good BNF
notation grammar which requires only some minimal cleanup after the
parser invocation though.


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]




Author: cv_curious<phdscholar80@yahoo.com>
Date: Sat, 24 Sep 2011 21:47:00 -0700 (PDT)
Raw View
Am I to understand that the relevant grammar for each portion of the
language is normatively defined within the respective section in the
standard? Meaning, the grammer for preprocessing directives (for
example) present in Sec 16 is normative and a parser writer should
refer there. Am I getting this right? Many thanks in advance for all
the help.


--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]




Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?=<daniel.kruegler@googlemail.com>
Date: Sun, 25 Sep 2011 08:28:47 -0700 (PDT)
Raw View
Am 25.09.2011 06:47, schrieb cv_curious:
>  Am I to understand that the relevant grammar for each portion of the
>  language is normatively defined within the respective section in the
>  standard?

The relevant point is, whether it is described in a normative part of
the standard. Usually this means, that the relevant grammar is explained
in the corresponding clause or sub-clause.

>  Meaning, the grammer for preprocessing directives (for
>  example) present in Sec 16 is normative and a parser writer should
>  refer there. Am I getting this right?

Yes, this is normative text.

HTH&  Greetings from Bremen,

Daniel Kr   gler



--
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]