hi,
I have a question regarding Parse::RecDescent and it is - how can I skip some stuff, the idea is to just not parse some of the text until i i'm clear how will parse more important part of the text...ugrhhh.. restating :") f.e. lets have following text repeated many times :
class htb 2:11 root leaf 13: prio 0 rate 3125bps ceil .....
Sent 16822354 bytes 15272 pkts (dropped 0, overlimits 0)
lended: 15272 borrowed: 0 giants: 0
tokens: 38 ctokens: 38
at the moment the only interesting thing for me is the second line i.e. :
Sent 16822354 bytes 15272 pkts (dropped 0, overlimits 0)
so how to make the grammar in a such a way so that i skip other things an concentrate only on this one..(i don't mean i doesn't want to parse the other stuff, just want to temporarily skip them until i finish second row.)
I've tried to use <resync> w/o succees..
Currently i'm tryng this w/o big success, where is my error ? I'm missing something very basic !!!
our $tcClassGrammar = q{
classStart : class(s)
class : 'class' classinfo stats stats2 stats3 #{print "$item[0]\n
+"; 1}
classinfo : /.+?\n/
stats : 'Sent' /\d+/ 'bytes' /\d+/ 'pkts' '(dropped' /\d+/ ',' 'ov
+erlimits' /d+/ ')' { print "item[0]"; 1}
stats2 : /.+?\n/
stats3 : /.+?\n/
};
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.