Hi..
I am going through following problem.
Let me explain you....
I have to extarct information from the file...
lets file is x.v
module x;
pattern:start
p1;
p2;
endpattern
endmodule
module y;
pattern:xxx
p3;
p4;
endpattern
endmodule
I am extracting information from the file and creating a hash map.
I need to store..
{module name} = pattern content...
here I will be like this
hashmap{x} = p1 p2
hashmap{y} = p3 p4
How cam I do that..........
I am struggling...
Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 1 | 1 | 15 | 361 | 3,808 |
/Forum/anonymous41.html copyright September 2006 anonymous All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Thu Sep 21 09:35:24 2006: Subject: anonymous
Need a stopping condition...
ex:
module m1;
endmodule
module m2;
endmodule
so like
while<fp_ptr> {
if (/module\s*(\w)\)?.*/) {
my moduleName = $1;
}
parse till encounter endmodule... Then start from the beginning.
This condition I want.
}
The file can contain... n module definition.
Fri Sep 22 13:19:32 2006: Subject: TonyLawrence
This smells like a course assignment.
There's nothing hard here.. it's pretty basic parsing.
I doubt anyone here is going to do your homework for you. If you provided code you tried to write that didn't work, we MIGHT help you out if you explain it well and aren't just dumping a bunch of junk.
Otherwise, sorry, but no.
Sun Sep 24 04:12:34 2006: Subject: anonymous
I think I have confused everybody...
Here in short what I want to do...
I want to extract pattern from the file which can come multiple times...
pattern_1 any_thingh
pattern_2:anything /*I want to extract
anything pattern_2 to pattern_3 and store that
anything in a string
pattern_3 */
pattern_4
patten2 - pattern3 can come multiple time inside patten1- pattern2..
Sun Sep 24 11:39:44 2006: Subject: TonyLawrence
The only confusion is you thinking that people are going to write programs for you for free.
Mon Sep 25 04:43:13 2006: Subject: anonymous
ok taken!! Thanks anyway....I think I will solve it
Mon Sep 25 16:41:58 2006: Subject: anonymous
Try the free sample chapter of the book Pro Perl Parsing. It will teach you what you need to know.
http://www.apress.com/book/bookDisplay.html?bID=432
Add your comments