11<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
22<html lang="en">
3- <!-- $Id: grammar.src,v 1.14 1997-10-31 01: 14:50 clilley Exp $ -->
3+ <!-- $Id: grammar.src,v 1.15 1997-11-03 14:51:38 bbos Exp $ -->
44<HEAD>
55<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
66<TITLE>Appendix D: The grammar of CSS2</TITLE>
139139term
140140 : unary_operator?
141141 [ NUMBER | STRING | PERCENTAGE | LENGTH | EMS | EXS
142- | IDENT | hexcolor | URL | RGB ]
142+ | IDENT | hexcolor | URL | RGB | UNICODERANGE ]
143143 ;
144144 /* There is a constraint on the color that it must
145145 ** have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
@@ -221,6 +221,8 @@ url\({w}{string}{w}\) |
221221url\({w}([^ \n\'\")]|\\\ |\\\'|\\\"|\\\))+{w}\) {BEGIN(0); return URL;}
222222rgb\({w}{num}%?{w}\,{w}{num}%?{w}\,{w}{num}%?{w}\) {BEGIN(0); return RGB;}
223223
224+ U\+[0-9a-f?]{1,6}(-{h}{1,6})? {BEGIN(0); return UNICODERANGE;}
225+
224226[-/+{};,#:] {BEGIN(0); return *yytext;}
225227[ \t]+ {BEGIN(0); /* ignore whitespace */}
226228\n {BEGIN(0); /* ignore whitespace */}
@@ -229,50 +231,7 @@ rgb\({w}{num}%?{w}\,{w}{num}%?{w}\,{w}{num}%?{w}\) {BEGIN(0); return RGB;}
229231. {fprintf(stderr, "%d: Illegal character (%d)\n",
230232 lineno, *yytext);}
231233</PRE>
232- <!--
233- macros (\nnn is octal):
234-
235- nonascii [\241-\17777777777]
236- h [0-9a-fA-F]
237- unicode \\{h}{1,8}
238- escaped {unicode}|\\[ -~]|\\{nonascii}
239- nmstrt [a-z]|{nonascii}|{escaped}
240- nmchar [-a-z0-9]|{latin1}|{escape}
241- ident {nmstrt}{nmchar}*
242- name {nmchar}+
243- stringchar {escape}|{nonascii}|[ !#$%&(-~]
244- string \"({stringchar}|\')*\"|\'({stringchar}|\")*\'
245-
246-
247- List of tokens (longest match wins):
248234
249- ident {ident}
250- percentage {num}"%"
251- dimension {num}{ident}
252- pseudo-something-after-ident ":"{ident} after {ident}, {pseudo*}, {hash*}, {class*}
253- pseudo-something ":"{ident}
254- class "."{name}
255- at-keyword "@"{ident}
256- string {string}
257- hash "#"{name}
258- hash-after-ident "#"{name} after {ident}, {pseudo*}, {hash*}, {class*}
259- bang-keyword "!"{w}{ident}
260- number {num}
261- url "url("{w}{string}{w}")"|"url("{w}([^ \n\'\")]|\\\ |\\\'|\\\"|\\\))+{w}")"
262- functor {ident}"("
263- CDO \<\!\-\-
264- CDC \-\-\>
265- unicode-range "U+"[0-9a-fA-F?]{1,8}("-"{h}{1,8})?
266-
267-
268- and ignored:
269-
270- comment "/*"[.\n]*"*/"
271-
272-
273- if not matched above, characters stand for themselves
274-
275- -->
276235</BODY>
277236</HTML>
278237<!-- Keep this comment at the end of the file
0 commit comments