Re: Question on parsing of "font" property

>
>    font-name: term [ operator term ]*
>
> where "operator" is not allowed to be a COMMA.  But it can certainly be
> whitespace as in:
>
>    font: 10px Times New Roman;
>

Beg my pardon, Boris, but where did you get this *where "operator" is not
allowed to be a COMMA* ?

As far as I can see:

 operator
   : '/' S* | COMMA S* | /* empty */
   ;

exactly COMMA is.

Whitespace is a neutral delimeter here as in any other similar syntactic
constructions.

Moreover following your font-name declaration:
font-name: term [ operator term ]*

font name MUST be either single word (IDENT) or quoted value (STRING).

Otherwise it will not go through the parser which use given grammar.

Objections, your honor? :)

Andrew Fedoniouk.
http://terrainformatica.com






>
> Andrew Fedoniouk wrote:
> >>So?  What do font names have to do with nmtoken>
> >
> > Let's take a look here:
> >
> > declaration
> >   : property ':' S* expr prio?
> > expr
> >   : term [ operator term ]*
> > term
> >   : unary_operator?
> >     [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S*
|
> >       TIME S* | FREQ S* | function ]
> >   | STRING S* | IDENT S* | URI S* | hexcolor
> > operator
> >   : '/' S* | COMMA S* | /* empty */
> >   ;
>
> Yes, agreed.
>
> > following this we are getting rule for a non quouted font names:
> >
> > font-name: IDENT S* [, IDENT S* ]*
>
> You made this rule up, right?  It's not in the grammar that I can see....
As
> far as I can tell from the above, we are actually getting the following
rule for
> non-quoted font names:
>
>    font-name: term [ operator term ]*
>
> where "operator" is not allowed to be a COMMA.  But it can certainly be
> whitespace as in:
>
>    font: 10px Times New Roman;
>
> or it can be a '/', per that grammar and the fact that '/' is not excluded
in
> the property description.
>
> I do agree that per the grammar '@' would indeed need to be escaped.  But
a '/'
> would not.
>
> -Boris
>

Received on Wednesday, 19 May 2004 23:33:09 UTC