Code covered by the BSD License  

Highlights from
FORTRAN_Mex_Highlighter

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 195.39 KB File ID: #24332
image thumbnail

FORTRAN_Mex_Highlighter

by Thomas Clark

 

02 Jun 2009 (Updated 25 Jun 2009)

Improvement of syntax highlighting for FORTRAN MEX files (using an external editor like GEDIT)

| Watch this File

File Information
Description

I always use an external text editor to write MEX files; because MATLAB's internal editor doesn't give you syntax highlighting on FORTRAN code.

Here, I've improved the editor I use (GEDIT) to highlight (in addition to the usual fortran syntax) all mx* and mex* functions which can be called from a fortran MEX file.

So, for example, when I make a call to 'mxGetPr' from my fortran code, this is highlighted in Orange. It gives me a better sense of whereabouts in the code I am - which can be difficult if, like me, you're a little unfamiliar with the way mex files work.

I also added 'mwPointer', 'mwSize', and 'mwIndex' to the 'Types' list in fortran, so they're highlighted in green, the same as standard fortran declarations (REAL*4, etc).

I'm not an expert, but will try to help with any bugs - and will be glad to add in any improvements.

Hopefully, this won't be used straight-out of the box, (it won't work for all editors) but will enthuse you all to go out and customise your editors for yourselves :)

** Disclaimer ** These are specific instructions for GEDIT and similar editors - it won't work for things like MS Visual Studio etc etc, but might inspire and teach you how to customise other editors. Good luck!

MATLAB release MATLAB 7.6 (R2008a)
Other requirements The GEDIT text editor (or variant). Works on both Linux and Windows installations of GEDIT.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
25 Jun 2009

25 June 2009 - Checked support for windows based gedit installations - works flawlessly.

Tag Activity for this File
Tag Applied By Date/Time
gedit Thomas Clark 02 Jun 2009 15:20:23
fortran Thomas Clark 02 Jun 2009 15:20:24
mex Thomas Clark 02 Jun 2009 15:20:24
syntax Thomas Clark 02 Jun 2009 15:20:24
editor Thomas Clark 02 Jun 2009 15:20:24
highlighting Thomas Clark 02 Jun 2009 15:20:24
highlight Thomas Clark 25 Jun 2009 04:33:02
highlighter Thomas Clark 25 Jun 2009 04:33:02

Contact us at files@mathworks.com