Doxygen用于多语言API [英] Doxygen for a multi-language API

查看:227
本文介绍了Doxygen用于多语言API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司开发了用于工程程序的API.它是用C ++开发的,但是我们为以下语言创建了包装器:

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

  • 类似于VB的专有语言
  • MATLAB
  • 和Python.

当前,文档是由一堆脚本生成的,要使其保持100%,它开始变得很耗时.我想知道是否有办法一次性获得doxygen/sphinx或另一个程序来生成C/C ++,VB和MATLAB的文档. Python部分由SWIG完成.当前输出类似于:

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:
  • 函数NameOfFunction(ByVal a长,ByRef b()长,ByVal c长)
  • MATLAB:
  • value = NameOfFunction(a,b(),c)
  • C/C ++:
  • 值* NameOfFunction(objtype1 * a,objecttype2 * b [],int c)
  • +说明
  • +示例

推荐答案

doxygen支持多种语言,

doxygen supports multiple languages,

要在多个项目或文件夹和语言上使用此功能,只需将doxygen指向要在配置中检查的每个文件夹即可.

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

我最喜欢的编程语言是X.我还能使用doxygen吗?

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

不,不是这样; 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:

是否支持X语言?

如果X的语法接近C或C ++,则可能不太合适 很难微调src/scanner.l,因此支持该语言.这 由doxygen直接支持的所有其他语言完成(即 Java,IDL,C#,PHP).如果X的语法与 您可以编写将X转换为类似内容的输入过滤器 足以让C/C ++理解氧气(此方法用于 VB,对象Pascal和Javascript,请参见 http://www.doxygen.nl/download.html#helpers ).如果 语法是完全不同的,可以为X和 编写一个后端,该后端产生类似于以下内容的语法树: src/scanner.l(在读取标记文件时也通过src/tagreader.cpp).

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).

但是,由于您使用的是专有的VB,因此只要将文件扩展名更改为.vb,它就可以选择这种语言.

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

以下是如何与 matlab

已经支持python和c ++

python and c++ are already supported

看看F AQ 页面

这篇关于Doxygen用于多语言API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆