Overview:

flex converts MATLAB files into a format that is enough like C that
Doxygen can create useful documentation from it.  

Doxygen comment blocks in MATLAB begin with a "%%" string. (in c or
java it would be "/**" ).  You must enable javadoc_autobrief in the
Doxygen configuration.

comment blocks that start with "%" will be converted into regular C
block comments that start with "/*".


The Conversion:

%% changed to /**
%  changed to *  if currently in a comment block
%  changed to /* if not currently in a comment block
if a line doesn't start with "%" and its currently in a comment block,
	a "*/" is inserted at the beginning of the line to end the current
	comment block.
if a function doesn't return a value, the return type is set to "void"
if a function returns a value, the return type is set to "ret"
if a function returns multiple values, the return type is set to "rets"
all function parameters are preceded by "type"

An example input file (doxytest.m) and output file (doxytest.c) are
included that show examples of MATLAB code before and after the
translation.

files included:

readme.txt	this file
mtoc.exe	windows executable (needs cygwin)
mtoc		linux executable
lex.yy.c	source generated by flex
mtoc.l		flex script
doxytest.m	input test file
doxytest.c	output test file


To Compile:

1) install flex
2) create source from flex script
   > flex mtoc.l
3) compile
   for windows with cygwin:
       >gcc -o mtoc.exe lex.yy.c -lfl
   for linux:
       >gcc -o mtoc lex.yy.cc -lfl

To Use:

mtoc.exe infile.m outfile.c

where:
 infile.m is the input matlab file
 outfile.c is the file written with the code from the input
	file converted to a c-ish syntax.


Send questions or comments to: Ian Martins (ianxm@jhu.edu)
