Example code for an empty external emitter. More...
#include "../fbdoc_options.bi"
Go to the source code of this file.
Functions | |
SUB_CDECL | empty_declare (BYVAL_AS_Parser_PTR P) |
Emitter called when the Parser is at a variable declaration. More... | |
SUB_CDECL | empty_function (BYVAL_AS_Parser_PTR P) |
Emitter called when the Parser is on top of a function body. More... | |
SUB_CDECL | empty_enum (BYVAL_AS_Parser_PTR P) |
Emitter called when the Parser is at the start of a ENUM block. More... | |
SUB_CDECL | empty_union (BYVAL_AS_Parser_PTR P) |
Emitter called when the Parser is at the start of a UNION block. More... | |
SUB_CDECL | empty_class (BYVAL_AS_Parser_PTR P) |
Emitter called when the Parser is at the start of a TYPE block. More... | |
SUB_CDECL | empty_define (BYVAL_AS_Parser_PTR P) |
Emitter called when the Parser is at an #DEFINE line or at the start of a #MACRO More... | |
SUB_CDECL | empty_include (BYVAL_AS_Parser_PTR P) |
Emitter called when the Parser is at an #INCLUDE line. More... | |
SUB_CDECL | empty_init (BYVAL_AS_Parser_PTR P) |
Emitter called before the input gets parsed. More... | |
SUB_CDECL | empty_error (BYVAL_AS_Parser_PTR P) |
Emitter called for an error. More... | |
SUB_CDECL | empty_empty (BYVAL_AS_Parser_PTR P) |
Emitter called for an empty block in mode –geany-mode (-g). More... | |
SUB_CDECL | empty_exit (BYVAL_AS_Parser_PTR P) |
Emitter called after the input got parsed. More... | |
SUB_CDECL | empty_CTOR (BYVAL_AS_Options_PTR O) |
Emitter called before the parser gets created and the input gets parsed. More... | |
SUB_CDECL | empty_DTOR (BYVAL_AS_Options_PTR O) |
Emitter called after the input got parsed and the parser got deleted. More... | |
SUB_CDECL | EmitterInit (BYVAL_AS_EmitterIF_PTR Emi, BYREF_AS_STRING Par) |
Initialize the EmitterIF and evaluate parameters. More... | |
Example code for an empty external emitter.
This file contains example source code for an external emitter. It isn't used in the fbdoc source tree. See External Emitters for details.
This emitter generates a list of the function names called via the emitter interface. So when you input some FB source to fbdoc and use this emitter, the output is a list of the fbdoc functions called by the parser for this input.
Before you can use this emitter, you have to compile it first, using the command
The result is a binary called
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 fbdoc set its name (without the suffix .bas) as parameter to option -e
. Ie. the emitter output for the context of this file can get written to a text file by
(LINUX example) and this will generate the following output in file test.txt
:
EMPTY_CTOR EMPTY_INIT EMPTY_INCLUDE: 77 "../bas/fbdoc_parser.bi" EMPTY_FUNCTION: 89 empty_declare EMPTY_FUNCTION: 104 empty_function EMPTY_FUNCTION: 116 empty_enum EMPTY_FUNCTION: 128 empty_union EMPTY_FUNCTION: 140 empty_class EMPTY_FUNCTION: 152 empty_define EMPTY_FUNCTION: 168 empty_include EMPTY_FUNCTION: 180 empty_init EMPTY_FUNCTION: 192 empty_error EMPTY_FUNCTION: 204 empty_empty EMPTY_FUNCTION: 216 empty_exit EMPTY_FUNCTION: 228 empty_CTOR EMPTY_FUNCTION: 240 empty_DTOR EMPTY_FUNCTION: 287 EmitterInit EMPTY_EXIT EMPTY_DTOR
EMPTY_CTOR
) is called once at the start after loading the plugin.EMPTY_INIT
function is called at the start of each file (#INCLUDE
).EMPTY_FUNCTION
calls here (, since the source contains only SUB
s and FUNCTION
s).EMPTY_EXIT
function is called at the end of each file (#INCLUDE
).EMPTY_DTOR
) is called once after finishing all input.Test the plugin with other input files, check also option -t
to follow a source tree.
Definition in file empty.bas.
SUB_CDECL empty_declare | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_function | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_enum | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_union | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_class | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_define | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_include | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_init | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_error | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_empty | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter called for an empty block in mode –geany-mode (-g).
P | The parser calling this emitter |
FIXME
Definition at line 201 of file empty.bas.
SUB_CDECL empty_exit | ( | BYVAL_AS_Parser_PTR | P | ) |
SUB_CDECL empty_CTOR | ( | BYVAL_AS_Options_PTR | O | ) |
SUB_CDECL empty_DTOR | ( | BYVAL_AS_Options_PTR | O | ) |
SUB_CDECL EmitterInit | ( | BYVAL_AS_EmitterIF_PTR | Emi, |
BYREF_AS_STRING | Par | ||
) |
Initialize the EmitterIF and evaluate parameters.
Emi | The newly created EmitterIF to fill with our callbacks |
Par | Additional command line parameters, not parsed by fbdoc |
When the user requires to load this plugin by option –emitter (-e), this SUB gets called to initialize the EmitterIF. Here, all default pointers (= NULL) get replaced by custom functions. Those functions just report all the fbdoc function calls, in order to make the parsing process transparent.
The second parameter Par
is a list of all command line parameters which are unknown to fbdoc. Those options get collected in a string, separated by tabulators (`!"\n"), and starting by a tabulator. This SUB extracts and evaluates its parameters from the string. When the string isn't empty at the end of this SUB, the calling fbdoc program stops execution by an unknown options
error.
Definition at line 261 of file empty.bas.