Glossary - common terms used in fbc development
arg, argument
objinfo
static
An expression passed to a parameter in a procedure call.
castA type cast changes the compile-time data type of an expression and either causes a conversion (e.g. float <-> int) or a reinterpretation of the expression value's bit representation (e.g. integer <-> uinteger).
comp, compound- Compound blocks in the language: Any code block that allows nested code such as IF blocks, SCOPE blocks, NAMESPACE blocks, etc. is called a compound.
- Compound symbols: UDTs, sometimes also namespaces, because both may contain nested (namespaced) symbols and they share some common code.
A conversion is an operation that translates between two different representations of the same value (e.g. float <-> int, or 32bit <-> 64bit).
cast and conv are often used interchangeably in the compiler sources. For example, the AST's CONV nodes represent type casts, no matter whether they perform conversions or not.
Some (but not all) casts require run-time conversions, for example:
ctor, constructorcast and conv are often used interchangeably in the compiler sources. For example, the AST's CONV nodes represent type casts, no matter whether they perform conversions or not.
Some (but not all) casts require run-time conversions, for example:
short <-> integer
single <-> integer
single <-> double
Simple casts between types of equal class and size do not require a run-time conversion, because the bit representation wouldn't change anyways. For example:single <-> integer
single <-> double
short <-> ushort
integer <-> uinteger
These are also called noconv casts.integer <-> uinteger
- UDT constructor
- module constructor
UDTs/"classes" in the fbc sources for holding global information shared amongst multiple procedures or modules.
desc, descriptor- Dynamic string descriptor
- Dynamic array descriptor
- UDT destructor
- module destructor
- The FreeBASIC compiler project as a whole, the Git repository, the project registered on Sourceforge
- The compiler program binary/executable (fbc or fbc.exe), as built from the compiler sources
- The compiler's main module/frontend/driver
FB compile-time information, also see objinfo.
fbgfxFB graphics, usually referring to the use of FB's built-in graphics keywords, implemented in gfxlib2
frontend stage 1Compilation of the .bas input files into the next intermediate format: .asm (-gen gas), .c (-gen gcc) or .ll (-gen llvm)
frontend stage 2Compilation of the .c (-gen gcc) or .ll (-gen llvm) intermediate files into .asm files. (doesn't apply to -gen gas because there the FB compiler generates .asm itself directly)
functionA procedure with result value; sometimes also used in place of procedure, as in C.
gfxlib2The FB graphics runtime library implementation from the fbc project.
hashtbA hash table, often used together with a symbol table to allow fast lookup of the symbols in that symbol table.
libfb, libfbmt, libfbgfx, libfbgfxmtNames of the libraries built from the rtlib/gfxlib2 sources. Libraries named lib*mt are the thread-safe versions of their lib* counterparts. They are built with the ENABLE_MT #define.
local- Sometimes: A variable allocated on stack
- Any symbol in a nested scope, not the global/toplevel namespace. Scoped static variables also have the FB_SYMBATTRIB_LOCAL attribute, even though they are not allocated on stack.
- A member-procedure with THIS parameter. Static member-procedures (those without the THIS parameter) do not have FB_SYMBATTRIB_METHOD.
- Sometimes: Any member-procedure, with or without THIS parameter
A cast that does not require a conversion.
normal buildobjinfo
See DevObjinfo
param, parameterProcedure parameters as declared in procedure DECLARE statements or bodies.
paramvarFor each parameter, the compiler will create a corresponding local variable in the procedure's scope, allowing the parameters to be accessed by user code.
proc, procedureAny sub or function, including constructors/destructors, operator overloads, property setters/getters.
standalone buildstatic
- static variable allocation: on the heap instead of the stack, but still scoped -- also see local.
- static member variables: are actually externs.
- static member procedures: member-procedures without a THIS parameter, also see method.
- "static array" is often used in place of "fixed-size array" (QB language)
TYPE or UNION, also known as struct/union in C.
subA procedure without result (with VOID result).
symtbA symbol table: owns a linked list of FBSYMBOL in a specific scope. This is where FBSYMBOLs live.
rtlibThe FB runtime library implementation from the fbc project
UDT, user-defined typeTYPEs/UNIONs/ENUMs, sometimes just TYPEs/UNIONs.
vregVirtual registers are used when emitting the AST. The AST creates a vreg for the operands and results of all operations that make up the input program. Each backend emits them differently:
- The ASM backend actually maps the vregs to real registers and also re-uses them as they become free again. The vregs then also let the x86 code emitter know which exact registers are used.
- The C backend sometimes emits vregs as temporary variables, sometimes simply inserts the expression whose result is represented by a vreg in place of that vreg's first use.
- The LLVM backend simply emits each vreg as a numbered intermediate value.
Since the C/LLVM backends don't re-use vregs, the vregs are almost in static-single-assignment form; although not quite because there still are self-operations etc. produced by the AST which don't take SSA form into account.