Author Topic: How can C::B catch gFortran compilation error?  (Read 4220 times)

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
How can C::B catch gFortran compilation error?
« on: November 03, 2010, 12:58:52 pm »
I want to let C::B catch the Fortran error, how can I do it?  
For example,
Code
program main
  implicit none

  write(*,*) "Hello World!"

 // stop
end program
the code above can show the errors below:
Code
E:\MyProjects\test\dfvf\main.f90:6.2:
 // stop
  1
Error: Invalid character in name at (1)
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
The line "// stop" is an error, and that should be "stop".
I know C::B have Advanced compiler Options-Output parsing, but after using some regex rules, the C::B can only catch one row information, and the errors above have 4 rows.
For example, I use the rule below
Code
(.*Error.*)
can only catch the line
Code
Error: Invalid character in name at (1)
and I use the rule below
Code
.*:([0-9]).*
can only catch the line
Code
E:\MyProjects\test\dfvf\main.f90:6.2:
but I use the rule below
Code
.*:([0-9]).*(Error.*)
that caches nothing.  :?

I think the C::B's error cathing can catch only one line, isn't it?
But how can I catch more lines error, because one fortran error returns four rows information. :(

Thank you!
« Last Edit: November 04, 2010, 06:09:55 am by xunxun1982 »
Regards,
xunxun