Re: Sizes of presentation objects, and MRL parser

Pedro Szekely ([email protected])
Mon, 05 Jun 1995 15:39:23 PDT

Kurt,

I was thinking of the simplest solution in general.

Double hmmm! I was also thinking on using the attribute type to figure out
what object is expected, and to figure out what attributes to parse. True,
the case of subclassess is not handled correctly. I think it is ok to assume
that positional syntax only works for the base class of the attribute.

> >How about a syntax where if you have NUMBER MAGNITUDE_UNITS, it creates a
> >magnitude. So if the parser sees a number followed by one of the standard
> >units, it parses it as a magnitude, independent of the rest of the context.
>
> Not sure I understand this. Do you mean to specialize the mtf parser syntax
> for one particular Object?

Yes, I was suggesting specializing the parser to understand Magnitudes better.
Essentially, if the parser sees a number followed by one of the declared unit
types, then it creates a magnitude object. That is it, no more smarts.

THe specialization for magnitudes could handle both literals and expressions,
so the extension for positional syntax would not be required.

In summary, the following would be legal syntax. It would be parsed by the
magnitude-aware parser, because "3 inches" gets parsed into a magnitude object.

hguide : MM_Guide {
position = 3 inches;
left_margin = 0.2 inches;
};

The following would also be legal

hguide : MM_Guide {
position = [guide_1 + 3 inches];
};

The same parser trick would parse the expression into the follwoing tree:

plus
/ \
/ \
guide Magnitude
/ \
/ \
3 inches
(plus guide_1 (magnitude 3 inches))

Pedro Szekely
USC/ISI, 4676 Admiralty Way, Marina del Rey, CA 90292
Phone: 310/822-1511, Fax: 310/823-6714
URL: http://www.isi.edu/isd/szekely.html