如何用Doxygen记录Visual Basic [英] How to document Visual Basic with Doxygen

查看:86
本文介绍了如何用Doxygen记录Visual Basic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows中为Visual Basic使用Doxygen过滤器。

I am trying to use some Doxygen filter for Visual Basic in Windows.

我从基于gawk的Vsevolod Kukol过滤器开始。
没有太多方向。
所以我开始使用他自己的VB代码 VB6Module.bas ,并通过他的 vbfilter.awk ,我发出:

I started with Vsevolod Kukol filter, based on gawk. There are not so many directions. So I started using his own commented VB code VB6Module.bas and, by means of his vbfilter.awk, I issued:

gawk -f vbfilter.awk VB6Module.bas  

这将在stdin上输出类似C的代码。因此,我将其重定向到以下文件:

This outputs a C-like code on stdin. Therefore I redirected it to a file with:

gawk -f vbfilter.awk VB6Module.bas>awkout.txt

我创建了这个Doxygen test.cfg 文件:

I created this Doxygen test.cfg file:

PROJECT_NAME      = "Test"
OUTPUT_DIRECTORY  = test
GENERATE_LATEX    = NO
GENERATE_MAN      = NO
GENERATE_RTF      = NO
CASE_SENSE_NAMES  = NO
INPUT             = awkout.txt
QUIET             = NO
JAVADOC_AUTOBRIEF = NO
SEARCHENGINE      = NO

出示我签发的文件:

doxygen test.cfg 

Doxygen抱怨说 VB6Module.bas名称是第二个参数\file语句中的不是输入文件。我从 awkout.txt 中删除​​了注释 @file VB6Module.bas 。警告停止了,但是在两种情况下,生成的文档只是一个带有项目名称的页面。

Doxygen complains as the "name 'VB6Module.bas' supplied as the second argument in the \file statement is not an input file." I removed the comment @file VB6Module.bas from awkout.txt. The warning stopped, but in both cases the documentation produced was just a single page with the project name.

我还尝试了Basti Grembowietz在Python中使用的替代过滤器 vbfilter.py 。再次没有文档,再次产生错误,并且没有任何有用的输出。

I tried also the alternative filter by Basti Grembowietz in Python vbfilter.py. Again without documentation, again producing errors and without any useful output.

推荐答案

经过反复试验,我解决了这个问题。

After trials and errors I solved the problem.

我无法转换 .bas 文件的格式,无法将其作为输入传递给Doxygen 。
无论如何,按照@doxygen用户的建议,我能够创建一个Doxygen配置文件,以便它可以正确解释 .bas 文件的注释。

I was unable to convert a .bas file in a format such that I can pass it to Doxygen as input. Anyway, following @doxygen user suggestions, I was able to create a Doxygen config file such that it can interpret the .bas file comments properly.

给出文件 VB6Module.bas (由Doxygen-VB-Filter的作者Vsevolod Kukol撰写),以适用于Visual Basic的Doxygen样式进行了评论,我编写了Doxygen配置文件 test.cfg ,如下所示:

Given the file VB6Module.bas (by the Doxygen-VB-Filter author, Vsevolod Kukol), commented with Doxygen style adapted for Visual Basic, I wrote the Doxygen config file, test.cfg, as follows:

PROJECT_NAME      = "Test"
OUTPUT_DIRECTORY  = test
GENERATE_LATEX    = NO
GENERATE_MAN      = NO
GENERATE_RTF      = NO
CASE_SENSE_NAMES  = NO
INPUT             = readme.md VB6Module.bas
QUIET             = YES
JAVADOC_AUTOBRIEF = NO
SEARCHENGINE      = NO
FILTER_PATTERNS   = "*.bas=vbfilter.bat"

其中:


  • readme.md 是任何Markdown文件,可以用作主要文档页面。

  • vbfilter.bat 包含:

  • readme.md is any Markdown file that can used as the main documentation page.
  • vbfilter.bat contains:

@echo off
gawk.exe -f vbfilter.awk%1%

@echo off gawk.exe -f vbfilter.awk "%1%"

vbfilter.awk 与要记录的输入文件位于同一文件夹中,显然 gawk 应该在路径中。

vbfilter.awk by the filter author is assumed to be in the same folder as the input files to be documented and obviously gawk should be in the path.

运行:

doxygen test.cfg 

除了两个明显无害的警告外,一切都很顺利:

everything is smooth, apart two apparently innocuous warnings:

gawk: vbfilter.awk:528: warning: escape sequence `\[' treated as plain `[' 
gawk: vbfilter.awk:528: warning: escape sequence `\]' treated as plain `]' 

Now test\html\index.html 包含由 .bas和Markdown文件提取的正确文档。

Now test\html\index.html contains the proper documentation as extracted by the ".bas" and the Markdown files.

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

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