Re: pyparser and recursion problem

2007-07-27 Thread pyscottishguy
Hey, Thanks for the further explanations. I'm going to play around more with the 'recursive grammar' and 'parse-time dynamic grammar element' stuff so that I understand it a bit better. I liked the changes you suggested. The alternative grammar definitely makes the code easier to understand, plu

Re: pyparser and recursion problem

2007-07-27 Thread Paul McGuire
On Jul 26, 10:40 pm, [EMAIL PROTECTED] wrote: > Hey, > > Thanks Neil and Paul! > > After reading Neil's advice I started playing around with the > setParseAction method, and then I found Paul's script > 'macroExpander.py' (http://pyparsing.wikispaces.com/space/showimage/ > macroExpander.py). > Gr

Re: pyparser and recursion problem

2007-07-26 Thread pyscottishguy
Hey, Thanks Neil and Paul! After reading Neil's advice I started playing around with the setParseAction method, and then I found Paul's script 'macroExpander.py' (http://pyparsing.wikispaces.com/space/showimage/ macroExpander.py). With only a few modifications to macroExpander.py (and reversing

Re: pyparser and recursion problem

2007-07-26 Thread Paul McGuire
On Jul 26, 3:27 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > Hopefully I'll have time to help you a bit more later, or Paul > MaGuire will swoop down in his pyparsing powered super-suit. ;) > There's no need to fear...! Neil was dead on, and your parser is almost exactly right. Congratulations

Re: pyparser and recursion problem

2007-07-26 Thread Neil Cerutti
On 2007-07-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Using pyparser, I'm trying to parse a string like this: > >:Start: first SECOND THIRD :SECOND: second1 | second2 :THIRD: third1 | > FOURTH :FOURTH: fourth1 | fourth2 > > I want the parser to do the following: > 1) Get the text for the :