Thread: [Cgdb-users] Fortran Syntax highlighting not working?
Brought to you by:
bobbybrasko,
crouchingturbo
From: Mike H. <mik...@ya...> - 2010-06-15 10:44:37
|
Hi, I have just recently started using cgdb for fortran after using it for a while for C. Cgdb seems to recognise that it is working with fortran. In fact it is C code that calls the main FORTRAN routine, and when I step into it, the cgdb output reads: Current language: auto The current source language is "auto; currently fortran". But none of the code in the display is highlighted, not even the comments are differentiated. I have looked at the syntax highlighting documentation, but it only seems to deal with modifying the colours of known types of code, rather than defining the actual scheme. [How] can I view/modify/fix the syntax highlighting scheme currently used by cgdb? I am running cgdb 0.6.5 on debian 2.6.32-3-amd64. Any other insights into cgdb+fortran gratefully received! Cheers! |
From: Bob R. <bo...@br...> - 2010-06-15 11:33:39
|
On Tue, Jun 15, 2010 at 10:44:30AM +0000, Mike Hudson wrote: > Hi, > > I have just recently started using cgdb for fortran after using it for a while for C. Cgdb seems to recognise that it is working with fortran. In fact it is C code that calls the main FORTRAN routine, and when I step into it, the cgdb output reads: > > Current language: auto > The current source language is "auto; currently fortran". > > But none of the code in the display is highlighted, not even the comments are differentiated. > I have looked at the syntax highlighting documentation, but it only seems to deal with modifying the colours of known types of code, rather than defining the actual scheme. > > [How] can I view/modify/fix the syntax highlighting scheme currently used by cgdb? I am running cgdb 0.6.5 on debian 2.6.32-3-amd64. > Any other insights into cgdb+fortran gratefully received! It's relatively easy to add a new syntax highlighter for cgdb. If you look in cgdb/tokenizer/include/tokenizer.h, that defines a very simple interface. It includes a token kind, a token language, and some functions that cgdb will call. In cgdb/tokenizer/src/ there is a flex lexer for each supported language, currently c and ada. You'll have to add fortranlexer.l and then modify tokenizer.c to use that tokenizer when necessary (depending on the file extension). That's about it. After that, cgdb should highlight your files. It's been a long time since I've looked at this, but I think the above instructions are pretty accurate. It shouldn't take more than a few hours to get it working. Let me know. Thanks, Bob Rossi |
From: Mike H. <mik...@ya...> - 2010-06-15 12:53:15
|
Cheers, that worked great. ----- Original Message ---- From: Bob Rossi <bo...@br...> To: cgd...@li... Sent: Tue, 15 June, 2010 12:33:28 Subject: Re: [Cgdb-users] Fortran Syntax highlighting not working? On Tue, Jun 15, 2010 at 10:44:30AM +0000, Mike Hudson wrote: > Hi, > > I have just recently started using cgdb for fortran after using it for a while for C. Cgdb seems to recognise that it is working with fortran. In fact it is C code that calls the main FORTRAN routine, and when I step into it, the cgdb output reads: > > Current language: auto > The current source language is "auto; currently fortran". > > But none of the code in the display is highlighted, not even the comments are differentiated. > I have looked at the syntax highlighting documentation, but it only seems to deal with modifying the colours of known types of code, rather than defining the actual scheme. > > [How] can I view/modify/fix the syntax highlighting scheme currently used by cgdb? I am running cgdb 0.6.5 on debian 2.6.32-3-amd64. > Any other insights into cgdb+fortran gratefully received! It's relatively easy to add a new syntax highlighter for cgdb. If you look in cgdb/tokenizer/include/tokenizer.h, that defines a very simple interface. It includes a token kind, a token language, and some functions that cgdb will call. In cgdb/tokenizer/src/ there is a flex lexer for each supported language, currently c and ada. You'll have to add fortranlexer.l and then modify tokenizer.c to use that tokenizer when necessary (depending on the file extension). That's about it. After that, cgdb should highlight your files. It's been a long time since I've looked at this, but I think the above instructions are pretty accurate. It shouldn't take more than a few hours to get it working. Let me know. Thanks, Bob Rossi ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Cgdb-users mailing list Cgd...@li... https://lists.sourceforge.net/lists/listinfo/cgdb-users |
From: Bob R. <bo...@br...> - 2010-06-15 12:56:51
|
On Tue, Jun 15, 2010 at 12:53:07PM +0000, Mike Hudson wrote: > Cheers, that worked great. If you send in the patch, we can apply it to CGDB for you. Thanks, Bob Rossi |
From: Bob R. <bo...@br...> - 2010-06-23 12:10:00
|
On Tue, Jun 15, 2010 at 08:56:27AM -0400, Bob Rossi wrote: > On Tue, Jun 15, 2010 at 12:53:07PM +0000, Mike Hudson wrote: > > Cheers, that worked great. > > If you send in the patch, we can apply it to CGDB for you. Any patch? Bob Rossi |
From: Mike H. <mik...@ya...> - 2010-06-23 12:47:18
|
Sorry I've had to leave this for a while. I haven't had time to get the highlighting correct, I just verified that I could make the changes. Will post a patch when I've got the highlighting correct. ----- Original Message ---- From: Bob Rossi <bo...@br...> To: cgd...@li... Sent: Wed, 23 June, 2010 13:09:48 Subject: Re: [Cgdb-users] Fortran Syntax highlighting not working? On Tue, Jun 15, 2010 at 08:56:27AM -0400, Bob Rossi wrote: > On Tue, Jun 15, 2010 at 12:53:07PM +0000, Mike Hudson wrote: > > Cheers, that worked great. > > If you send in the patch, we can apply it to CGDB for you. Any patch? Bob Rossi ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Cgdb-users mailing list Cgd...@li... https://lists.sourceforge.net/lists/listinfo/cgdb-users |