Emitter to generate the pseudo C intermediate format. More...
Go to the source code of this file.
Functions | |
SUB_CDECL | c_CTOR (BYVAL_AS_Options_PTR O) |
CTOR to be called when starting in Options::FileModi. More... | |
SUB_CDECL | c_Init (BYVAL_AS_Parser_PTR P) |
Emitter to be called before parsing. More... | |
SUB_CDECL | c_exit (BYVAL_AS_Parser_PTR P) |
Emitter to be called after parsing. More... | |
SUB_CDECL | c_include (BYVAL_AS_Parser_PTR P) |
Emitter to generate an #INCLUDE translation. More... | |
SUB_CDECL | c_defi_ (BYVAL_AS_Parser_PTR P) |
Emitter to generate a macro translation. More... | |
SUB_CDECL | c_func_ (BYVAL_AS_Parser_PTR P) |
Emitter to generate a function translation. More... | |
SUB_CDECL | c_decl_ (BYVAL_AS_Parser_PTR P) |
Emitter to generate a DECLARE translation. More... | |
SUB_CDECL | c_Block (BYVAL_AS_Parser_PTR P) |
Emitter to generate a block translation (ENUM, TYPE, UNION) More... | |
SUB_CDECL | cEntryBlockENUM (BYVAL_AS_Parser_PTR P) |
Handler for an enumerator entry (inside ENUM block) More... | |
SUB_CDECL | cEntryBlockTypeUnion (BYVAL_AS_Parser_PTR P) |
Handler for a context line (TYPE / UNION block) More... | |
SUB | init_csource (byval_as_EmitterIF_PTR Emi) |
Initialize the C_Source EmitterIF. More... | |
Variables | |
STRING | LOFN |
The list of function names (for caller / callee graphs) More... | |
Emitter to generate the pseudo C intermediate format.
This file contains the emitter C_Source, which is the default emitter in modes --file-mode (-f) and none (default). It's designed to generate the pseudo C intermediate format for the documentation back-ends (ie. for the Doxygen filter feature).
The emitter transforms FB source to C like constructs and copies the documentational comments unchaned. Everything get placed in the same line as in the FB source, in order to get correct line references from Doxygen.
Definition in file fbdoc_emit_csource.bas.
SUB_CDECL c_CTOR | ( | BYVAL_AS_Options_PTR | O | ) |
CTOR to be called when starting in Options::FileModi.
O | the parser to be used with this emitter |
This CTOR gets called when starting in a mode for file input (so not for mode --geany-mode (-g)). It loads the file fb-doc.lfn, if any.
Definition at line 32 of file fbdoc_emit_csource.bas.
SUB_CDECL c_Init | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter to be called before parsing.
P | the parser calling this emitter |
This emitter gets called before the parser starts its parsing process. It initializes the FB source code emission.
Definition at line 50 of file fbdoc_emit_csource.bas.
SUB_CDECL c_exit | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter to be called after parsing.
P | the parser calling this emitter |
This emitter gets called after the parser ends its parsing process. It sends the rest of the FB source code to the output stream.
Definition at line 62 of file fbdoc_emit_csource.bas.
SUB_CDECL c_include | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter to generate an #INCLUDE
translation.
P | the parser calling this emitter |
This emitter gets called when the parser finds an #INCLUDE
statement. It creates a C translation and sends it to the output stream. When option --tree (-t) is given it checks if the file has been done already. If not, it creates a new Parser and starts its scanning process.
Definition at line 77 of file fbdoc_emit_csource.bas.
SUB_CDECL c_defi_ | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter to generate a macro translation.
P | the parser calling this emitter |
This emitter gets called when the parser finds a macro (#DEFINE
, #MACRO
). It generates a C translation of the macro and sends it to the output stream.
Definition at line 101 of file fbdoc_emit_csource.bas.
SUB_CDECL c_func_ | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter to generate a function translation.
P | the parser calling this emitter |
This emitter gets called when the parser finds a function (SUB / FUNCTION / PROPERTY / CONSTRUCTOR / DESTRUCTOR). It translates a function and its parameter list to C-like code and sends it to the output stream. The function body is either empty or contains pseudo calls.
Definition at line 134 of file fbdoc_emit_csource.bas.
SUB_CDECL c_decl_ | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter to generate a DECLARE
translation.
P | the parser calling this emitter |
This emitter gets called when the parser is in a declaration (VAR / DIM / CONST / COMMON / EXTERN / STATIC). It generates a C translation for each variable name and sends it (them) to the output stream. Documantation comments get emitted at the appropriate place. Each declaration get a single line, even if the original source code is a comma-separated list. (This may destroy line synchonisation, so it's better to place each declaration in a single line.)
Definition at line 229 of file fbdoc_emit_csource.bas.
SUB_CDECL c_Block | ( | BYVAL_AS_Parser_PTR | P | ) |
Emitter to generate a block translation (ENUM, TYPE, UNION)
P | the parser calling this emitter |
This emitter gets called when the parser finds a block declaration like TYPE, UNION or ENUM. It generates a C translation of the block and sends it to the output stream.
Nested blocks get parsed recursivly.
Definition at line 321 of file fbdoc_emit_csource.bas.
SUB_CDECL cEntryBlockENUM | ( | BYVAL_AS_Parser_PTR | P | ) |
Handler for an enumerator entry (inside ENUM block)
P | the parser calling this handler |
Generate an enumerator in an enum block. Name, initializers and documentation comments are emitted. Logical operators like SHL or AND are not handled jet.
Definition at line 270 of file fbdoc_emit_csource.bas.
SUB_CDECL cEntryBlockTypeUnion | ( | BYVAL_AS_Parser_PTR | P | ) |
Handler for a context line (TYPE / UNION block)
P | the parser calling this handler |
Generate a line in an struct or union block. Type, name, initializers and documentation comments are emitted. Logical operators like SHL or AND are not handled jet.
Definition at line 290 of file fbdoc_emit_csource.bas.
SUB init_csource | ( | byval_as_EmitterIF_PTR | Emi | ) |
Initialize the C_Source
EmitterIF.
Emi | The EmitterIF to initialize |
FIXME
Definition at line 365 of file fbdoc_emit_csource.bas.
STRING LOFN |
The list of function names (for caller / callee graphs)
Definition at line 22 of file fbdoc_emit_csource.bas.