|mathematical expressions _Maverick_@web.de (Seidl Markus) (2003-05-06)|
|Re: mathematical expressions email@example.com (Rajesh N Thipse) (2003-05-12)|
|Re: mathematical expressions bobduff@shell01.TheWorld.com (Robert A Duff) (2003-05-13)|
|Re: mathematical expressions firstname.lastname@example.org (2003-05-13)|
|Re: mathematical expressions email@example.com (2003-05-15)|
|Re: mathematical expressions firstname.lastname@example.org (Guillermo Phillips) (2003-05-15)|
|Date:||13 May 2003 04:21:38 -0400|
|Organization:||AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com|
|Posted-Date:||13 May 2003 04:21:38 EDT|
"Seidl Markus" <_Maverick_@web.de> schreibt:
>How can i draw the squareroot, when i have the following expression:
>sqrt(sqrt(sqrt(5))) ? I think im stuck there.I think i cannot draw
>the first square because i dont know how big and long i have to made
>it, and i cannot draw the last term, because i don't know where i have
>to draw them ( distance between the left edge of the image) ....
Separate the determination of the size of an item from the
determination of its position.
During parsing every reduction should result in an image of a fixed
size, which then can be incorporated into the image for the next
reduction step. In a top-down parser the partial images would be
returned to the calling procedure, until the final image can be
positioned on the output device. Every procedure can arrange, modify
or replace the partial images as required, e.g. when the "5" and the
"2" in "5^2" has to be transformed into "5²".
You also may encounter images which exceed the width of the output
device. Then some "wrapping" is required, like when a long text must
be broken into multiple lines. Breaking formulas into multiple lines
can become complicated, e.g. for a fraction with a long dividend or,
even worse, with a long divisor.
I'd separate the task into an parser, which creates an appropriate
parse tree from the input, and an post processor, which does the
layout of that tree.
Return to the
Search the comp.compilers archives again.