From: "Campbell, Rolf [SKY:1U32:EXCH]" Newsgroups: comp.os.msdos.djgpp,comp.lang.c++ Subject: Re: Casting a class as a function pointer. Date: Tue, 13 Jul 1999 14:39:44 -0400 Organization: Nortel Networks Lines: 23 Message-ID: <378B87F0.52B63796@americasm01.nt.com> References: <378A2FFE DOT D9A4F8A0 AT americasm01 DOT nt DOT com> <378AB489 DOT 75F19B1E AT unb DOT ca> <378B7784 DOT E718C436 AT americasm01 DOT nt DOT com> NNTP-Posting-Host: bmerhc00.ca.nortel.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.6 [en] (X11; I; HP-UX B.10.20 9000/712) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Siemel Naran wrote: > > Actually, what I'm going to do is accept any standard cast as an operator: > >operator int (*)() (); > > > >This isn't syntactically correct, but it should never arrise and it means I > >don't have to make another type parser. > Don't accept incorrect code. This might screw some people up who will use > the construct, and when they move to another parse, they're in trouble. > Better to say that you won't accept this construct because you're not sure > if its legal, and people using your parser will be forced to use another > construct that you know is legal and portable. And besides, you're > discouraging them from using operator functions, and that's very good. The parser that I'm working on does compile the code, it's is used as an aid in a development environment (currently only SetEdit, but will support Emacs soon, and RHIDE when new versions come [I haven't checked v4.1.7, maybe it has the sLisp that I need]). It displays information about your code and can do variable-name completion as well as listing the contents of a struct/union/simple class. It is only designed to work with compilable code and thus is allowed to accept a superset of C/C++.