Re: [Cgdb-users] Fortran Syntax highlighting not working?
Brought to you by:
bobbybrasko,
crouchingturbo
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 |