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
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 |
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 = '[
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
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:
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
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
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
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-
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
10 matches
Mail list logo