Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen for a multi-language API

My company develops a API for engineering programs. It is developed in C++ but we create wrappers to it for the following languages:

  • a proprietary language that resembles VB
  • MATLAB
  • and Python.

Currently the documentation is generated by a bunch of scripts and it is starting to get time consuming to keep it 100%. I was wondering if there is a way to get doxygen/sphinx or another program to generate the documentation for C/C++, VB and MATLAB in one go. The Python part is done by SWIG. Currently the output is something like:

  • NameOfFunction
  • VB:
  • Function NameOfFunction(ByVal a As Long , ByRef b() As Long, ByVal c As Long) As Long
  • MATLAB:
  • value = NameOfFunction(a,b(),c)
  • C/C++:
  • value *NameOfFunction(objtype1 *a, objecttype2 *b[], int c)
  • +Description
  • +Examples
like image 308
Mac Avatar asked Jul 11 '12 17:07

Mac


2 Answers

doxygen supports multiple languages,

to use this on multiple projects or folders and languages you just point doxygen to every folder you want checked in the config.

My favorite programming language is X. Can I still use doxygen?

No, not as such; doxygen needs to understand the structure of what it reads. If you don't mind spending some time on it, there are several options:

Is language X supported?

If the grammar of X is close to C or C++, then it is probably not too hard to tweak src/scanner.l a bit so the language is supported. This is done for all other languages directly supported by doxygen (i.e. Java, IDL, C#, PHP). If the grammar of X is somewhat different than you can write an input filter that translates X into something similar enough to C/C++ for doxygen to understand (this approach is taken for VB, Object Pascal, and Javascript, see http://www.doxygen.nl/download.html#helpers). If the grammar is completely different one could write a parser for X and write a backend that produces a similar syntax tree as is done by src/scanner.l (and also by src/tagreader.cpp while reading tag files).

however since your using a VB like proprietary , it might pick this language up if you simply just change the file extensions to that of .vb

here is how to use it with matlab

python and c++ are already supported

have a look at the FAQ page

like image 58
pyCthon Avatar answered Oct 22 '22 18:10

pyCthon


I was wondering if there is a way to get doxygen/sphinx or another program to generate the documentation for c/c++, VB and matlab on one go.

The Zeus editor has a doxygen feature that allows you to create doxygen documentation for all items in the Zeus workspace.

like image 26
jussij Avatar answered Oct 22 '22 17:10

jussij