使用Doxygen记录Visual Basic [英] Documenting Visual Basic with Doxygen

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

问题描述

我正在Windows中使用一些Doxygen过滤器进行Visual Basic。

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

我从Vawvo Kukol过滤器开始,基于gawk。
没有太多的方向。
所以我开始使用自己评论的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.

你能给出一些建议吗?

推荐答案

我解决了这个问题。

我无法以一种格式转换 .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筛选器作者,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 `]' 

现在 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天全站免登陆