Re: C++ Grammar

"Aaron Gray" <aarongray@beeb.net>
15 Aug 2001 01:13:55 -0400

          From comp.compilers

Related articles
C++ Grammar aarongray@beeb.net (Aaron Gray) (2001-08-06)
Re: C++ Grammar mike@dimmick.demon.co.uk (Mike Dimmick) (2001-08-08)
Re: C++ Grammar dosreis@cmla.ens-cachan.fr (Gabriel Dos Reis) (2001-08-08)
Re: C++ Grammar mike@dimmick.demon.co.uk (Mike Dimmick) (2001-08-08)
Re: C++ Grammar aarongray@beeb.net (Aaron Gray) (2001-08-15)
Re: C++ Grammar dosreis@cmla.ens-cachan.fr (Gabriel Dos Reis) (2001-08-15)
Re: C++ Grammar aarongray@beeb.net (Aaron Gray) (2001-08-15)
Re: C++ Grammar dosreis@cmla.ens-cachan.fr (Gabriel Dos Reis) (2001-08-16)
Re: C++ Grammar iank@idiom.com (2001-08-17)
Re: C++ Grammar jerry@swsl.co.uk (Jerry Evans) (2001-08-17)
Re: C++ Grammar cfc@world.std.com (Chris F Clark) (2001-08-17)
[5 later articles]
| List of all articles for this month |

From: "Aaron Gray" <aarongray@beeb.net>
Newsgroups: comp.compilers
Date: 15 Aug 2001 01:13:55 -0400
Organization: A Beeb User
References: 01-08-037 01-08-046 01-08-055
Keywords: C++, parse
Posted-Date: 15 Aug 2001 01:13:53 EDT

Dear All,
                LR(2+) by the looks of it then. It would be nice to have found an
upto date C++ YACC grammar, even though I am not using YACC or Bison. I am
at present porting a parser generator called Elegant it is either LL(1),
Recursive descent, or LALR(1).
                I have been looking at algorithms for generating an [LA]LR(k) parser
generator, and think that I might be able to implement one soon, the area
came into my head in a flash of realization, it is very simple, add an NFA
at the front end of the PDA, so you have the ability to "delay" deteminacy
until it is determinate, so to speak.
I am looking at creating my own YACC alike but [LA]LR(K), I call it ACC,
well why not.
                Anyway I have an older version of the C++ grammar typed in (pre
templates I think), I will have to get or burrow B. Stroustrup's third "The
C++ Programming Language", unless I have all ready brought it, cannot
remember my library !
        I would appreciate if you have a typed copy of the grammar if you could
send me a copy as an attachment, if you would not mind. Also it would be a
good idea to put it on the comp.compilers fpt site. And maybe we can create
a YACC compatible C++ grammar from the old and the new.
        Many thanks,
                Yours Sincerely,
                        Aaron Gray




"Mike Dimmick" <mike@dimmick.demon.co.uk> wrote in message
> "Gabriel Dos Reis" <dosreis@cmla.ens-cachan.fr> wrote in message
> > "Aaron Gray" <aarongray@beeb.net> writes:
> >
> > | Dear All,
> > | does anyone happen to know or have a more up to date C++ grammar
> than
> > | the old comp.compilers one :-
> > |
> > | ftp://ftp.iecc.com/pub/file/c++grammar
> >
> > You may find one in B. Stroustrup's third "The C++ Programming
Language".
>
> > [Any idea how well it works with parser generators? -John]
>
> There's A grammar there. It's for explanation of the language, and is a
> direct duplicate of Appendix A of ISO/IEC 14882:1998 (or in other words,
the
> C++ standard).
>
> It's not LALR(1), nor is it LL(k), and it isn't suitable for direct
> implementation by any method. At least, I found that it wasn't.
>
> My copy of Stroustrup has now lost pages 848-9 (from memory) due to being
> overly referenced!


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.