An alternative FFI/Parser proposal

Lukas Renggli renggli at gmail.com
Thu Aug 17 07:47:08 UTC 2006


> A good way of dealing with these differences would be if a client could
> register specific pragmas which are parsed in a client dependent manner.
> So that, for example, the FFI would register <apicall:> and <cdecl:> for
> FFI specs and Tweak may register <on:> for parsing method triggers[*].
> In this case, Parser could simply invoke the proper client for a
> registered pragma, pass it a stream and let it decide what to do. Given
> a sufficient interface for client and Parser, this would leave the
> entire responsibility with the client instead of Parser, but Parser
> could still provide a default implementation.

Nice idea, though ...

> Unfortunately, there are also a couple of gotchas with the proposal:

+ support for different parser/compiler will be difficult
+ breaks encapsulation of the parser/compiler
+ de-compilation won't work out-of-the-box
+ inconsistent syntax: the current FFI syntax makes no sense, it is
neither valid C nor valid Smalltalk code, I suspect it was done like
this to simplify the parsing)

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list