[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  Schedule::Load
  SVN::S4
  Synopsys-modes
  SystemPerl
  Verilog-Pli
  Voneline
  Vregs
General Info
  Papers

Controlling callback time in Parser.pm

Added by Jeffrey Lin 7 months ago

Thanks for the great tools.

I’m trying to use the Verilog::Parser and Verilog::SigParser to process my verilog RTL files. I notice that the callback subroutines will be executed when $parser->eof () is called. Is there a way for a user to change the behaviors of the callback subroutines so that it would be executed immediately after a line is parsed by $parser->parse()?

Thank you.


Replies (2)

RE: Controlling callback time in Parser.pm - Added by Wilson Snyder 7 months ago

It does all parsing at the end because it's several times faster, I'd strongly encourage you to use it that way if you can; for example if you're grabbing other text you could look at the file again using ->filename and ->lineno.

Anyhow, you can call eof multiple times if you want, for example in the loop in parse_file in Parser.pm, it'll parse everything unparsed up to that point.

RE: Controlling callback time in Parser.pm - Added by Jeffrey Lin 7 months ago

Thank you for the reply.

The reason I would like a immediate execution of the callbacks is that so I can use regexp to substitute the line parsed by ->parse() on the spot without coming back to it later.

Anyways, your suggestion works and I'm actually doing just that. It just means that I have to collect all the information in the overloaded callbacks then process the file the second time.

Thank you again for your attention. Your tools make my project possible.

Jeffrey Lin

(1-2/2)