The symbol table:

    The symbol table consists of an array of SymbolTableType elements. It
contains the name and the scope that identify a symbol. Each different symbol
has a unique combination of name and scope (the range under which a symbol
can be used; eg. global, local). The symbol table is used in the scanning
process to identify the tokens contained by an instruction. It is also used
in the last fase of the code generation stage to generate the assembly output
names.
CONST OperatorNm = 1     '\\ Classes of instruction and internal elements
CONST KeyWordNm = 2
CONST VarName = 3
CONST ConstNm = 4
CONST FunctionNm = 5
CONST SubName = 7
CONST VarTypeNm = 8
CONST LiteralNm = 9
CONST LabelNm = 10
CONST RegNm = 11
CONST UnknownNm = 12
CONST TempVarNm = 13
    Symbols belong to a specific class. They are either variable,
variable type, keyword, operator, label, function or constant. A declaration
of these leads the addition of this token to the symbol table.
    During the parsing stage more specific information about the meaning and
usage of symbols is assimilated.


TYPE SymbolTableType
    nm AS STRING * 40
    nmlen AS INTEGER
    used AS INTEGER
    scope AS INTEGER
    class AS INTEGER
    infoidx AS INTEGER
END TYPE

Compiler overview:

    In this compiler, instructions are translated into assembler, before pro-
ceeding with the next instruction. When all instructions from a source file
are translated into assembly language, the generated file containing the
assembly language is converted into a binary object file by an assembler.
Next, the linker combines the object file(s) into an executable file.
Thus: The compiler generates assembly source files. The assembler and the
linker subsequently translate respectively combine these to generate an execu-
table file.
    There are several stages in the compiling process:
* scanning       : Instructions are taken from the source file and separated
                   into their elements, the tokens.
* parsing        : The meaning of instructions, in the form of tokens, is
                   interpreted.
* code generation: According to this interpretation, the assembly code is
                   generated and put into a file

    
Scanning stage:

    In this stage, instructions are dissected into elements, called tokens.
    To achieve this an instruction is first taken from the source file.
This is done by the function GetInstructFromFile. This function reads an
instruction from a source file. It strips comments (rem and '), handles
multiple instructions on one line and handles the line continuation character
"_" . The instruction is stored in the global variable SrcLine.
    The sub Instruct.GetElements then separates this instruction in it's
tokens, identifies them using the symbol table, and stores them in the
InstrParts array, in order of appearance.
    A token is represented by it's class and by it's number in that
class (an index into the table containing the descriptor for that class).
Possible classes are: keyword, variable, variable type, operator, label,
function, constant and unknown.

Parsing stage:


