in reply to RecDescent reuse or modular grammar

Parse::RecDescent builds up the grammer based on strings that you passed to it. So split out what you want common to both parses ('expression', 'expressionlist') into one string, and put the parser-specific parts into a second and third strings. Then use the magic of concatenation and generate your parses from the common and specific parts.


Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
  • Comment on Re: RecDescent reuse or modular grammar

Replies are listed 'Best First'.
Re: Re: RecDescent reuse or modular grammar
by PetaMem (Priest) on Jun 18, 2001 at 19:42 UTC
    Of course! That will work. Forgive my blindness master.

    IŽll immediately try out your advice.

    Thanx & Ciao

    Update: It really works well. One has just to think of a clear structure of the scalars holding the gramar and the perlcode. That is names and level of separation.