This is a doxygen filter to convert Squirrel scripts into something that doxygen can convert into C++.
It has been tested on Windows 7 with python 2.7.
It was designed for Squirrel version 2.2 as used by OpenTTD for AI and Game scripts.
Set the following items in your doxygen config file.
- EXTENSION_MAPPING: Add: nut=C++
- FILE_PATTERNS: Add: *.nut
- FILTER_PATTERS: Add either:
- *.nut=doxygen_squirrel_filter.bat [or]
- *.nut=doxygen_squirrel_filter.py
For the first option you need to adapt the path to python in the batch file.
In case of the second option make sure that python is on your path and that python is set for files with extension .py and possibly you also need to set the path to the python script.
In both cases you may have to add a path to the batch or python file.
- Inline code in the file outside of any function can confuse doxygen too sometimes.
Example: AILib.List main.nut the code at the bottom. - Multi line string constants not supported: (starting with @" ).
- Doxygen can get confused by class names that have a "." in them.
There are a few settings inside doxygen_squirrel_filter.py that you can change to your personal preferences.
- keep_function = True or False
Determines if you want to keep the keyword function or not. - keep_constructor = True or False
Determines if you want to keep the keyword constructor or not. - check_end_of_class = True or False
Determines if you want to check if a ';' follows the closing '}' of a class definition. You can speed up filtering by turning this off if you always add a ";" yourself. - track_class_functions = True or False
Determines if you want to track all member functions of all classes and add them inside the class if necessary, since Squirrel allows class member functions to be declared outside the class itself.
Note that this will slow down parsing considerably but is necessary if not all member functions are inside the class definition. If this option is set to True then check_end_of_class will also be set to True.
Copyright Jacob Boerema 2015.
License: GPL version 2.