[antlr-interest] TokenStreamRewriteEngine and C++
Sebastian Kaliszewski
sk at z.pl
Wed Apr 21 06:31:00 PDT 2004
Ric Klaren wrote:
>>If I may ask... What's the exact nature of the problem?
>
> See my answer to Mark Lentczner mail and a small bit about it below.
>
>>Maybe, as I played with such stuff, I could be of some help... Or if it's
>>impossible to do as ANTLR needs it to be, I'd be also interested in knowing
>>about the exact limitations.
>
> I'll probably come back on this issue somewhere after I've toyed more
> extensively with it again (and did make notes about what exactly goes
> wrong).
Don't hestiate to inform all of us at antlr-interest when you come back to this.
> Most of the problem is around up and downcasting along AST-type
> hierarchies.
Well, I think this one should be tractable if only compiler supports member
templates (all decent ones including MSVC 6.0 do support it, MSVC 6.0 can't
handle friend templates does not support separate new[] operator and has
nonstandard way of dealing with unsuccesfull allocations but those are minor
problems). Then add smart_ptr version of dynamic_cast (easy) and thing
should be ok.
> Must say that your library looks interesting.
:)
Well, I needed something which would deal with reference cycles for my Antlr
based project (and something which would not leak from time to time like
Boehm's collector), and I didn't found anything good enough, hence Smieciuch.
<more-shameless-plugging>
As I side effect of the fact it doesn't do a refcounting and as an effect of
the choosen design (the basic idea is not mine) is the possibility to do an
unconstrained conversion to/from plain pointers (plain pointers take a role
of weak pointers), given the object is allocated thorough GC version of new
or new[]. Even some "awfull" things like casting 'this' to smartpointer or
converting pointers to fields of GC managed objects into smartpointers are
perfectly legal.
</more-shameless-plugging>
rgds
--
Sebastian Kaliszewski
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list