This
validates the
fundamental
idea.
The next
step is to
write a simple
weaver
program. The
clever path
would be
to embed a
declarative
form of the
parser syntax
(BNF?)
as
comments in
selatex.sty.
That way the
latex
semantics and
the
weaver
syntax are
kept in sync.
Weaver would
read the BNF
comments from
selatex.sty
and
the formula
with semantic
markup as
input and
parse the
semantic
markup into
inputforms.
(Wish I
thought of
this homework
problem
when I taught
the compiler
course :-) ).
Note
that,
depending on
the BNF,
weaver could
be used to
generate
output for
Maxima's
tree-based
representation.
An
alternative
next step is
to look at a
CRC book,
re-create the
syntactic
latex and then
create the
selatex.sty
entries
necessary
to
generate
weaver input.
Infinitesimal
progress, but
progress
non-the-less.
Tim