csspool 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1321 @@
1
+ class CSS::SAC::GeneratedPropertyParser
2
+
3
+ token ANGLE COLOR URI PERCENTAGE LENGTH EMS EXS STRING IDENT INTEGER COMMA
4
+ token TIME NUMBER FREQ HASH
5
+
6
+ rule
7
+ property
8
+ : azimuth
9
+ | background_attachment
10
+ | background_color
11
+ | background_image
12
+ | background_position
13
+ | background_repeat
14
+ | background
15
+ | border_collapse
16
+ | border_color
17
+ | border_spacing
18
+ | border_style
19
+ | border_trbl
20
+ | border_trbl_color
21
+ | border_trbl_style
22
+ | border_trbl_width
23
+ | border_width
24
+ | border
25
+ | bottom
26
+ | caption_side
27
+ | clear
28
+ | clip
29
+ | color_lex
30
+ | content
31
+ | counter_increment_or_reset
32
+ | cue_after_or_before
33
+ | cue
34
+ | cursor
35
+ | direction
36
+ | display
37
+ | elevation
38
+ | empty_cells
39
+ | float
40
+ | font_family
41
+ | font_size
42
+ | font_style
43
+ | font_variant
44
+ | font_weight
45
+ | font
46
+ | hlrt
47
+ | letter_spacing
48
+ | line_height
49
+ | list_style_image
50
+ | list_style_position
51
+ | list_style_type
52
+ | list_style
53
+ | margin_rltb
54
+ | margin
55
+ | max_height_or_width
56
+ | min_height_or_width
57
+ | orphans
58
+ | outline_color
59
+ | outline_style
60
+ | outline_width
61
+ | outline
62
+ | overflow
63
+ | padding_trbl
64
+ | padding
65
+ | page_break_ab
66
+ | page_break_inside
67
+ | pause_ab
68
+ | pause
69
+ | pitch_range
70
+ | pitch
71
+ | play_during
72
+ | position
73
+ | quotes
74
+ | richness
75
+ | speak_header
76
+ | speak_numeral
77
+ | speak_punctuation
78
+ | speak
79
+ | speech_rate
80
+ | stress
81
+ | table_layout
82
+ | text_align
83
+ | text_decoration
84
+ | text_indent
85
+ | text_transform
86
+ | unicode_bidi
87
+ | vertical_align
88
+ | visibility
89
+ | voice_family
90
+ | volume
91
+ | white_space
92
+ | windows
93
+ | width
94
+ | word_spacing
95
+ | z_index
96
+ ;
97
+ angle
98
+ : ANGLE { result = CSS::SAC::Number.new(val.first) }
99
+ | zero
100
+ ;
101
+ percentage
102
+ : PERCENTAGE { result = CSS::SAC::Number.new(val.first) }
103
+ | zero
104
+ ;
105
+ time
106
+ : TIME { result = CSS::SAC::Number.new(val.first) }
107
+ | zero
108
+ ;
109
+ number
110
+ : NUMBER { result = CSS::SAC::Number.new(val.first) }
111
+ ;
112
+ integer
113
+ : NUMBER { result = CSS::SAC::Number.new(val.first) }
114
+ ;
115
+ frequency
116
+ : FREQ { result = CSS::SAC::Number.new(val.first) }
117
+ | zero
118
+ ;
119
+ string
120
+ : STRING { result = LexicalString.new(val.first) }
121
+ ;
122
+ uri
123
+ : URI { result = LexicalURI.new(val.first) }
124
+ ;
125
+ length
126
+ : length_values { result = CSS::SAC::Number.new(val.first) }
127
+ | zero
128
+ ;
129
+ auto
130
+ : 'auto' { result = LexicalIdent.new(val.first) }
131
+ ;
132
+ inherit
133
+ : 'inherit' { result = LexicalIdent.new(val.first) }
134
+ ;
135
+ invert
136
+ : 'invert' { result = LexicalIdent.new(val.first) }
137
+ ;
138
+ ident
139
+ : IDENT { result = LexicalIdent.new(val.first) }
140
+ ;
141
+ none
142
+ : 'none' { result = LexicalIdent.new(val.first) }
143
+ ;
144
+ normal
145
+ : 'normal' { result = LexicalIdent.new(val.first) }
146
+ ;
147
+ transparent
148
+ : 'transparent' { result = LexicalIdent.new(val.first) }
149
+ ;
150
+ length_values
151
+ : LENGTH
152
+ | EMS
153
+ | EXS
154
+ ;
155
+ zero
156
+ : '0' { result = CSS::SAC::Number.new('0') }
157
+ ;
158
+ color
159
+ : COLOR
160
+ | HASH { result = Color.new(val.first) }
161
+ | color_names { result = LexicalIdent.new(val.first) }
162
+ ;
163
+ color_names
164
+ : 'aqua'
165
+ | 'black'
166
+ | 'blue'
167
+ | 'fuchsia'
168
+ | 'gray'
169
+ | 'green'
170
+ | 'lime'
171
+ | 'maroon'
172
+ | 'navy'
173
+ | 'olive'
174
+ | 'orange'
175
+ | 'purple'
176
+ | 'red'
177
+ | 'silver'
178
+ | 'teal'
179
+ | 'white'
180
+ | 'yellow'
181
+ ;
182
+ azimuth
183
+ : 'azimuth' ANGLE { result = CSS::SAC::Number.new(val[1]) }
184
+ | 'azimuth' azimuth_side_and_behind {
185
+ result = [val[1]].flatten.map { |x|
186
+ LexicalIdent.new(x)
187
+ }
188
+ }
189
+ | 'azimuth' 'leftwards' { result = LexicalIdent.new(val[1]) }
190
+ | 'azimuth' 'rightwards' { result = LexicalIdent.new(val[1]) }
191
+ | 'azimuth' inherit { result = val[1] }
192
+ ;
193
+ azimuth_side_and_behind
194
+ : azimuth_side_values 'behind' { result = val }
195
+ | 'behind' azimuth_side_values { result = val }
196
+ | azimuth_side_values
197
+ | 'behind'
198
+ ;
199
+ azimuth_side_values
200
+ : 'left-side'
201
+ | 'far-left'
202
+ | 'left'
203
+ | 'center-left'
204
+ | 'center'
205
+ | 'center-right'
206
+ | 'right'
207
+ | 'far-right'
208
+ | 'right-side'
209
+ ;
210
+ background_attachment
211
+ : 'background-attachment' background_attachment_values {
212
+ result = val[1]
213
+ }
214
+ | 'background-attachment' inherit { result = val[1] }
215
+ ;
216
+ background_attachment_values
217
+ : background_attachment_values_ident {
218
+ result = LexicalIdent.new(val.first)
219
+ }
220
+ ;
221
+ background_attachment_values_ident
222
+ : 'scroll'
223
+ | 'fixed'
224
+ ;
225
+ background_color
226
+ : 'background-color' background_color_values { result = val[1] }
227
+ | 'background-color' inherit { result = val[1] }
228
+ ;
229
+ background_color_values
230
+ : color
231
+ | transparent
232
+ ;
233
+ background_image
234
+ : 'background-image' background_image_values { result = val[1] }
235
+ | 'background-image' inherit { result = val[1] }
236
+ ;
237
+ background_image_values
238
+ : uri
239
+ | 'none' { result = LexicalIdent.new(val.first) }
240
+ ;
241
+ background_position
242
+ : 'background-position' background_position_values {
243
+ result = [val[1]].flatten.compact
244
+ }
245
+ | 'background-position' inherit { result = val[1] }
246
+ ;
247
+ background_position_values
248
+ : pl_left_center_right optional_pl_top_center_bottom { result = val }
249
+ | left_center_right top_center_bottom { result = val }
250
+ | top_center_bottom left_center_right { result = val }
251
+ | left_center_right
252
+ | top_center_bottom
253
+ ;
254
+ pl_left_center_right
255
+ : percentage
256
+ | length
257
+ | left_center_right
258
+ ;
259
+ left_center_right
260
+ : left_center_right_values { result = LexicalIdent.new(val.first) }
261
+ ;
262
+ left_center_right_values
263
+ : 'left'
264
+ | 'center'
265
+ | 'right'
266
+ ;
267
+ optional_pl_top_center_bottom
268
+ : percentage
269
+ | length
270
+ | top_center_bottom
271
+ |
272
+ ;
273
+ top_center_bottom
274
+ : top_center_bottom_values { result = LexicalIdent.new(val.first) }
275
+ ;
276
+ top_center_bottom_values
277
+ : 'top'
278
+ | 'center'
279
+ | 'bottom'
280
+ ;
281
+ background_repeat
282
+ : 'background-repeat' background_repeat_values { result = val[1] }
283
+ | 'background-repeat' inherit { result = val[1] }
284
+ ;
285
+ background_repeat_values
286
+ : background_repeat_values_ident { result = LexicalIdent.new(val.first) }
287
+ ;
288
+ background_repeat_values_ident
289
+ : 'repeat'
290
+ | 'repeat-x'
291
+ | 'repeat-y'
292
+ | 'no-repeat'
293
+ ;
294
+ background
295
+ : 'background' background_values { result = [val[1]].flatten.compact }
296
+ | 'background' inherit { result = val[1] }
297
+ ;
298
+ background_values
299
+ <% %w{ background_color_values
300
+ background_image_values
301
+ background_repeat_values
302
+ background_attachment_values
303
+ background_position_values
304
+ }.permute_all_combinations.each_with_index do |list, i| %>
305
+ <%= i == 0 ? ':' : '|' %> <%= list.join(' ') %> { result = val }
306
+ <% end %>
307
+ ;
308
+ border_collapse
309
+ : 'border-collapse' border_collapse_values {
310
+ result = LexicalIdent.new(val[1])
311
+ }
312
+ | 'border-collapse' inherit { result = val[1] }
313
+ ;
314
+ border_collapse_values
315
+ : 'collapse'
316
+ | 'separate'
317
+ ;
318
+ border_color
319
+ : 'border-color' border_color_values { result = val[1].flatten }
320
+ | 'border-color' inherit { result = val[1] }
321
+ ;
322
+ border_color_values
323
+ <% (1..4).to_a.reverse.each_with_index do |num, i| %>
324
+ <%= i == 0 ? ':' : '|' %> <%= (['color_or_transparent'] * num).join(' ') %> { result = val }
325
+ <% end %>
326
+ ;
327
+ color_or_transparent
328
+ : color
329
+ | transparent
330
+ ;
331
+ border_spacing
332
+ : 'border-spacing' border_spacing_values { result = [val[1]].flatten }
333
+ | 'border-spacing' inherit { result = val[1] }
334
+ ;
335
+ border_spacing_values
336
+ : length length { result = val }
337
+ | length
338
+ ;
339
+ border_style
340
+ : 'border-style' border_style_values_1to4 { result = [val[1]].flatten }
341
+ | 'border-style' inherit { result = val[1] }
342
+ ;
343
+ border_style_values_1to4
344
+ : border_style_values border_style_values border_style_values
345
+ border_style_values { result = val }
346
+ | border_style_values border_style_values border_style_values {
347
+ result = val
348
+ }
349
+ | border_style_values border_style_values { result = val }
350
+ | border_style_values
351
+ ;
352
+ border_style_values
353
+ : border_style_values_ident { result = LexicalIdent.new(val.first) }
354
+ ;
355
+ border_style_values_ident
356
+ : 'none'
357
+ | 'hidden'
358
+ | 'dotted'
359
+ | 'dashed'
360
+ | 'solid'
361
+ | 'double'
362
+ | 'groove'
363
+ | 'ridge'
364
+ | 'inset'
365
+ | 'outset'
366
+ ;
367
+ border_trbl
368
+ : border_trbl_keys border_values { result = [val[1]].flatten }
369
+ | border_trbl_keys inherit { result = val[1] }
370
+ ;
371
+ border_trbl_keys
372
+ : 'border-top'
373
+ | 'border-right'
374
+ | 'border-bottom'
375
+ | 'border-left'
376
+ ;
377
+ border_trbl_color
378
+ : border_trbl_color_keys border_trbl_color_values { result = val[1] }
379
+ | border_trbl_color_keys inherit { result = val[1] }
380
+ ;
381
+ border_trbl_color_keys
382
+ : 'border-top-color'
383
+ | 'border-right-color'
384
+ | 'border-bottom-color'
385
+ | 'border-left-color'
386
+ ;
387
+ border_trbl_color_values
388
+ : color
389
+ | transparent
390
+ ;
391
+ border_trbl_style
392
+ : border_trbl_style_keys border_style_values { result = val[1] }
393
+ | border_trbl_style_keys inherit { result = val[1] }
394
+ ;
395
+ border_trbl_style_keys
396
+ : 'border-top-style'
397
+ | 'border-right-style'
398
+ | 'border-bottom-style'
399
+ | 'border-left-style'
400
+ ;
401
+ border_trbl_width
402
+ : border_trbl_width_keys border_width_values { result = val[1] }
403
+ | border_trbl_width_keys inherit { result = val[1] }
404
+ ;
405
+ border_trbl_width_keys
406
+ : 'border-top-width'
407
+ | 'border-right-width'
408
+ | 'border-bottom-width'
409
+ | 'border-left-width'
410
+ ;
411
+ border_width
412
+ : 'border-width' border_width_values_1to4 { result = [val[1]].flatten }
413
+ | 'border-width' inherit { result = val[1] }
414
+ ;
415
+ border_width_values
416
+ : border_width_values_ident { result = LexicalIdent.new(val.first) }
417
+ | length
418
+ ;
419
+ border_width_values_ident
420
+ : 'thin'
421
+ | 'medium'
422
+ | 'thick'
423
+ ;
424
+ border_width_values_1to4
425
+ <% (1..4).to_a.reverse.each_with_index do |num, i| %>
426
+ <%= i == 0 ? ':' : '|' %> <%= (['border_width_values'] * num).join(' ') %> { result = val }
427
+ <% end %>
428
+ ;
429
+ border
430
+ : 'border' border_values { result = [val[1]].flatten }
431
+ | 'border' border_style_values { result = val[1] }
432
+ | 'border' inherit { result = val[1] }
433
+ ;
434
+ border_values
435
+ <% %w{ border_width_values
436
+ border_style_values
437
+ color
438
+ }.permute_all_combinations.each_with_index do |list, i| %>
439
+ <%= i == 0 ? ':' : '|' %> <%= list.join(' ') %> { result = val }
440
+ <% end %>
441
+ ;
442
+ bottom
443
+ : 'bottom' bottom_values { result = val[1] }
444
+ | 'bottom' inherit { result = val[1] }
445
+ ;
446
+ bottom_values
447
+ : length
448
+ | percentage
449
+ | auto
450
+ ;
451
+ caption_side
452
+ : 'caption-side' caption_side_values { result = LexicalIdent.new(val[1]) }
453
+ | 'caption-side' inherit { result = val[1] }
454
+ ;
455
+ caption_side_values
456
+ : 'top'
457
+ | 'bottom'
458
+ ;
459
+ clear
460
+ : 'clear' clear_values { result = LexicalIdent.new(val[1]) }
461
+ | 'clear' inherit { result = val[1] }
462
+ ;
463
+ clear_values
464
+ : 'none'
465
+ | 'left'
466
+ | 'right'
467
+ | 'both'
468
+ ;
469
+ clip
470
+ : 'clip' clip_values { result = val[1] }
471
+ | 'clip' inherit { result = val[1] }
472
+ ;
473
+ clip_values
474
+ : shape
475
+ | auto
476
+ ;
477
+ shape
478
+ : 'rect(' shape_param COMMA shape_param COMMA shape_param COMMA
479
+ shape_param {
480
+ result = Function.new(val[0], [val[1], val[3], val[5], val[7]])
481
+ }
482
+ ;
483
+ shape_param
484
+ : length
485
+ | 'auto'
486
+ ;
487
+ color_lex
488
+ : 'color' color { result = val[1] }
489
+ | 'color' 'inherit' { result = LexicalIdent.new(val[1]) }
490
+ ;
491
+ content
492
+ : 'content' content_values_1toN { result = [val[1]].flatten }
493
+ | 'content' inherit { result = val[1] }
494
+ ;
495
+ content_values_1toN
496
+ : content_values content_values_1toN { result = val }
497
+ | content_values
498
+ ;
499
+ content_values
500
+ : content_values_ident { result = LexicalIdent.new(val.first) }
501
+ | string
502
+ | normal
503
+ | none
504
+ | uri
505
+ | counter
506
+ | 'attr(' ident {
507
+ result = Function.new(val[0], [val[1]])
508
+ }
509
+ ;
510
+ content_values_ident
511
+ : 'open-quote'
512
+ | 'close-quote'
513
+ | 'no-open-quote'
514
+ | 'no-close-quote'
515
+ ;
516
+ counter
517
+ : 'counter(' IDENT list_style_type_values {
518
+ result = Function.new(val[0], [val[1], val[2]].flatten)
519
+ }
520
+ | 'counter(' IDENT { result = Function.new(val[0], [val[1]]) }
521
+ | 'counters(' IDENT string list_style_type_values {
522
+ result = Function.new(val[0], [val[1], val[2], val[3]].flatten)
523
+ }
524
+ | 'counters(' IDENT string {
525
+ result = Function.new(val[0], [val[1], val[2]])
526
+ }
527
+ ;
528
+ counter_increment_or_reset
529
+ : counter_increment_or_reset_keys counter_increment_values_1toN {
530
+ result = [val[1]].flatten
531
+ }
532
+ | counter_increment_or_reset_keys none { result = val[1] }
533
+ | counter_increment_or_reset_keys inherit { result = val[1] }
534
+ ;
535
+ counter_increment_or_reset_keys
536
+ : 'counter-increment'
537
+ | 'counter-reset'
538
+ ;
539
+ counter_increment_values_1toN
540
+ : counter_increment_values counter_increment_values_1toN { result = val }
541
+ | counter_increment_values
542
+ ;
543
+ counter_increment_values
544
+ : ident number { result = val }
545
+ | ident
546
+ ;
547
+ cue_after_or_before
548
+ : cue_after_or_before_keys cue_after_or_before_values { result = val[1] }
549
+ | cue_after_or_before_keys inherit { result = val[1] }
550
+ ;
551
+ cue_after_or_before_values
552
+ : uri
553
+ | none
554
+ ;
555
+ cue_after_or_before_keys
556
+ : 'cue-after'
557
+ | 'cue-before'
558
+ ;
559
+ cue
560
+ : 'cue' cue_values { result = val[1] }
561
+ | 'cue' inherit { result = val[1] }
562
+ ;
563
+ cue_values
564
+ : cue_after_or_before_values cue_after_or_before_values { result = val }
565
+ | cue_after_or_before_values
566
+ ;
567
+ ;
568
+ cursor
569
+ : 'cursor' cursor_values { result = val[1] }
570
+ | 'cursor' inherit { result = val[1] }
571
+ ;
572
+ cursor_values
573
+ : uri_0toN cursor_values_idents {
574
+ result = [val[0], LexicalIdent.new(val[1])].flatten.compact
575
+ }
576
+ ;
577
+ cursor_values_idents
578
+ : 'auto'
579
+ | 'crosshair'
580
+ | 'default'
581
+ | 'pointer'
582
+ | 'move'
583
+ | 'e-resize'
584
+ | 'ne-resize'
585
+ | 'nw-resize'
586
+ | 'n-resize'
587
+ | 'se-resize'
588
+ | 'sw-resize'
589
+ | 's-resize'
590
+ | 'w-resize'
591
+ | 'text'
592
+ | 'wait'
593
+ | 'help'
594
+ | 'progress'
595
+ ;
596
+ uri_0toN
597
+ : uri COMMA uri_0toN { result = [val.first, val.last] }
598
+ | uri
599
+ |
600
+ ;
601
+ direction
602
+ : 'direction' 'ltr' { result = LexicalIdent.new(val[1]) }
603
+ | 'direction' 'rtl' { result = LexicalIdent.new(val[1]) }
604
+ | 'direction' inherit { result = val[1] }
605
+ ;
606
+ display
607
+ : 'display' display_values { result = LexicalIdent.new(val[1]) }
608
+ | 'display' inherit { result = val[1] }
609
+ ;
610
+ display_values
611
+ : 'inline'
612
+ | 'block'
613
+ | 'list-item'
614
+ | 'run-in'
615
+ | 'inline-block'
616
+ | 'table'
617
+ | 'inline-table'
618
+ | 'table-row-group'
619
+ | 'table-header-group'
620
+ | 'table-footer-group'
621
+ | 'table-row'
622
+ | 'table-column-group'
623
+ | 'table-column'
624
+ | 'table-cell'
625
+ | 'table-caption'
626
+ | 'none'
627
+ ;
628
+ elevation
629
+ : 'elevation' elevation_values { result = val[1] }
630
+ | 'elevation' inherit { result = val[1] }
631
+ ;
632
+ elevation_values
633
+ : angle
634
+ | elevation_values_ident { result = LexicalIdent.new(val.first) }
635
+ ;
636
+ elevation_values_ident
637
+ | 'below'
638
+ | 'level'
639
+ | 'above'
640
+ | 'higher'
641
+ | 'lower'
642
+ ;
643
+ empty_cells
644
+ : 'empty-cells' empty_cells_values { result = LexicalIdent.new(val[1]) }
645
+ | 'empty-cells' inherit { result = val[1] }
646
+ ;
647
+ empty_cells_values
648
+ : 'show'
649
+ | 'hide'
650
+ ;
651
+ float
652
+ : 'float' float_values { result = LexicalIdent.new(val[1]) }
653
+ | 'float' inherit { result = val[1] }
654
+ ;
655
+ float_values
656
+ : 'left'
657
+ | 'right'
658
+ | 'none'
659
+ ;
660
+ font_family
661
+ : 'font-family' font_family_values_1toN { result = [val[1]].flatten }
662
+ | 'font-family' inherit { result = val[1] }
663
+ ;
664
+ font_family_values_1toN
665
+ : font_family_values COMMA font_family_values_1toN {
666
+ result = [val.first, val.last]
667
+ }
668
+ | font_family_values
669
+ ;
670
+ font_family_values
671
+ : ident
672
+ | string
673
+ | generic_family { result = LexicalIdent.new(val.first) }
674
+ ;
675
+ generic_family
676
+ : 'serif'
677
+ | 'sans-serif'
678
+ | 'cursive'
679
+ | 'fantasy'
680
+ | 'monospace'
681
+ ;
682
+ font_size
683
+ : 'font-size' font_size_values { result = val[1] }
684
+ | 'font-size' inherit { result = val[1] }
685
+ ;
686
+ font_size_values
687
+ : absolute_size { result = LexicalIdent.new(val.first) }
688
+ | relative_size { result = LexicalIdent.new(val.first) }
689
+ | length
690
+ | percentage
691
+ ;
692
+ absolute_size
693
+ : 'xx-small'
694
+ | 'x-small'
695
+ | 'small'
696
+ | 'medium'
697
+ | 'large'
698
+ | 'x-large'
699
+ | 'xx-large'
700
+ ;
701
+ relative_size
702
+ : 'larger'
703
+ | 'smaller'
704
+ ;
705
+ font_style
706
+ : 'font-style' font_style_values { result = val[1] }
707
+ | 'font-style' inherit { result = val[1] }
708
+ ;
709
+ font_style_values
710
+ : font_style_values_ident { result = LexicalIdent.new(val.first) }
711
+ | normal
712
+ ;
713
+ font_style_values_ident
714
+ : 'italic'
715
+ | 'oblique'
716
+ ;
717
+ font_variant
718
+ : 'font-variant' font_variant_values { result = val[1] }
719
+ | 'font-variant' inherit { result = val[1] }
720
+ ;
721
+ font_variant_values
722
+ : 'small-caps' { result = LexicalIdent.new(val.first) }
723
+ | normal
724
+ ;
725
+ font_weight
726
+ : 'font-weight' font_weight_values { result = val[1] }
727
+ | 'font-weight' inherit { result = val[1] }
728
+ ;
729
+ font_weight_values
730
+ : font_weight_values_ident { result = LexicalIdent.new(val.first) }
731
+ | normal
732
+ | number /* this is too loose. */
733
+ ;
734
+ font_weight_values_ident
735
+ : 'bold'
736
+ | 'bolder'
737
+ | 'lighter'
738
+ ;
739
+ font
740
+ : 'font' font_values { result = [val[1]].flatten.compact }
741
+ | 'font' inherit { result = val[1] }
742
+ ;
743
+ font_values
744
+ : font_style_variant_weight_0or1 font_size_values slash_line_height_0or1
745
+ font_family_values_1toN { result = val }
746
+ | font_values_ident { result = LexicalIdent.new(val.first) }
747
+ ;
748
+ font_values_ident
749
+ : 'caption'
750
+ | 'icon'
751
+ | 'menu'
752
+ | 'message-box'
753
+ | 'small-caption'
754
+ | 'status-bar'
755
+ ;
756
+ font_style_variant_weight_0or1
757
+ <% %w{ font_style_values
758
+ font_variant_values
759
+ font_weight_values
760
+ }.permute_all_combinations.each_with_index do |list, i| %>
761
+ <%= i == 0 ? ':' : '|' %> <%= list.join(' ') %> { result = val }
762
+ <% end %>
763
+ |
764
+ ;
765
+ slash_line_height_0or1
766
+ : '/' line_height_values { result = val[1] }
767
+ |
768
+ ;
769
+ hlrt
770
+ : hlrt_keys bottom_values { result = val[1] }
771
+ | hlrt_keys inherit { result = val[1] }
772
+ ;
773
+ hlrt_keys
774
+ : 'height'
775
+ | 'left'
776
+ | 'right'
777
+ | 'top'
778
+ ;
779
+ letter_spacing
780
+ : 'letter-spacing' letter_spacing_values { result = val[1] }
781
+ | 'letter-spacing' inherit { result = val[1] }
782
+ ;
783
+ letter_spacing_values
784
+ : normal
785
+ | length
786
+ ;
787
+ line_height
788
+ : 'line-height' line_height_values { result = val[1] }
789
+ | 'line-height' inherit { result = val[1] }
790
+ ;
791
+ line_height_values
792
+ : normal
793
+ | number
794
+ | length
795
+ | percentage
796
+ ;
797
+ list_style_image
798
+ : 'list-style-image' list_style_image_values { result = val[1] }
799
+ | 'list-style-image' inherit { result = val[1] }
800
+ ;
801
+ list_style_image_values
802
+ : uri
803
+ | none
804
+ ;
805
+ list_style_position
806
+ : 'list-style-position' list_style_position_values { result = val[1] }
807
+ | 'list-style-position' inherit { result = val[1] }
808
+ ;
809
+ list_style_position_values
810
+ : list_style_position_ident { result = LexicalIdent.new(val.first) }
811
+ ;
812
+ list_style_position_ident
813
+ : 'inside'
814
+ | 'outside'
815
+ ;
816
+ list_style_type
817
+ : 'list-style-type' list_style_type_values { result = val[1] }
818
+ | 'list-style-type' inherit { result = val[1] }
819
+ ;
820
+ list_style_type_values
821
+ : list_style_type_values_ident { result = LexicalIdent.new(val.first) }
822
+ | none
823
+ ;
824
+ list_style_type_values_ident
825
+ : 'disc'
826
+ | 'circle'
827
+ | 'square'
828
+ | 'decimal'
829
+ | 'decimal-leading-zero'
830
+ | 'lower-roman'
831
+ | 'upper-roman'
832
+ | 'lower-greek'
833
+ | 'lower-latin'
834
+ | 'upper-latin'
835
+ | 'armenian'
836
+ | 'georgian'
837
+ | 'lower-alpha'
838
+ | 'upper-alpha'
839
+ ;
840
+ list_style
841
+ : 'list-style' list_style_values { result = [val[1]].flatten }
842
+ | 'list-style' inherit { result = val[1] }
843
+ ;
844
+ list_style_values
845
+ <% %w{ list_style_type_values
846
+ list_style_position_values
847
+ list_style_image_values
848
+ }.permute_all_combinations.each_with_index do |list, i| %>
849
+ <%= i == 0 ? ':' : '|' %> <%= list.join(' ') %> { result = val }
850
+ <% end %>
851
+ ;
852
+ margin_rltb
853
+ : margin_rltb_keys margin_width_values { result = val[1] }
854
+ | margin_rltb_keys inherit { result = val[1] }
855
+ ;
856
+ margin_rltb_keys
857
+ : 'margin-right'
858
+ | 'margin-left'
859
+ | 'margin-top'
860
+ | 'margin-bottom'
861
+ ;
862
+ margin
863
+ : 'margin' margin_width_values_1to4 { result = [val[1]].flatten }
864
+ | 'margin' inherit { result = val[1] }
865
+ ;
866
+ margin_width_values
867
+ : length
868
+ | percentage
869
+ | auto
870
+ ;
871
+ margin_width_values_1to4
872
+ <% (1..4).to_a.reverse.each_with_index do |num, i| %>
873
+ <%= i == 0 ? ':' : '|' %> <%= (['margin_width_values'] * num).join(' ') %> { result = val }
874
+ <% end %>
875
+ ;
876
+ max_height_or_width
877
+ : max_height_or_width_keys max_height_values { result = val[1] }
878
+ | max_height_or_width_keys inherit { result = val[1] }
879
+ ;
880
+ max_height_or_width_keys
881
+ : 'max-height'
882
+ | 'max-width'
883
+ ;
884
+ max_height_values
885
+ : length
886
+ | percentage
887
+ | none
888
+ ;
889
+ min_height_or_width
890
+ : min_height_or_width_keys min_height_values { result = val[1] }
891
+ | min_height_or_width_keys inherit { result = val[1] }
892
+ ;
893
+ min_height_or_width_keys
894
+ : 'min-height'
895
+ | 'min-width'
896
+ ;
897
+ min_height_values
898
+ : length
899
+ | percentage
900
+ ;
901
+ orphans
902
+ : 'orphans' integer { result = val[1] }
903
+ | 'orphans' inherit { result = val[1] }
904
+ ;
905
+ outline_color
906
+ : 'outline-color' outline_color_values { result = val[1] }
907
+ | 'outline-color' inherit { result = val[1] }
908
+ ;
909
+ outline_color_values
910
+ : color
911
+ | invert
912
+ ;
913
+ outline_style
914
+ : 'outline-style' outline_style_values { result = val[1] }
915
+ | 'outline-style' inherit { result = val[1] }
916
+ ;
917
+ outline_style_values
918
+ : border_style_values
919
+ ;
920
+ outline_width
921
+ : 'outline-width' outline_width_values { result = val[1] }
922
+ | 'outline-width' inherit { result = val[1] }
923
+ ;
924
+ outline_width_values
925
+ : border_width_values
926
+ ;
927
+ outline
928
+ : 'outline' outline_values { result = [val[1]].flatten }
929
+ | 'outline' inherit { result = val[1] }
930
+ ;
931
+ outline_values
932
+ <% %w{ outline_color_values
933
+ outline_style_values
934
+ outline_width_values
935
+ }.permute_all_combinations.each_with_index do |list, i| %>
936
+ <%= i == 0 ? ':' : '|' %> <%= list.join(' ') %> { result = val }
937
+ <% end %>
938
+ ;
939
+ overflow
940
+ : 'overflow' overflow_values { result = LexicalIdent.new(val[1]) }
941
+ | 'overflow' inherit { result = val[1] }
942
+ ;
943
+ overflow_values
944
+ : 'visible'
945
+ | 'hidden'
946
+ | 'scroll'
947
+ | 'auto'
948
+ ;
949
+ padding_trbl
950
+ : padding_trbl_keys padding_width { result = val[1] }
951
+ | padding_trbl_keys inherit { result = val[1] }
952
+ ;
953
+ padding_trbl_keys
954
+ : 'padding-top'
955
+ | 'padding-right'
956
+ | 'padding-bottom'
957
+ | 'padding-left'
958
+ ;
959
+ padding_width
960
+ : length
961
+ | percentage
962
+ ;
963
+ padding
964
+ : 'padding' padding_width_1to4 { result = [val[1]].flatten }
965
+ | 'padding' inherit { result = val[1] }
966
+ ;
967
+ padding_width_values
968
+ : length
969
+ | percentage
970
+ ;
971
+ padding_width_1to4
972
+ <% (1..4).to_a.reverse.each_with_index do |num, i| %>
973
+ <%= i == 0 ? ':' : '|' %> <%= (['padding_width_values'] * num).join(' ') %> { result = val }
974
+ <% end %>
975
+ ;
976
+ page_break_ab
977
+ : page_break_ab_keys page_break_ab_values {
978
+ result = LexicalIdent.new(val[1])
979
+ }
980
+ | page_break_ab_keys inherit { result = val[1] }
981
+ ;
982
+ page_break_ab_keys
983
+ : 'page-break-after'
984
+ | 'page-break-before'
985
+ ;
986
+ page_break_ab_values
987
+ : 'auto'
988
+ | 'always'
989
+ | 'avoid'
990
+ | 'left'
991
+ | 'right'
992
+ ;
993
+ page_break_inside
994
+ : 'page-break-inside' page_break_inside_values {
995
+ result = LexicalIdent.new(val[1])
996
+ }
997
+ | 'page-break-inside' inherit { result = val[1] }
998
+ ;
999
+ page_break_inside_values
1000
+ : 'avoid'
1001
+ | 'auto'
1002
+ ;
1003
+ pause_ab
1004
+ : pause_ab_keys pause_ab_values { result = val[1] }
1005
+ | pause_ab_keys inherit { result = val[1] }
1006
+ ;
1007
+ pause_ab_keys
1008
+ : 'pause-after'
1009
+ | 'pause-before'
1010
+ ;
1011
+ pause_ab_values
1012
+ : time
1013
+ | percentage
1014
+ ;
1015
+ pause
1016
+ : 'pause' pause_values_1or2 { result = val[1] }
1017
+ | 'pause' inherit { result = val[1] }
1018
+ ;
1019
+ pause_values_1or2
1020
+ : pause_values pause_values { result = val }
1021
+ | pause_values
1022
+ ;
1023
+ pause_values
1024
+ : time
1025
+ | percentage
1026
+ ;
1027
+ pitch_range
1028
+ : 'pitch-range' number { result = val[1] }
1029
+ | 'pitch-range' inherit { result = val[1] }
1030
+ ;
1031
+ pitch
1032
+ : 'pitch' pitch_values { result = val[1] }
1033
+ | 'pitch' inherit { result = val[1] }
1034
+ ;
1035
+ pitch_values
1036
+ : frequency
1037
+ | pitch_values_ident { result = LexicalIdent.new(val.first) }
1038
+ ;
1039
+ pitch_values_ident
1040
+ : 'x-low'
1041
+ | 'low'
1042
+ | 'medium'
1043
+ | 'high'
1044
+ | 'x-high'
1045
+ ;
1046
+ play_during
1047
+ : 'play-during' play_during_values { result = val[1] }
1048
+ | 'play-during' inherit { result = val[1] }
1049
+ ;
1050
+ play_during_values
1051
+ : uri mix_or_repeat_0or1 { result = [val].flatten.compact }
1052
+ | auto
1053
+ | none
1054
+ ;
1055
+ mix_or_repeat_0or1
1056
+ <% %w{ 'mix'
1057
+ 'repeat'
1058
+ }.permute_all_combinations.each_with_index do |list, i| %>
1059
+ <%= i == 0 ? ':' : '|' %> <%= list.join(' ') %> {
1060
+ result = val.map { |x| LexicalIdent.new(x) }
1061
+ }
1062
+ <% end %>
1063
+ |
1064
+ ;
1065
+ position
1066
+ : 'position' position_values { result = LexicalIdent.new(val[1]) }
1067
+ | 'position' inherit { result = val[1] }
1068
+ ;
1069
+ position_values
1070
+ : 'static'
1071
+ | 'relative'
1072
+ | 'absolute'
1073
+ | 'fixed'
1074
+ ;
1075
+ quotes
1076
+ : 'quotes' quotes_values { result = [val[1]].flatten }
1077
+ | 'quotes' inherit { result = val[1] }
1078
+ ;
1079
+ quotes_values
1080
+ : string_pair_1toN
1081
+ | none
1082
+ ;
1083
+ string_pair_1toN
1084
+ : string string string_pair_1toN { result = val }
1085
+ | string string { result = val }
1086
+ ;
1087
+ richness
1088
+ : 'richness' number { result = val[1] }
1089
+ | 'richness' inherit { result = val[1] }
1090
+ ;
1091
+ speak_header
1092
+ : 'speak-header' speak_header_values { result = LexicalIdent.new(val[1]) }
1093
+ | 'speak-header' inherit { result = val[1] }
1094
+ ;
1095
+ speak_header_values
1096
+ : 'once'
1097
+ | 'always'
1098
+ ;
1099
+ speak_numeral
1100
+ : 'speak-numeral' speak_numeral_values { result = LexicalIdent.new(val[1]) }
1101
+ | 'speak-numeral' inherit { result = val[1] }
1102
+ ;
1103
+ speak_numeral_values
1104
+ : 'digits'
1105
+ | 'continuous'
1106
+ ;
1107
+ speak_punctuation
1108
+ : 'speak-punctuation' speak_punctuation_values {
1109
+ result = LexicalIdent.new(val[1])
1110
+ }
1111
+ | 'speak-punctuation' inherit { result = val[1] }
1112
+ ;
1113
+ speak_punctuation_values
1114
+ : 'code'
1115
+ | 'none'
1116
+ ;
1117
+ speak
1118
+ : 'speak' speak_values { result = LexicalIdent.new(val[1]) }
1119
+ | 'speak' inherit { result = val[1] }
1120
+ ;
1121
+ speak_values
1122
+ : 'normal'
1123
+ | 'none'
1124
+ | 'spell-out'
1125
+ ;
1126
+ speech_rate
1127
+ : 'speech-rate' speech_rate_values { result = LexicalIdent.new(val[1]) }
1128
+ | 'speech-rate' number { result = val[1] }
1129
+ | 'speech-rate' inherit { result = val[1] }
1130
+ ;
1131
+ speech_rate_values
1132
+ : 'x-slow'
1133
+ | 'slow'
1134
+ | 'medium'
1135
+ | 'fast'
1136
+ | 'x-fast'
1137
+ | 'faster'
1138
+ | 'slower'
1139
+ ;
1140
+ stress
1141
+ : 'stress' number { result = val[1] }
1142
+ | 'stress' inherit { result = val[1] }
1143
+ ;
1144
+ table_layout
1145
+ : 'table-layout' table_layout_values { result = LexicalIdent.new(val[1]) }
1146
+ | 'table-layout' inherit { result = val[1] }
1147
+ ;
1148
+ table_layout_values
1149
+ : 'auto'
1150
+ | 'fixed'
1151
+ ;
1152
+ text_align
1153
+ : 'text-align' text_align_values { result = LexicalIdent.new(val[1]) }
1154
+ | 'text-align' inherit { result = val[1] }
1155
+ ;
1156
+ text_align_values
1157
+ : 'left'
1158
+ | 'right'
1159
+ | 'center'
1160
+ | 'justify'
1161
+ ;
1162
+ text_decoration
1163
+ : 'text-decoration' text_decoration_values { result = val[1] }
1164
+ | 'text-decoration' inherit { result = val[1] }
1165
+ ;
1166
+ text_decoration_values
1167
+ <% %w{ 'underline'
1168
+ 'overline'
1169
+ 'line-through'
1170
+ 'blink'
1171
+ }.permute_all_combinations.each_with_index do |list, i| %>
1172
+ <%= i == 0 ? ':' : '|' %> <%= list.join(' ') %> {
1173
+ result = val.map { |x| LexicalIdent.new(x) }
1174
+ }
1175
+ <% end %>
1176
+ | none
1177
+ ;
1178
+ text_indent
1179
+ : 'text-indent' text_indent_values { result = val[1] }
1180
+ | 'text-indent' inherit { result = val[1] }
1181
+ ;
1182
+ text_indent_values
1183
+ : length
1184
+ | percentage
1185
+ ;
1186
+ text_transform
1187
+ : 'text-transform' text_transform_values {
1188
+ result = LexicalIdent.new(val[1])
1189
+ }
1190
+ | 'text-transform' inherit { result = val[1] }
1191
+ ;
1192
+ text_transform_values
1193
+ : 'capitalize'
1194
+ | 'uppercase'
1195
+ | 'lowercase'
1196
+ | 'none'
1197
+ ;
1198
+ unicode_bidi
1199
+ : 'unicode-bidi' unicode_bidi_values { result = LexicalIdent.new(val[1]) }
1200
+ | 'unicode-bidi' inherit { result = val[1] }
1201
+ ;
1202
+ unicode_bidi_values
1203
+ : 'normal'
1204
+ | 'embed'
1205
+ | 'bidi-override'
1206
+ ;
1207
+ vertical_align
1208
+ : 'vertical-align' vertical_align_values { result = val[1] }
1209
+ | 'vertical-align' inherit { result = val[1] }
1210
+ ;
1211
+ vertical_align_values
1212
+ : vertical_align_values_ident { result = LexicalIdent.new(val.first) }
1213
+ | percentage
1214
+ | length
1215
+ ;
1216
+ vertical_align_values_ident
1217
+ : 'baseline'
1218
+ | 'sub'
1219
+ | 'super'
1220
+ | 'top'
1221
+ | 'text-top'
1222
+ | 'middle'
1223
+ | 'bottom'
1224
+ | 'text-bottom'
1225
+ ;
1226
+ visibility
1227
+ : 'visibility' visibility_values { result = LexicalIdent.new(val[1]) }
1228
+ | 'visibility' inherit { result = val[1] }
1229
+ ;
1230
+ visibility_values
1231
+ : 'visible'
1232
+ | 'hidden'
1233
+ | 'collapse'
1234
+ ;
1235
+ voice_family
1236
+ : 'voice-family' voice_family_values { result = val[1] }
1237
+ | 'voice-family' inherit { result = val[1] }
1238
+ ;
1239
+ voice_family_values
1240
+ : specific_voice_generic_voice_1toN { result = val.flatten }
1241
+ ;
1242
+ specific_voice_generic_voice_1toN
1243
+ : generic_voice COMMA specific_voice_generic_voice_1toN {
1244
+ result = [val.first, val.last]
1245
+ }
1246
+ | specific_voice COMMA specific_voice_generic_voice_1toN {
1247
+ result = [val.first, val.last]
1248
+ }
1249
+ | generic_voice
1250
+ | specific_voice
1251
+ ;
1252
+ generic_voice
1253
+ : generic_voice_ident { result = LexicalIdent.new(val.first) }
1254
+ ;
1255
+ generic_voice_ident
1256
+ : 'male'
1257
+ | 'female'
1258
+ | 'child'
1259
+ ;
1260
+ specific_voice
1261
+ : ident
1262
+ | string
1263
+ ;
1264
+ volume
1265
+ : 'volume' volume_values { result = val[1] }
1266
+ | 'volume' inherit { result = val[1] }
1267
+ ;
1268
+ volume_values
1269
+ : number
1270
+ | percentage
1271
+ | volume_values_ident { result = LexicalIdent.new(val.first) }
1272
+ ;
1273
+ volume_values_ident
1274
+ : 'silent'
1275
+ | 'x-soft'
1276
+ | 'soft'
1277
+ | 'medium'
1278
+ | 'loud'
1279
+ | 'x-loud'
1280
+ ;
1281
+ white_space
1282
+ : 'white-space' white_space_values { result = LexicalIdent.new(val[1]) }
1283
+ | 'white-space' inherit { result = val[1] }
1284
+ ;
1285
+ white_space_values
1286
+ : 'normal'
1287
+ | 'pre'
1288
+ | 'nowrap'
1289
+ | 'pre-wrap'
1290
+ | 'pre-line'
1291
+ ;
1292
+ windows
1293
+ : 'windows' integer { result = val[1] }
1294
+ | 'windows' inherit { result = val[1] }
1295
+ ;
1296
+ width
1297
+ : 'width' width_values { result = val[1] }
1298
+ | 'width' inherit { result = val[1] }
1299
+ ;
1300
+ width_values
1301
+ : length
1302
+ | percentage
1303
+ | auto
1304
+ ;
1305
+ word_spacing
1306
+ : 'word-spacing' word_spacing_values { result = val[1] }
1307
+ | 'word-spacing' inherit { result = val[1] }
1308
+ ;
1309
+ word_spacing_values
1310
+ : 'normal' { result = LexicalIdent.new(val.first) }
1311
+ | length
1312
+ ;
1313
+ z_index
1314
+ : 'z-index' z_index_values { result = val[1] }
1315
+ | 'z-index' inherit { result = val[1] }
1316
+ ;
1317
+ z_index_values
1318
+ : auto
1319
+ | integer
1320
+ ;
1321
+ /* vim: set filetype=racc : */