On 23/10/02 10:05 +0200, Nadim Khemir wrote:
>
> Nadim wrote:
> > > %{
> > > // ParseManual: int yylex(void)
> > > %}
> >
>
> My example might be misleading, only '// ParseManual ......' is needed if C
> is the language, the rest is the Flex way to introduce a comment.
Understood.
>
> Brian wrote:
> > I have been thinking of something a little more flexible:
> >
> > // InlineParse: ON
> > int yylex(void) {
> > // InlineParse: OFF
> > ...
>
> 2 lines instead of one, remembering to set something on then off (just for
> one line). I don't think this is flexible. There are certainly other ways to
> do this and it would be interesting to hear what the other like or not.
Well the above is a bad example. The normal use case is:
__C__
/* Parsing is on by default */
/* Functions that should bind: */
int foo() {...
/* InlineParse: OFF */
/* Functions that shouldn't bind */
int bar() {...
So the typical usage is one line per file. Just turn off parsing when you
want to. But it could also be as flexible as you want.
> // InlineExport
> int yylex(void) {
This style requires one line per function. Too verbose. And I don't like
proximity syntax.
> might be good too. There are lots of coding styles out there and parsing
> them all can be difficult (may be it is better with a rigid declaration
> command) I for example often write
>
> return type * class::class::function
> (
> int a_arg // comment
> , int a_arg2 // range , whatever
> , ...
> ....
> )
> {
>
> > I'd be glad to start discussing this in the next
> > release.
>
> Ready when you are.
>
> > I think having a standard way of telling Inline what to parse, and what
> > not to is a fine idea.
> And fast too. But a real C parser that is real ___FAST is still the best
> solution.
>
> I might have misunderstood the USING command but The important thing is to
> allow for different parsers for different Inline code snips. Is this already
> possible or is the parser setting global?
You could try it :)
I think this should work:
use Inline C => '...' => USING => ParseFoo;
use Inline C => '...' => USING => ParseBar;
But you're gonna get two .so objects at this point. In the future, there will
be a way to combine these into one object.
Cheers, Brian