|
Boost Users : |
Subject: Re: [Boost-users] [Wave] Modifying the way function-like macros are interpreted
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-12-25 12:59:11
On Fri, Dec 25, 2009 at 10:31 AM, <fractured_at_[hidden]> wrote:
> As Wave is a preprocessor conforming to the C++ Standard this is not
>>
>> possible.
>> But you can define your macro like
>>
>> Â Â #define x(y) llList2String(x,y)
>>
>> if that's an option.
>>
>> OTOH, Wave is open source, so you should be able to find the corresponding
>> code to add your syntax. Do you want _all_ macros to be defined using the
>> []
>> syntax or is this something you want to have additionally to the 'normal'
>> function style syntax?
>
> As far as I can tell, x(y) treats it as a function named x with a argument,
> not the x as a argument itself to do (y) on; in any case I wanted it in
> addition to the normal behavior.
>
> Also, LSL does not use [] except for defining lists, e.g. list ex =
> [entry1,entry2,entr3];, or as a argument to a function, func([1,2,3],.. ,
> but never in this particular manner, which would involve alphanumeric
> characters from the var name directly preceding the [. I was just wondering
> if there was something I could easily change to allow for this through wave.
In that case you could easily make a stand-alone parser out of
Spirit.QI that can do what you wish. Use of the symbol table and
skipping things you are not matching will work perfectly. I doubt you
would want to use Boost.Wave though as it would be difficult to edit
and would do a *lot* more then necessary (and be slower because of
that).
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net