13. Internals
In this chapter I will try to explain in some more detail how
fsc2
works internally. I hope that this will help especially if
you're going try to write a new module for a device (or if you get upset
about things fsc2
does differently from the way you would like it
to).
As you will already have understood, fsc2
is basically an
interpreter for EDL
scripts. Traditional interpreters interpret
each line of input one after another, i.e. they analyze a line, and,
if the line is syntactically correct, execute it and then continue with
the next one. That's what fsc2
also does, but only for the parts
before the EXPERIMENT
section. In contrast, the interpretation of
the EXPERIMENT
section of an EDL
file consists of several
steps. In the first step the EXPERIMENT
section as a whole is
read in and only syntax checks are done. In the second step a complete
test run of EXPERIMENT
section of the script is done to avoid that
the experiment will have to be stopped due to obvious logical errors in
the EDL
script. The device modules are involved, i.e. they
already can do all kinds of checks on what can be expected to happen
during the real experiment and detect possible problems.
Only if all these tests succeeded the third step, the execution of the
EXPERIMENT
section of the EDL
script, is started, i.e.
the experiment is run. When an experiment is restarted (without
reloading the EDL
file) only this third step is repeated.
In the following I will try to explain what happens during these three
steps of the execution of an EDL
script in some more detail. Then
follows a real long section with a tour de force through the sources
of the program. This is hopefully going to be helpful for people that try
eliminate bugs or even extend fsc2
.
• First stage of interpretation | ||
• Second stage of interpretation | ||
• Third stage of interpretation | ||
• Reading the sources | ||
• Coding conventions |
This document was generated by Jens Thoms Toerring on September 6, 2017 using texi2html 1.82.