chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] easyffi virtual=0 methods


From: felix winkelmann
Subject: Re: [Chicken-users] easyffi virtual=0 methods
Date: Mon, 12 Mar 2007 09:48:58 +0100

On 3/12/07, Carlos Pita <address@hidden> wrote:
I was thinking a bit more about this and concluded that it wouldn't be
possible to derive from an abstract C++ class in tinyclos anyway
(because of the impossibility of constructing an instance of that class
from anywhere but a subclass C++ constructor). So I decided to subclass
the problematic class from C++ providing default dummy implementations
for the abstract methods. Now I must call the (non-default) constructor
of the subclass and I'm having trouble with the easyffi parser for the
syntax: ctor(...) : base-ctor(..) {}. One thing I can do to solve this
is to put the definition inside a #> <# block and the declaration inside
a #>? <# block (instead of putting the definition once in-between #>!
<#). But in any case, the easyffi documentation in
http://galinha.ucpel.tche.br:8080//easyffi#foreign-include-path states
that the grammar supports calling base constructors:

CONSTRUCTOR = ["___callback" | "___safe"] ["explicit"] ID "(" ARGTYPE
"," ... ")" [BASECONSTRUCTORS] [CODE]

Specifically, the problematic line is:

  ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool
interleaved ) : StkFrames(nFrames, nChannels, interleaved) {}

And the reported error is:

Error: during expansion of (foreign-parse ...) - unexpected tokens: ((op
":") (id "StkFrames") open-paren (id "nFrames") comma (id "nChannels")
comma (id "interleaved") close-paren (scope))


This works for me:

#>?
class ScmStkFrames {
ScmStkFrames( unsigned int nFrames, unsigned int nChannels, bool
interleaved ) : StkFrames(nFrames, nChannels, interleaved) {}
};
<#


Can you provide a complete example?


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]