|
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
2 | 2 | <html lang="en"> |
3 | | -<!-- $Id: grammar.src,v 2.59 2009-05-15 17:31:38 bbos Exp $ --> |
| 3 | +<!-- $Id: grammar.src,v 2.60 2009-08-06 19:22:14 bbos Exp $ --> |
4 | 4 | <HEAD> |
5 | 5 | <TITLE>Grammar of CSS 2.1</TITLE> |
6 | 6 | </HEAD> |
@@ -41,46 +41,46 @@ used:</P> |
41 | 41 | <pre> |
42 | 42 | stylesheet |
43 | 43 | : [ CHARSET_SYM STRING ';' ]? |
44 | | - [S|CDO|CDC]* [ import [ [CDO|CDC] [S|CDO|CDC] ]* ]* |
45 | | - [ [ ruleset | media | page ] [ [CDO|CDC] [S|CDO|CDC] ]* ]* |
| 44 | + [S|CDO|CDC]* [ import [ CDO S* | CDC S* ]* ]* |
| 45 | + [ [ ruleset | media | page ] [ CDO S* | CDC S* ]* ]* |
46 | 46 | ; |
47 | 47 | import |
48 | 48 | : IMPORT_SYM S* |
49 | | - [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S* |
| 49 | + [STRING|URI] S* [ medium [ ',' S* medium]* ]? ';' S* |
50 | 50 | ; |
51 | 51 | media |
52 | | - : MEDIA_SYM S* medium [ COMMA S* medium ]* LBRACE S* ruleset* '}' S* |
| 52 | + : MEDIA_SYM S* medium [ ',' S* medium ]* '{' S* ruleset* '}' S* |
53 | 53 | ; |
54 | 54 | medium |
55 | 55 | : IDENT S* |
56 | 56 | ; |
57 | 57 | page |
58 | 58 | : PAGE_SYM S* pseudo_page? |
59 | | - LBRACE S* declaration? [ ';' S* declaration? ]* '}' S* |
| 59 | + '{' S* declaration? [ ';' S* declaration? ]* '}' S* |
60 | 60 | ; |
61 | 61 | pseudo_page |
62 | 62 | : ':' IDENT S* |
63 | 63 | ; |
64 | 64 | operator |
65 | | - : '/' S* | COMMA S* |
| 65 | + : '/' S* | ',' S* |
66 | 66 | ; |
67 | 67 | combinator |
68 | | - : PLUS S* |
69 | | - | GREATER S* |
| 68 | + : S* '+' S* |
| 69 | + | S* '>' S* |
70 | 70 | | S+ |
71 | 71 | ; |
72 | 72 | unary_operator |
73 | | - : '-' | PLUS |
| 73 | + : '-' | '+' |
74 | 74 | ; |
75 | 75 | property |
76 | 76 | : IDENT S* |
77 | 77 | ; |
78 | 78 | ruleset |
79 | | - : selector [ COMMA S* selector ]* |
80 | | - LBRACE S* declaration? [ ';' S* declaration? ]* '}' S* |
| 79 | + : selector [ ',' S* selector ]* |
| 80 | + '{' S* declaration? [ ';' S* declaration? ]* '}' S* |
81 | 81 | ; |
82 | 82 | <span class="index-inst" title="selector">selector</span> |
83 | | - : simple_selector [ combinator simple_selector ]* |
| 83 | + : simple_selector [ combinator simple_selector ]* S* |
84 | 84 | ; |
85 | 85 | simple_selector |
86 | 86 | : element_name [ HASH | class | attrib | pseudo ]* |
@@ -196,11 +196,6 @@ Z z|\\0{0,4}(5a|7a)(\r\n|[ \t\r\n\f])?|\\z |
196 | 196 | "~=" {return INCLUDES;} |
197 | 197 | "|=" {return DASHMATCH;} |
198 | 198 |
|
199 | | -{w}"{" {return LBRACE;} |
200 | | -{w}"+" {return PLUS;} |
201 | | -{w}">" {return GREATER;} |
202 | | -{w}"," {return COMMA;} |
203 | | - |
204 | 199 | {string} {return STRING;} |
205 | 200 | {invalid} {return INVALID; /* unclosed string */} |
206 | 201 |
|
|
0 commit comments