From: Mark Mitchell <mmitchell@usa.net>
To: Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>
Cc: egcs@cygnus.com
Subject: Parsing templates as baseclasses
Date: Sun, 01 Mar 1998 16:59:00 -0000 [thread overview]
Message-ID: <199803011702.RAA22550@quickstep.stanford.edu> (raw)
In-Reply-To: <199803012359.AAA06557@mira.isdn.cs.tu-berlin.de>
>>>>> "Martin" == Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de> writes:
Martin> I'm trying to investigate the code
As we speak, I'm engaged in the process of redoing the cp/parse.y from
scratch, based directly on the grammar in the standard, with the
addition of the GNU extensions that we currently support. This is an
unauthorized, unsanctioned project; in particular, Jason's had nothing
to do with it. I've discovered a number of odd parsing problems, and
after poking around a bit, decided that some major changes were in
order, especially now that the C++ grammar has (finally) stabilized.
So, you might want to hold off; in a week or so I expect to submit the
new (and hopefully much improved) grammar, which should be fully
ISO-conformant. On the other hand, there's no guarantee whatsoever
that this version will be in g++ any time soon; Jason will of course
have to check it over with his usual eagle eye.
Martin> namespace foo {
Martin> template <class T> class x {};
Martin> }
Martin> class y : public foo::x<int> {};
Martin> I've got the lexer to produce, for the last line
Martin> (AGGR `class') (IDENTIFIER_DEFN `y') (':')(VISSPEC)
Martin> (NSNAME)(SCOPE) (PTYPENAME `x')('<')(TYPESPEC `int')('>')
Martin> ('{')
Martin> The last line is eventually reduced -> template_type.
Martin> Then I get an error with the stack state stack now 0 1 4
Martin> 66 222 223 466 717 958 123
Martin> In the non-namespace case, the template_type is further
Martin> reduced
-> type_name -> nonnested_type -> base_class.1
Martin> Now, where should I put the support for
Martin> namespace-qualified template types? I'll have to
Martin> eventually reduce this to baseclass.1 as well, preferably
Martin> without declaring foo::x<int> a nested type (it isn't).
Martin> Also, I'd like to avoid additional conflicts in the
Martin> grammar.
Martin> Any guidance appreciated.
Martin> Martin
--
Mark Mitchell mmitchell@usa.net
Stanford University http://www.stanford.edu
next prev parent reply other threads:[~1998-03-01 16:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-03-01 16:07 Martin von Loewis
1998-03-01 16:59 ` Mark Mitchell [this message]
1998-05-09 3:34 ` Martin von Loewis
1998-03-03 1:08 Mike Stump
1998-03-02 20:02 ` Mark Mitchell
1998-03-04 13:54 ` Neal Becker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199803011702.RAA22550@quickstep.stanford.edu \
--to=mmitchell@usa.net \
--cc=egcs@cygnus.com \
--cc=martin@mira.isdn.cs.tu-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).