keyword value(s) newline

2004-05-12 Thread Alexander.Farber
Hi, I'm struggling since few days, trying to parse text files, which contain C and C++ comments, some #if/#else/#endif statements and for the most part assignments happening on 1 line. The keyword in the beginning of the line is followed by space separated values. I feel that I've done my

RE: keyword value(s) newline

2004-05-12 Thread Alexander.Farber
Sorry, small typo in my mail - the startrule is actually called mmpfile in my script. So the (non-working) script is: -Original Message- From: ext [mailto:[EMAIL PROTECTED] $parser = Parse::RecDescent-new(q( mmpfile: chunk(s) /^\Z/ chunk: comment | skip: /[ \t]*/ assignment |

RE: Using $skip='[ \t]+' to parse line(s)

2004-05-14 Thread Alexander.Farber
Just FYI, I've registered a perl bug for that issue http://rt.perl.org/rt3/Ticket/Display.html?id=29576 -Original Message- From: ext [mailto:[EMAIL PROTECTED] use strict; use vars qw($parser $text %hol); use Data::Dumper; use Parse::RecDescent; $Parse::RecDescent::skip = '[

RE: Using $skip='[ \t]+' to parse line(s)

2004-05-14 Thread Alexander.Farber
Sorry for one more mail, but just for the record: that has been my own fault. My both problems (KEY1 = 'undef' and having to use ref $item{value}) were caused by these change in P:RD: - BACKWARDS INCOMPATIBLE CHANGE: The key of an %item entry for a repeated subrule now includes the repetition

return from action

2004-05-28 Thread Alexander.Farber
Hi, I have a not-so-important, cosmetic question. I'm trying to convert some weird Windows based build system to GNU Makefiles on Unix. The script at the bottom of this mail works for me, but I do appreciate any comments on that. My question is: first I've written this action which didn't work:

RE: return from action [Version 2.0]

2004-05-28 Thread Alexander.Farber
Hi Ron, -Original Message- From: ext Ron D. Smith [mailto:[EMAIL PROTECTED] export: path skip: '[ \t]+' path(?) ...!sectionorkeyword { .. } | path keyword path: /[^]*/ | ...!sectionorkeyword /\S+/ nice idea, thanks. Also since my action code was getting so bulky I've moved it

RE: skipping backslashes at the end of lines

2004-06-01 Thread Alexander.Farber
I've solved my problem by using skip: '(?:\s|[ \t]*\n)+' six backslashes work too: skip: '(?:\s|\\[ \t]*\n)+' Still I don't understand why this works this way and there is not much to see in the RD_TRACE file (only the debug print statements) -Original

Parsing comments again (cpp linemarkers)

2004-06-03 Thread Alexander.Farber
Hi, I'm almost finished with the script (the stripped down test case is on the bottom of this mail) which parses cpp-preprocessed output. The pecularity of parsing cpp-output is that if the cpp-processed file #includes a file, then cpp prints a linemarker line, like: # 1

RE: error messages

2004-07-09 Thread Alexander.Farber
Hi, I think your question is related to the OS you're using and not to P::RD. Have you tried redirecting STDERR (as in perldoc -f open) before calling the parser? And you can always modify Descent.pm if you don't like what it's doing with STDERR ;-) Regards Alex -Original Message-

RE: Reset local parser variables for each new input file

2004-09-13 Thread Alexander.Farber
Yes, I've tried that and it seems to work, but I'm worried about the cases when the input files don't parse. Will the mmpfile: { $i = 1 } still always trigger? Also, what is it? It's not an action for the mmprule, isn't it? -Original Message- From: ext Sean O'Rourke [mailto:[EMAIL