| fb-doc 0.2 documentation tool for FreeBasic

- Main Page
- Tutorial
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Extending fb-doc

Since the fb-doc Parser calls emitter functions via the emitter interface EmitterIF, it can get extended by new emitters providing additional features, ie to support further tools (= back-ends, ie like source navigator). This can either be done by adding a new emitter to the fb-doc source or by writing an external emitter modul, that can be loaded at run-time. The first variant may have the disadvantage that the extension may need refactoring when fb-doc gets updated. So it's recommended to prefer external emitters.

The src folder of the fb-doc archive contains a file Plugin.bas. In this file you find example source code for an external emitter modul and this further information:

This emitter generates a list of the function names called via the
emitter interface. So when you input some source to fb-doc and use
this emitter, the output is a list of the functions called by the
parser for this input.
Before you can use this emitter, you have to compile it first, using
the command
\code fbc -dylib Plugin.bas \endcode
The result is a binary called
- libdll_emitter.so (LINUX)
- libdll_emitter.dll (windows)
There's no way to compile or use an external emitter on DOS since
DOS doesn't support dynamic linked libraries.
To use this emitter in fb-doc set its name (without the suffix .bas)
just as an internal name (,so don't name your customized emitter
similar to an internal emitter name).
Ie. the context of this file can get piped to fb-doc by the command
\code ./fb-doc --geany Plugin < Plugin.bas \endcode
(LINUX example) and will generate the following output:
\verbatim
DLL_INIT
DLL_INCLUDE
DLL_INCLUDE
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_FUNCTION
DLL_EXIT
\endverbatim