Robert Dodier <robert.dodier at gmail.com> writes:
> For the record, can you please summarize how the parse-info scheme
> works? I remember a lot of ideas going around, but I don't which of
> those found their way into the code.
Yep:
There is lisp code in lisp-utils/parse-info.lisp which is loaded into a
Maxima image and is then run. We do this for each lisp implementation
that is configured into the build.
The parse-info.lisp code understands enough of the .info file format to
create an offset file (doc/info/maxima-info-offsets-<lispname>.lisp)
which contains a list whose elements are of the form
(NAME FILENAME POSITION LENGTH)
Such a list means there is an entry (either index entry or node) called
NAME which is stored at FILENAME (relative to the offset file), offset
POSITION (this offset is suitable for FILE-POSITION) and of length
LENGTH. "Length" here means that to print out the entry we should jump
to POSITION and then start outputting lines. We should stop when
(>= (- (FILE-POSITION stream) POSITION) LENGTH).
All of that code is run at build-time, and there's some ancillary
machinery in lisp-utils/parse-info.sh to ensure that we run compiled
versions of the code if it exists etc.
At run-time, we try to load up the relevant offset file when someone
first uses "?" or "??". If we fail for some reason, they don't get
documentation, but Maxima will work otherwise. The logic for actually
choosing and outputting the entry is basically the same as what it was
with the perl-based script, but with some changes to reflect the
different data structures we now load up.
There's a bit more information about how the actual info file parsing
works in a big comment at the top of lisp-utils/parse-info.lisp.
Does this make sense? Have I missed anything obvious?
Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20130527/f2de7c82/attachment.pgp>