[Gambas-user] Help files for your gambas program - How do you do it

Benoit Minisini gambas at ...1...
Sun Jan 18 18:28:35 CET 2009


On dimanche 18 janvier 2009, richard terry wrote:
> Wondered about any pointers for generating (searchable) help files for your
> gambas program.
>
> Regards
>
> richard
>

Usually, languages use special comments in the source code that is parsed for 
generating the doc. I know doxygen, but I found it a bit hard to use, and 
generating not very pretty HTML files. There are for sure other way of doing 
that, but it seems they are always based on special comments.

We could imagine creating a standard for Gambas to do the same thing:

'' This is a double quote comment
'' It is the documentation for the next declared function
'' @param FirstString The first argument
'' @param SecondString the second argument
'' @returns The two strings concatenated

SUB Concatenate(FirstString AS String, SecondString AS String) AS String
...
END SUB

Then it is just a matter of creating a source code parser (in Gambas) that 
automatically generate HTML, and integrating it in the IDE. Like javadoc for 
java.

Parsing double quote comments is not very difficult in Gambas, they are always 
at the beginning of the line. Then finding the next declaration (there are 
methods, constants, events, properties and variables) is done by using the 
Highlight class located in the gb.eval component. The Highlight.Analyze 
method parses one Gambas line of code and returns all tokens by type.

Any volunteer? :-)

Regards,

-- 
Benoit Minisini




More information about the User mailing list