3 module ET = RecommTypes
5 let lc = String.lowercase_ascii
9 %token <string> SP NL OP CP PP SR KW CW HW SW OT
13 %type <RecommTypes.srcs> srcs
39 | inn_r inns { $1 ^ $2 }
43 | inn inns { $1 ^ $2 }
47 | inn_w inns_w { $1 ^ $2 }
60 | out outs { $1 ^ $2 }
73 | SP cw cws { $2 :: $3 }
87 | SP sw sws { $2 :: $3 }
91 | OP sp PP inns CP { ET.Mark $4 }
92 | OP sp KW inns_w CP { ET.Key ($3, $4) }
93 | OP sp CW cws CP { ET.Title ($3 :: $4) }
94 | OP sp HW sws CP { ET.Slice (lc $3 :: $4) }
95 | OP sp CP { ET.Other (0, $1, $2, $3) }
96 | OP sp inns_r CP { ET.Other (0, $1, $2 ^ $3, $4) }
97 | OP SR inns CP { ET.Other (1, $1, $2 ^ $3, $4) }
98 | OP SR SR inns CP { ET.Other (2, $1, $2 ^ $3 ^ $4, $5) }
99 | OP SP SR inns CP { ET.Mark $4 }
102 | outs { ET.Text $1 }
106 | src_l srcs { $1 :: $2 }
110 | src srcs_l { $1 :: $2 }