Hi all,
This question is _very_ intressting. I asked something similar 6 moths ago.
I then wanted to have some control over how flex and yacc would interact.
I think the problem is more complex than putting 2 sources in the same file
as we might have multiple languages and even want to do some processing in
between code generation.
What I would like to see is somehthing like:
use Inline Config => PREBUILD => \&PreBuild ;
use Inline Config => POSTBUILD => \&PostBuild ;
use Inline C => <<'END_FIRST';
# should name this in some way
....
END_FIRST
use Inline C => <<'END_SECOND';
# should name this in some way
....
END_C
use Inline Flex => <<'END_FLEX';
# should name this in some way
....
END_FLEX
sub PreBuild
{
# this function should receive information about what is going built
# to be build
# ex1: in the 2 C sources, merge them or make the linker aware
# ex2: Knowing what is going to be build and where I would run
# the inline::Flex first then copy the generated header file where
it # belongs then run bison, lemon, .....
}
Etc...
One or two hooks in inline would do the trick (it's the same principle as
changing the default parser). The solution is general enough.
IMHO this could be more helpful than specific configuration per language and
language mixes.
I didn't get into details because I have not thought about them yet. If this
is of interest, I'd like to discuss it more.
Nadim.
Bug on the web site:
http://conferences.oreillynet.com/cs/os2001/pub/10/perl_tutorials.html#tuesd
ay_pm doesn't link to anything.
> -----Original Message-----
> From: Sisyphus [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 17, 2002 5:39 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Sharing symbols between Inline code blocks
>
> >
> > Any convenient way around this (other than combining the blocks, of
> > course, which can't be done if the blocks are in separate files)?
> >
>
> Any reason why they have to be in separate files ? Seems to me that the
> neatest solution would be to build a module 'First_and_second.pm'
> containing
> both functions and then just 'use First_and_second;' in any script that
> needs the function(s).
> If they need to be kept in separate files, say 'first.pl' and 'second.pl'
> then 'second.pl' could simply contain the line 'require first.pl;'.
>
> Hth
>
> Cheers,
> Rob