in reply to looking Generic File Parser script?

To parse Verilog, you can use Hardware::Verilog::Parser. I used this parser on a large Verilog library. It worked, but it was a bit slow for my purposes.

Maybe someone else knows of a C or C++ parser that is similar. Parsers are not generic because they depend on the grammar of the language being parsed.

If you store the code in a hash and want to re-assemble it, you'll need some way to get the code to come out in order, since an ordinary perl hash doesn't preserve order.

Instead of an ordinary hash, use one of perl's object-oriented data structure modules. The best module to choose for your task depends on a lot of details, so please describe your problem in more detail to get better advice on this.

It should work perfectly the first time! - toma
  • Comment on Re: looking Generic File Parser script?