PetaMem has asked for the wisdom of the Perl Monks concerning the following question:
So now I have a perfect working (but somewhat slow) parser called $facts_parser. Ok, but now I would like to create (additionally in the same program) another parser called $rules_parser that reuses e.g. expressionlistmain: entry(s) ... <error: ...> entry: predicate '=' expressionlist expressionlist: expression | expression expressionlist bla bla blah much complicated stuff here
The only solution I have so far is cut&paste. Ugly. Is there a better one?
Ciao
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RecDescent reuse or modular grammar
by knobunc (Pilgrim) on Jun 18, 2001 at 18:56 UTC | |
|
Re: RecDescent reuse or modular grammar
by Masem (Monsignor) on Jun 18, 2001 at 19:16 UTC | |
by PetaMem (Priest) on Jun 18, 2001 at 19:42 UTC | |
|
Re: RecDescent reuse or modular grammar
by ph0enix (Friar) on May 17, 2002 at 09:25 UTC |