[antlr-interest] TokenStreamRewriteEngine and C++
Sebastian Kaliszewski
sk at z.pl
Tue Apr 20 10:22:59 PDT 2004
Hello!
Ric Klaren wrote:
[snip]
> The problem at the moment is that the guys implementing the C++ support
> library port decided to use two flavours of the the reference counter one
> generic one and one especially for the AST's. The generic one is pretty
> dumb (but does the trick for run-of-the-mill refcounting) The special one
> for AST refcounts makes it possible to do some limited casting in the AST
> class hierarchy so you can cast/convert CommonAST's to
> YourFavouriteCustomAST. The support lib uses the dumb version for Tokens
> and with a modern g++ it barfs pretty badly (there might have been a time
> that it worked). In the current state even the simplest custom token class
> stuff seems to fail (or I missed something when I was looking at it, I did
> not have much time then)
>
> In general the reference counter that are used now give loads of trouble
> with polymorphism. E.g. when using custom AST's and especially when using
> heterogeneous AST's. Also there's a can of worms as soon as you tag a const
> somewhere near these refcounters.
>
[snip]
> I'm not 100% sure but I think there's no smartpointer in C++ possible
> that's smart enough to behave like the pointer I'd like for heterogenous
> AST's. I've already looked at the boost smart pointers for a few times (and
> some other implementations (Loki among them)) but I don't think they'll
> solve the actual problem (that it's an object pretending to be a pointer)
If I may ask... What's the exact nature of the problem?
<shameless-plug> I'm an author of yet another smartpointer library, this one
is different though, as it implements full GC instead of just reference
counting. it's here: http://smieciuch.sf.net </shameless-plug>
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.
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