[metapost] Beginners question

Laurence.Finston at gmx.net Laurence.Finston at gmx.net
Tue Sep 12 21:55:56 CEST 2023


> I used Bison for 3DLDF, but imitated Knuth's rules of syntax as closely as possible, using the primary, secondary, etc., structure for the rules.
> When running the program with the --bison-trace option, with enables debugging, it can be fascinating to watch how the rules are matched.

I've attached a file with this debugging output (which is what I meant). It's a bit verbose, so I didn't include it in the text of this message.
This is the input:

transform t;
t := identity scaled (1, 2, 3);
point p;
p := (5, 6, 7);
point q;
q := p * t;
end

It would almost work as MP input.  `point' is the 3D correspondence to `pair' and `:=' must be used because I don't have the mathematical background to understand the sources of information on how it _might_ be possible to implement equations which may or may not contain unknowns, as in MF.

The output for even this brief snippet of code contains all kinds of tokens and non-terminal symbols (to use the jargon of parsers).  Numeric tokens,
declarators, tags, expressions, you name it.

It may be interesting to note that Knuth provides a considerable amount of information on this topic, as on others, in _The Texbook_ and _The METAFONTbook_, but he often doesn't use the terminology common today.  In fact, he touches on many important topics in mathematics and computer science, but one might not notice because of the jokes, lies and charming illustrations.

> Gesendet: Dienstag, 12. September 2023 um 20:18 Uhr
> Von: Laurence.Finston at gmx.net
> An: "Metapost List" <metapost at tug.org>
> Betreff: Aw: Re: [metapost] Beginners question
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: atemp.txt
URL: <https://tug.org/pipermail/metapost/attachments/20230912/dc06c2c5/attachment-0001.txt>


More information about the metapost mailing list.