home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!usc!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!darwin.sura.net!uvaarpa!cv3.cv.nrao.edu!laphroaig!cflatter
- From: cflatter@nrao.edu (Chris Flatters)
- Subject: Re: template disappointments ... (suggesti
- Message-ID: <1992Dec30.161136.24591@nrao.edu>
- Sender: news@nrao.edu
- Reply-To: cflatter@nrao.edu
- Organization: NRAO
- References: <1hqnd6INNe83@agate.berkeley.edu>
- Date: Wed, 30 Dec 1992 16:11:36 GMT
- Lines: 26
-
- In article 1hqnd6INNe83@agate.berkeley.edu, jbuck@foucault.berkeley.edu (Joe Buck) writes:
- >In article <24508@alice.att.com> ark@alice.UUCP () writes:
- >>In article <DSCHIEB.92Dec29133556@muse.cv.nrao.edu> dschieb@muse.cv.nrao.edu (Darrell Schiebel) writes:
- >>> list<vector<int>> list_vec_int;
- >>
- >>Huh?? This works fine -- just remember to put a space between the
- >>two > characters so the >> won't be taken for a shift-right symbol.
- >
- >This is such a common error (and is so ugly) that compiler writers
- >would be well advised to add productions to their grammar that catch
- >it, or magic that splits the >> token into two tokens in this case
- >if that fits in with the compiler's structure.
- >
- >Yes, I know that the rules of lexical analysis force the >> to be one
- >token, but list<vector<int>> is a perfectly natural way of writing
- >this thing, so perhaps it should be permitted even at the cost of
- >adding an ugly rule to the grammar.
-
- It requires more than a modification to the grammar (unless you find it
- acceptable to allow arbitrary amounts of whitespace in the middle of
- a right-shift operator). You would have to switch lexical analysers
- while parsing a template declaration or a template class name and switch
- back afterwards.
-
- Chris Flatters
- cflatter@nrao.edu
-