1.8.12. Some NOTE on SymbolXXX functions

[<<<] [>>>]

The functions named SymbolXXX like SymbolLABEL, or SymbolUF do NOT store the names of the symbols. They are named SymbolXXX because they are natural extensions of the symbol table system. In other compilers the functionality to retrieve the arguments of a symbol is part of the symbol table handling routines.

In script basic the symbol table handling routines were developed to be general purpose. Therefore all the arguments the symbol table functions bind toa symbol is a void * pointer. This pointer points to a struct that holds the arguments of the symbols, and the functions SymbolXXX allocate the storage for the arguments.

This way it is possible to allocate arguments for non-existing symbols, as it is done for labels. Script basic uses non-named labels to arrange the "jump" instructions for IF/ELSE/ENDIF constructs. (And for some other constructs as well.) The label and jump constructs look like:

IF expression Then

ELSE label1:

END IF label2:

The labels label1 and label2 do not have names in the system, not even autogenerated names. They are referenced via pointers and their value (the NodeId of the instruction) get into the SymbolLABEL structure and later int o the cNODE during build.

[<<<] [>>>]