Message refanged by ingy :(
On 07/12/01 17:31 +0100, Nadim Khemir wrote:
> > > What I would like to see in the future is Inline::C using
> > > Inline::Yacc (or equivalent) to speed up things. But Inline::Yacc
> > > should use Inline::C this is an egg-chicken paradox. Anyone has an
> > > idea of how to make it work (bootstrap).
> >
> > I have no problem with replacing the P::RD code with something
> > better. However it must fit all definitions of "better". That said,
> > I like the idea of Inline::C using Inline::Yacc for parsing C as an
> > option.
>
> Better is something we want you to define Brian, I think better is 'as
> right' but faster. Other might have other definitions
Better is:
* More accurate (closer to an ANSI compiler)
* Faster, but...
* Must work everywhere
* Must work the same everywhere
* Should have a pure Perl fallback
* This is more to protect against Murphy's Law than for any specific
technical reason. (Those who do not abide by Murphy's Law are
foolish :)
> > The bootstrapping problem is not really a problem at all. Inline::C
> > will merely autodetect Inline::Yacc, and use it. Otherwise it will
> > default back to Parse::RecDescent. Problem solved?
>
> Problem not resolved. I thought Inline::Yacc would use Inline::C that
> would use Inline::Yacc .... To compile the yacc lexer used by
> Inline::C one needs inline::C to compile the parser generated by
> Inline::Yacc. You get the point.
No. I don't. Follow:
1) Install Inline::C
- it uses PRD
2) Install Inline::Yacc
- it uses Inline::C to install
- Inline::C uses PRD
3) Use Inline C;
- it now uses Inline::Yacc
4) Re-Install Inline::Yacc
- it uses Inline::C to install
- Inline::C uses old Inline::Yacc
Chicken and egg problems often aren't.
> > I'd also like to remove the dependency for P::RD from Inline
> > altogether. This is easily done by precompiling the
> > Parse::RecDescent grammar into pure Perl and just distributing that.
> > Are there any Parse::RecDescent gurus in the house who would like to
> > submit a patch?
>
> I vote for writing the grammar in Byacc.
Please do. I'd love to try it.
Cheers, Brian