Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

Documenting scripting language in application

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Juliean   Members   


Posted 04 April 2014 - 01:21 AM



I've been wondering whether there is a tool like doxygen for documenting what classes, functions etc... are registered in a scripting language like AngelScript that I'm using? Doxygen is probably a bad example, since I don't require it to be generated anything like automated, I'm fully happy to write all the documentation externally, but it should require no/little manual formatting, and should have all the sugar like cross-referencing of classes, functions etc..., if you know what I mean. Is there such a thing?

Edited by Juliean, 04 April 2014 - 01:22 AM.

#2 ColinDuquesnoy   Members   


Posted 04 April 2014 - 03:05 AM

Maybe you could have a look at sphinx?


This is one of the documentation tool used for python but can be used for any other languages as long as you don't require automatic extraction. 


You can create cross references in your documentation, you can even add custom domains to add support for DSL and the likes. You write your docs using restructuredText which is quite nice and easy to use (no to very little manual formatting).

#3 AzureBlaze   Members   


Posted 06 April 2014 - 12:12 AM

I was searching for something similar, but my final solution write a documented header for Doxygen to parse. Doxygen is quite forgiving about grammar rules such as missing return type for functions so I think it should work with most scripts by writing the document similar to c++ style.


for example:

#ifdef LUA_TABLE
//! Provides generic functions for table manipulation.
class table{
	//! Given an array where all elements are strings or numbers, returns table[i]..sep..table[i+1] ... sep..table[j].
	static concat (table [, sep [, i [, j]]]);

	//! Inserts element value at position pos in table, shifting up other elements to open space, if necessary.
	static insert (table, [pos,] value);

	//! Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices.
	static maxn (table);

	//! Removes from table the element at position pos, shifting down other elements to close the space, if necessary.
	static remove (table [, pos]);

	//!Sorts table elements in a given order, in-place, from table[1] to table[n], where n is the length of the table.
	static sort (table [, comp]);


results in:




I also use the generated XML for autocomplete in my script editor


#4 Juliean   Members   


Posted 06 April 2014 - 05:30 AM

Thanks all for the suggestions,


I decided to just stick with doxygen and write a seperate headerfile for all the methods I'm going to register. Might even consider trying to parse those fake header files for actually registering stuff in angelscript, but one bit at a time. I still have one problem with angelscript though, seeing how the return value is part of the method definition there, and that it uses @ for "pointers" instead of "*": Doxygen has a problem parsing this @, but only for the return values.

// here the @ is parsed correctly:
void test(Class@ name);

// and here return value is parsed to "Class", without the @
Class@ test2(void);

Is there any way to fix this?

#5 Ectara   Members   


Posted 08 April 2014 - 11:50 PM

Is there any way to fix this?

That's a tough one, I'd imagine. If Javadoc compatibility is enabled, try disabling it? That's my first guess.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.