fbdoc  1.0.1
FreeBASIC documentation tool
fbdoc_emit_csource.bas File Reference

Emitter to generate the pseudo C intermediate format. More...

#include "fbdoc_options.bi"
Include dependency graph for fbdoc_emit_csource.bas:
This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

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.

Since
0.4.0

Definition in file fbdoc_emit_csource.bas.

Function Documentation

◆ c_CTOR()

SUB_CDECL c_CTOR ( BYVAL_AS_Options_PTR  O)

CTOR to be called when starting in Options::FileModi.

Parameters
Othe 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 fbdoc.lfn, if any.

Definition at line 31 of file fbdoc_emit_csource.bas.

Here is the caller graph for this function:

◆ c_Init()

SUB_CDECL c_Init ( BYVAL_AS_Parser_PTR  P)

Emitter to be called before parsing.

Parameters
Pthe 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 55 of file fbdoc_emit_csource.bas.

Here is the caller graph for this function:

◆ c_exit()

SUB_CDECL c_exit ( BYVAL_AS_Parser_PTR  P)

Emitter to be called after parsing.

Parameters
Pthe 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 67 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_include()

SUB_CDECL c_include ( BYVAL_AS_Parser_PTR  P)

Emitter to generate an #INCLUDE translation.

Parameters
Pthe 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 82 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_defi_()

SUB_CDECL c_defi_ ( BYVAL_AS_Parser_PTR  P)

Emitter to generate a macro translation.

Parameters
Pthe 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 106 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_func_()

SUB_CDECL c_func_ ( BYVAL_AS_Parser_PTR  P)

Emitter to generate a function translation.

Parameters
Pthe 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 139 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_decl_()

SUB_CDECL c_decl_ ( BYVAL_AS_Parser_PTR  P)

Emitter to generate a DECLARE translation.

Parameters
Pthe 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. Documentation 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 234 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ c_Block()

SUB_CDECL c_Block ( BYVAL_AS_Parser_PTR  P)

Emitter to generate a block translation (ENUM, TYPE, UNION)

Parameters
Pthe 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 325 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cEntryBlockENUM()

SUB_CDECL cEntryBlockENUM ( BYVAL_AS_Parser_PTR  P)

Handler for an enumerator entry (inside ENUM block)

Parameters
Pthe 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 274 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cEntryBlockTypeUnion()

SUB_CDECL cEntryBlockTypeUnion ( BYVAL_AS_Parser_PTR  P)

Handler for a context line (TYPE / UNION block)

Parameters
Pthe 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 294 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_csource()

SUB init_csource ( byval_as_EmitterIF_PTR  Emi)

Initialize the C_Source EmitterIF.

Parameters
EmiThe EmitterIF to initialize

FIXME

Since
0.4.0

Definition at line 377 of file fbdoc_emit_csource.bas.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ LOFN

STRING LOFN

The list of function names (for caller / callee graphs)

Definition at line 21 of file fbdoc_emit_csource.bas.