() Patrice Dumas <pertu...@gnu.org> () Tue, 14 Aug 2012 00:52:08 +0200
Another useful information that is kept in the tree that is done from the parsed Texinfo in perl is a reference to other elements of the tree. [...] Would this be doable in an sexpr? Yes. The usual (Lisp/Scheme) technique to represent "back pointers" (cycles) when serializing a graph is to give each vertex a unique name (a small integer, say) and then use a special syntax that instructs the ‘read’er to both name the target vertex, and reconstitute the edge between the source and target vertices. A better explanation is at: (info "(elisp) Circular Objects") That said, we want to be nice to programs that have only basic ‘read’ capabilities, and should plan to support references "manually". (That's what INDEX is for -- to support on-demand dereference, sidestepping the requirement that everything be held in memory.) So the full answer to your question is "yes, but doing so would be bad design (IMVHO, YMMV)". As for the information that may be wanted in a renderer, looking at what is available now, there is the index informations (index entries, merged indices), informations on floats (for @listoffloats), informations on labels (@node, @anchor, @float with label) especially for internal @*ref, a possibility to access the tree of some @-commands, like @copying, @documentdescription, @top, @settitle..., and some misc informations, like the succession of @direntry and @dircategory, the input file name. We mustn't forget the all-important ‘@paragraphindent’ [froth froth] !!! I have been waiting a long time for that to be runtime-tweakable... This points to another subtlety of texinfo: IIUC the lifetime of a variable or setting (or macro) is indefinite. That is, if you ‘@set’ a variable in 1.3.5.7 (a subsubsection in the first chapter), that value will hold for all subsequent nodes (even 2.1, i.e., higher level), until EOF or another ‘@set’ changes it. This means we need to record where such settings are done to know their "span of influence". -- Thien-Thi Nguyen ..................................... GPG key: 4C807502 . NB: ttn at glug dot org is not me . . (and has not been since 2007 or so) . . ACCEPT NO SUBSTITUTES . ........... please send technical questions to mailing lists ...........
pgptWGiByTcOX.pgp
Description: PGP signature