Hey Yury:

Yes, you are right.  I was thinking this was a function and not a method.
 As an even ickier workaround:

#define TokenStack_top_p(token_stack)  &token_stack->top()

cdef extern from "............":
    Token* TokenStack_top_p(TokenStack*) except +

cdef Token* tok = TokenStack_top_p(self.pEngine.OStack)

-Brad


On Thu, Feb 28, 2013 at 10:38 AM, Yury V. Zaytsev <y...@shurup.com> wrote:

> Hi Brad,
>
> On Thu, 2013-02-28 at 08:01 -0800, Bradley M. Froehle wrote:
> >
> > cdef extern from "test.h":
> >     int* foo2ptr "&foo" ()
> >
> > cdef int *x = foo2ptr()
>
> Thank you for this interesting suggestion, but I must be missing
> something, because when I do the following:
>
>     cdef extern from "tokenstack.h":
>         cppclass TokenStack:
>             Token* top "Token&" () except +
>
>     cdef Token* tok = self.pEngine.OStack.top()
>
> I end up with the following generated code, which, of course, doesn't
> compile:
>
>     Token *__pyx_t_5;
>     __pyx_t_5 = __pyx_v_self->pEngine->OStack.Token&();
>
> whereas, I'd like to see generated this:
>
>     Token *__pyx_t_5;
>     __pyx_t_5 = __pyx_v_self->pEngine->OStack->top();
>
> Any ideas?
>
> --
> Sincerely yours,
> Yury V. Zaytsev
>
>
> _______________________________________________
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel
>
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to