Example: Translation scheme for EQN
S B |
B.pts = 10
|
|
S.ht = B.ht
|
B B1 B2 |
B1 .pts = B.pts
|
|
B 2 .pts = B.pts
|
|
B.ht = max(B 1 .ht,B2 .ht)
|
B B1 sub B 2 |
B1 .pts = B.pts;
|
|
B 2 .pts = shrink(B.pts)
|
|
B.ht = disp(B1 .ht,B2 .ht)
|
B text |
B.ht = text.h * B.pts
|
We now look at another example. This is the grammar for finding out how do I compose text. EQN was equation setting system which was used as an early type setting system for UNIX. It was earlier used as an latex equivalent for equations. We say that start symbol is a block: S - >B We can also have a subscript and superscript. Here, we look at subscript. A
Block is composed of several blocks: B -> B1B2 and B2 is a subscript of B1. We have to determine what is the point size (inherited) and height Size (synthesized). We have the relevant function for height and point size given along side.
|