8 S.split (S.regexp "[ \r\n\t]+") s
10 let mk_css_atom s rs =
12 let map (b, (x1, x2)) = cs, b, x1, x2 in
15 let mk_string_atom s rs =
16 let map (b, (x1, x2)) = s, b, x1, x2 in
23 %token SPACE NAME TABLE CSS URI EXT SR OC CC OB CB PS CF OP CP AT EOF
26 %type <(string * string) list * (string * Table.table * Table.css Attr.atoms * Table.uri Attr.atoms * Table.ext Attr.atoms) list> script
31 | SPACE TEXT TEXT { $2, $3 }
36 | space spaces { $1 :: $2 }
41 | AT OP TEXT TEXT CP { T.Link (true, $3, $4) }
42 | AT AT OP TEXT TEXT CP { T.Link (false, $4, $5) }
43 | AT TEXT { T.Link (true, $2, $2) }
44 | AT AT TEXT { T.Link (false, $3, $3) }
49 | text PS texts { $1 :: T.Plain " " :: $3 }
50 | text CF texts { $1 :: $3 }
56 | NUM { T.Glue (Some $1) }
61 | CSS TEXT { split $2 }
75 | css uri ext name key { T.mk_key $5 $1 $2 $3 $4 }
76 | css uri ext OC tables CC { T.mk_line false $5 $1 $2 $3 "" }
77 | css uri ext OB tables CB { T.mk_line true $5 $1 $2 $3 "" }
82 | table tables { $1 :: $2 }
91 | NUM { Some $1, Some $1 }
93 | NUM NUM { Some $1, Some $2 }
94 | NUM SR { Some $1, None }
95 | SR NUM { None, Some $2 }
96 | SR SR { None, None }
100 | OB interval CB { true, $2 }
101 | OC interval CC { false, $2 }
106 | range ranges { $1 :: $2 }
110 | CSS TEXT ranges { mk_css_atom $2 $3 }
115 | catom catoms { $1 @ $2 }
119 | URI TEXT ranges { mk_string_atom $2 $3 }
124 | uatom uatoms { $1 @ $2 }
128 | EXT TEXT ranges { mk_string_atom $2 $3 }
133 | xatom xatoms { $1 @ $2 }
137 | name TABLE table catoms uatoms xatoms { $1, $3, $4, $5, $6 }
142 | directive directives { $1 :: $2 }
146 | spaces directives EOF { $1, $2 }