Reed-Kellogg progress

I got half-way through a recursive algorithm for generating Reed-Kellogg diagrams from (appropriately matched) tree definitions, and realized that I still don't really understand the R-K diagrams, and thus don't have much confidence that I won't learn something down the road that forces a major revision of the algorithm. So I decided to take a smaller step first, implementing a "little language" that makes it fairly easy to draw arbitrary diagrams of a vaguely R-K sort.

So far the little language has five primitives (excluding comments, which are lines starting with #):

horizonal text on a solid line

oblique text on a solid line (slanted from upper left to lower right)

vertical text on a dashed line (from bottom to top)

vertical text on a dashed line (from top to bottom)

textless line (in an arbitrary position and direction)

Obviously this could be made more elegant by combining the first four cases into a single primitive that generates text on an arbitrary line of arbitrary style in an arbitrary direction, but it was more convenient for various reasons to keep the different cases separate. In fact, it would be even more convenient to multiply the cases further, so that (e.g.) the (textless) lines for subj/predicate, verb/object, and verb/complement divisions are each treated specially, the subdiagrams for indirect objects and prepositional phrases can be generated by a single command line, and so on. My current plan is to make both kinds of changes -- i.e. to purify the graphical language down to two primitives (text on a line and line without text), and to create a second, more grammatical language that knows about things like "indirect object", "prepositional phrase", "conjunction", "clause", etc.

The program is written in perl, and all coordinates are interpreted via "eval", so that prior hashed endpoints are available, as are various global parameters like $charwidth (the width of a character) and $objabove (the standard height above the baseline of the object separator) and $iobjinc (the x and y increment of the oblique line used to connect an indirect object).