[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

Issue #403

Verilog::Parser (* causes error

Added by Walter Lavino 7 months ago. Updated 5 months ago.

Status:Closed Start date:10/25/2011
Priority:Normal Due date:
Assignee:Wilson Snyder % Done:

0%

Category:-
Target version:-

Description

Wilson, always @ (* ) begin // { ... end // }

( I am using the CPAN Verilog::Parser (+ Verilog::SigParser) ) 
In my verilog code, I had this statement.

This caused the parser, to see the always parameters as a comment ( due to space found after the asteriks), than reading until the end of the file and than calling the $parser->eof() method and from here it seems exiting the program with message:

" %Error: filename.v:211: EOF in (* fatal flex scanner internal error--end of buffer missed "

However since I am calling the parser in a loop on multiple files I would like to have the control when the parser actually exits. Is there anyway or any callback with which I could avoid the exit of my program and for me to continue my loop ?

So calling the parser like:

$parser->parse_file (shift);
 print STDERR "AA\n";

would not print AA

thanks and regards, Walo

try.v (139 Bytes) Walter Lavino, 10/25/2011 01:30 pm

History

Updated by Wilson Snyder 7 months ago

  • Status changed from New to Closed

[Usage]

On this or most errors, the parser calls the error callback, which defaults (Parser.pm's error) to calls croak. You can thus make your own error callback and override this behavior.

Updated by Walter Lavino 7 months ago

Wilson, I had already overriden the error callback ( and disabled the croak), but flex seems to exit with message

fatal flex scanner internal error--end of buffer missed
when returning from the error callback.
I had made a trial by overriding the 'eof' callback, which made the process
to continue ( so ignoring the flex error ), but calling the SUPER::eof() ( ie. Verilog::Parser::eof )
also exited the program.

regards, Walter

Updated by Wilson Snyder 7 months ago

I poked around a bit trying to fix this, but flex (the lexical analyzer which gives the error) doesn't allow a program to put "back" an EOF so it will be seen later. So unfortunately you won't be able to scan again so if you really want to be bullet proof, you'll need to call your parser under a fork() as a child.

Updated by Wilson Snyder 7 months ago

  • Status changed from Closed to Resolved
  • Assignee set to Wilson Snyder

As for the "@(* )" this seems to be legal, and fixed in git towards next release 3.313.

Updated by Walter Lavino 7 months ago

Wilson,

Thanks for future fix.
As for the fatal exit, I will use a fork/child solution.
( However still strange flex decides to exit and not return user control.)

regards, Walter

Updated by Wilson Snyder 6 months ago

  • Status changed from Resolved to Closed

In Verilator 3.830.

Updated by Wilson Snyder 6 months ago

  • Status changed from Closed to Resolved

Still only resolved, not in Verilog-Perl yet.

Updated by Wilson Snyder 6 months ago

  • Subject changed from Verilog::Parser to Verilog::Parser (* causes error

Updated by Wilson Snyder 5 months ago

  • Status changed from Resolved to Closed

In 3.313.

Also available in: Atom