summaryrefslogtreecommitdiffstats
path: root/src/parsing/equalizer_apo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parsing/equalizer_apo.rs')
-rw-r--r--src/parsing/equalizer_apo.rs1159
1 files changed, 0 insertions, 1159 deletions
diff --git a/src/parsing/equalizer_apo.rs b/src/parsing/equalizer_apo.rs
deleted file mode 100644
index b0aa8f8..0000000
--- a/src/parsing/equalizer_apo.rs
+++ /dev/null
@@ -1,1159 +0,0 @@
1// auto-generated: "lalrpop 0.15.2"
2// sha256: 3981cad2c0ee5c1d80c3b7278bb1bc9926ee7b273c2b68423accdd84e43c494
3use ::Filter;
4use std::str::FromStr;
5#[allow(unused_extern_crates)]
6extern crate lalrpop_util as __lalrpop_util;
7
8#[cfg_attr(rustfmt, rustfmt_skip)]
9mod __parse__Main {
10 #![allow(non_snake_case, non_camel_case_types, unused_mut, unused_variables, unused_imports, unused_parens)]
11
12 use ::Filter;
13 use std::str::FromStr;
14 #[allow(unused_extern_crates)]
15 extern crate lalrpop_util as __lalrpop_util;
16 use super::__intern_token::Token;
17 #[allow(dead_code)]
18 pub enum __Symbol<'input>
19 {
20 Variant0(&'input str),
21 Variant1((u32, f64)),
22 Variant2(::std::vec::Vec<(u32, f64)>),
23 Variant3(f64),
24 Variant4((Vec<u32>, Vec<f64>)),
25 Variant5(u32),
26 Variant6(Filter),
27 Variant7(i32),
28 }
29 const __ACTION: &'static [i8] = &[
30 // State 0
31 0, 0, 4, 0, 0, 0, 0,
32 // State 1
33 0, 0, 0, 0, 0, 0, 0,
34 // State 2
35 0, 6, 0, 0, 0, 0, 0,
36 // State 3
37 0, 0, 0, 0, 12, 13, 14,
38 // State 4
39 0, 0, 0, 0, 0, 0, 0,
40 // State 5
41 0, 0, 0, 0, 0, 0, 14,
42 // State 6
43 0, -12, 0, 0, 0, 0, 0,
44 // State 7
45 0, 0, 0, 17, 0, 0, 0,
46 // State 8
47 -9, 0, 0, -9, 0, 0, 0,
48 // State 9
49 -7, 0, 0, -7, 0, 0, 0,
50 // State 10
51 -8, 0, 0, -8, 0, 0, 0,
52 // State 11
53 -13, 0, 0, -13, 0, 0, 0,
54 // State 12
55 -14, 0, 0, -14, 0, 0, 0,
56 // State 13
57 -10, 0, 0, -10, -10, -10, -10,
58 // State 14
59 0, 0, 0, 0, 0, 0, 14,
60 // State 15
61 0, 0, 0, 0, 12, 13, 14,
62 // State 16
63 0, -5, 0, 0, 0, 0, 0,
64 // State 17
65 0, 0, 0, 0, 12, 13, 14,
66 // State 18
67 21, 0, 0, 0, 0, 0, 0,
68 // State 19
69 22, 0, 0, 0, 0, 0, 0,
70 // State 20
71 0, 0, 0, 0, 0, 0, -2,
72 // State 21
73 0, 0, 0, 0, 0, 0, -3,
74 ];
75 const __EOF_ACTION: &'static [i8] = &[
76 // State 0
77 0,
78 // State 1
79 -15,
80 // State 2
81 0,
82 // State 3
83 0,
84 // State 4
85 -11,
86 // State 5
87 0,
88 // State 6
89 0,
90 // State 7
91 0,
92 // State 8
93 -9,
94 // State 9
95 -7,
96 // State 10
97 -8,
98 // State 11
99 -13,
100 // State 12
101 -14,
102 // State 13
103 -10,
104 // State 14
105 0,
106 // State 15
107 0,
108 // State 16
109 0,
110 // State 17
111 0,
112 // State 18
113 0,
114 // State 19
115 -6,
116 // State 20
117 0,
118 // State 21
119 0,
120 ];
121 const __GOTO: &'static [i8] = &[
122 // State 0
123 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0,
124 // State 1
125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
126 // State 2
127 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0,
128 // State 3
129 0, 0, 0, 7, 0, 8, 9, 0, 0, 10, 11, 0,
130 // State 4
131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
132 // State 5
133 0, 15, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
134 // State 6
135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
136 // State 7
137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
138 // State 8
139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
140 // State 9
141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
142 // State 10
143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
144 // State 11
145 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
146 // State 12
147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
148 // State 13
149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
150 // State 14
151 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0,
152 // State 15
153 0, 0, 0, 0, 0, 19, 9, 0, 0, 10, 11, 0,
154 // State 16
155 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
156 // State 17
157 0, 0, 0, 0, 0, 20, 9, 0, 0, 10, 11, 0,
158 // State 18
159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
160 // State 19
161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
162 // State 20
163 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
164 // State 21
165 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
166 ];
167 fn __expected_tokens(__state: usize) -> Vec<::std::string::String> {
168 const __TERMINAL: &'static [&'static str] = &[
169 r###"";""###,
170 r###""GraphicEQ:""###,
171 r###""Preamp:""###,
172 r###""dB""###,
173 r###"r#"-?[0-9]*\\.[0-9]+"#"###,
174 r###"r#"-[0-9]+"#"###,
175 r###"r#"[0-9]+"#"###,
176 ];
177 __ACTION[(__state * 7)..].iter().zip(__TERMINAL).filter_map(|(&state, terminal)| {
178 if state == 0 {
179 None
180 } else {
181 Some(terminal.to_string())
182 }
183 }).collect()
184 }
185 pub struct MainParser {
186 builder: super::__intern_token::__MatcherBuilder,
187 _priv: (),
188 }
189
190 impl MainParser {
191 pub fn new() -> MainParser {
192 let __builder = super::__intern_token::__MatcherBuilder::new();
193 MainParser {
194 builder: __builder,
195 _priv: (),
196 }
197 }
198
199 #[allow(dead_code)]
200 pub fn parse<
201 'input,
202 >(
203 &self,
204 input: &'input str,
205 ) -> Result<Filter, __lalrpop_util::ParseError<usize, Token<'input>, &'static str>>
206 {
207 let mut __tokens = self.builder.matcher(input);
208 let mut __states = vec![0_i8];
209 let mut __symbols = vec![];
210 let mut __integer;
211 let mut __lookahead;
212 let __last_location = &mut Default::default();
213 '__shift: loop {
214 __lookahead = match __tokens.next() {
215 Some(Ok(v)) => v,
216 None => break '__shift,
217 Some(Err(e)) => return Err(e),
218 };
219 *__last_location = __lookahead.2.clone();
220 __integer = match __lookahead.1 {
221 Token(3, _) if true => 0,
222 Token(4, _) if true => 1,
223 Token(5, _) if true => 2,
224 Token(6, _) if true => 3,
225 Token(0, _) if true => 4,
226 Token(1, _) if true => 5,
227 Token(2, _) if true => 6,
228 _ => {
229 let __state = *__states.last().unwrap() as usize;
230 let __error = __lalrpop_util::ParseError::UnrecognizedToken {
231 token: Some(__lookahead),
232 expected: __expected_tokens(__state),
233 };
234 return Err(__error);
235 }
236 };
237 '__inner: loop {
238 let __state = *__states.last().unwrap() as usize;
239 let __action = __ACTION[__state * 7 + __integer];
240 if __action > 0 {
241 let __symbol = match __integer {
242 0 => match __lookahead.1 {
243 Token(3, __tok0) => __Symbol::Variant0((__tok0)),
244 _ => unreachable!(),
245 },
246 1 => match __lookahead.1 {
247 Token(4, __tok0) => __Symbol::Variant0((__tok0)),
248 _ => unreachable!(),
249 },
250 2 => match __lookahead.1 {
251 Token(5, __tok0) => __Symbol::Variant0((__tok0)),
252 _ => unreachable!(),
253 },
254 3 => match __lookahead.1 {
255 Token(6, __tok0) => __Symbol::Variant0((__tok0)),
256 _ => unreachable!(),
257 },
258 4 => match __lookahead.1 {
259 Token(0, __tok0) => __Symbol::Variant0((__tok0)),
260 _ => unreachable!(),
261 },
262 5 => match __lookahead.1 {
263 Token(1, __tok0) => __Symbol::Variant0((__tok0)),
264 _ => unreachable!(),
265 },
266 6 => match __lookahead.1 {
267 Token(2, __tok0) => __Symbol::Variant0((__tok0)),
268 _ => unreachable!(),
269 },
270 _ => unreachable!(),
271 };
272 __states.push(__action - 1);
273 __symbols.push((__lookahead.0, __symbol, __lookahead.2));
274 continue '__shift;
275 } else if __action < 0 {
276 if let Some(r) = __reduce(input, __action, Some(&__lookahead.0), &mut __states, &mut __symbols, ::std::marker::PhantomData::<()>) {
277 if r.is_err() {
278 return r;
279 }
280 return Err(__lalrpop_util::ParseError::ExtraToken { token: __lookahead });
281 }
282 } else {
283 let mut __err_lookahead = Some(__lookahead);
284 let mut __err_integer: Option<usize> = Some(__integer);
285 let __state = *__states.last().unwrap() as usize;
286 let __error = __lalrpop_util::ParseError::UnrecognizedToken {
287 token: __err_lookahead,
288 expected: __expected_tokens(__state),
289 };
290 return Err(__error)
291 }
292 }
293 }
294 loop {
295 let __state = *__states.last().unwrap() as usize;
296 let __action = __EOF_ACTION[__state];
297 if __action < 0 {
298 if let Some(r) = __reduce(input, __action, None, &mut __states, &mut __symbols, ::std::marker::PhantomData::<()>) {
299 return r;
300 }
301 } else {
302 let mut __err_lookahead = None;
303 let mut __err_integer: Option<usize> = None;
304 let __state = *__states.last().unwrap() as usize;
305 let __error = __lalrpop_util::ParseError::UnrecognizedToken {
306 token: __err_lookahead,
307 expected: __expected_tokens(__state),
308 };
309 return Err(__error)
310 }
311 }
312 }
313 }
314 pub(crate) fn __reduce<
315 'input,
316 >(
317 input: &'input str,
318 __action: i8,
319 __lookahead_start: Option<&usize>,
320 __states: &mut ::std::vec::Vec<i8>,
321 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
322 _: ::std::marker::PhantomData<()>,
323 ) -> Option<Result<Filter,__lalrpop_util::ParseError<usize, Token<'input>, &'static str>>>
324 {
325 let (__pop_states, __symbol, __nonterminal) = match -__action {
326 1 => {
327 __reduce1(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
328 }
329 2 => {
330 __reduce2(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
331 }
332 3 => {
333 __reduce3(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
334 }
335 4 => {
336 __reduce4(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
337 }
338 5 => {
339 __reduce5(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
340 }
341 6 => {
342 __reduce6(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
343 }
344 7 => {
345 __reduce7(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
346 }
347 8 => {
348 __reduce8(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
349 }
350 9 => {
351 __reduce9(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
352 }
353 10 => {
354 __reduce10(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
355 }
356 11 => {
357 __reduce11(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
358 }
359 12 => {
360 __reduce12(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
361 }
362 13 => {
363 __reduce13(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
364 }
365 14 => {
366 __reduce14(input, __action, __lookahead_start, __states, __symbols, ::std::marker::PhantomData::<()>)
367 }
368 15 => {
369 // __Main = Main => ActionFn(0);
370 let __sym0 = __pop_Variant6(__symbols);
371 let __start = __sym0.0.clone();
372 let __end = __sym0.2.clone();
373 let __nt = super::__action0::<>(input, __sym0);
374 return Some(Ok(__nt));
375 }
376 _ => panic!("invalid action code {}", __action)
377 };
378 let __states_len = __states.len();
379 __states.truncate(__states_len - __pop_states);
380 __symbols.push(__symbol);
381 let __state = *__states.last().unwrap() as usize;
382 let __next_state = __GOTO[__state * 12 + __nonterminal] - 1;
383 __states.push(__next_state);
384 None
385 }
386 fn __pop_Variant4<
387 'input,
388 >(
389 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
390 ) -> (usize, (Vec<u32>, Vec<f64>), usize)
391 {
392 match __symbols.pop().unwrap() {
393 (__l, __Symbol::Variant4(__v), __r) => (__l, __v, __r),
394 _ => panic!("symbol type mismatch")
395 }
396 }
397 fn __pop_Variant1<
398 'input,
399 >(
400 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
401 ) -> (usize, (u32, f64), usize)
402 {
403 match __symbols.pop().unwrap() {
404 (__l, __Symbol::Variant1(__v), __r) => (__l, __v, __r),
405 _ => panic!("symbol type mismatch")
406 }
407 }
408 fn __pop_Variant6<
409 'input,
410 >(
411 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
412 ) -> (usize, Filter, usize)
413 {
414 match __symbols.pop().unwrap() {
415 (__l, __Symbol::Variant6(__v), __r) => (__l, __v, __r),
416 _ => panic!("symbol type mismatch")
417 }
418 }
419 fn __pop_Variant3<
420 'input,
421 >(
422 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
423 ) -> (usize, f64, usize)
424 {
425 match __symbols.pop().unwrap() {
426 (__l, __Symbol::Variant3(__v), __r) => (__l, __v, __r),
427 _ => panic!("symbol type mismatch")
428 }
429 }
430 fn __pop_Variant7<
431 'input,
432 >(
433 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
434 ) -> (usize, i32, usize)
435 {
436 match __symbols.pop().unwrap() {
437 (__l, __Symbol::Variant7(__v), __r) => (__l, __v, __r),
438 _ => panic!("symbol type mismatch")
439 }
440 }
441 fn __pop_Variant5<
442 'input,
443 >(
444 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
445 ) -> (usize, u32, usize)
446 {
447 match __symbols.pop().unwrap() {
448 (__l, __Symbol::Variant5(__v), __r) => (__l, __v, __r),
449 _ => panic!("symbol type mismatch")
450 }
451 }
452 fn __pop_Variant2<
453 'input,
454 >(
455 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
456 ) -> (usize, ::std::vec::Vec<(u32, f64)>, usize)
457 {
458 match __symbols.pop().unwrap() {
459 (__l, __Symbol::Variant2(__v), __r) => (__l, __v, __r),
460 _ => panic!("symbol type mismatch")
461 }
462 }
463 fn __pop_Variant0<
464 'input,
465 >(
466 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
467 ) -> (usize, &'input str, usize)
468 {
469 match __symbols.pop().unwrap() {
470 (__l, __Symbol::Variant0(__v), __r) => (__l, __v, __r),
471 _ => panic!("symbol type mismatch")
472 }
473 }
474 pub(crate) fn __reduce1<
475 'input,
476 >(
477 input: &'input str,
478 __action: i8,
479 __lookahead_start: Option<&usize>,
480 __states: &mut ::std::vec::Vec<i8>,
481 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
482 _: ::std::marker::PhantomData<()>,
483 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
484 {
485 // (<(Integer Float)> ";") = Integer, Float, ";" => ActionFn(15);
486 let __sym2 = __pop_Variant0(__symbols);
487 let __sym1 = __pop_Variant3(__symbols);
488 let __sym0 = __pop_Variant5(__symbols);
489 let __start = __sym0.0.clone();
490 let __end = __sym2.2.clone();
491 let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2);
492 let __symbol = (__start, __Symbol::Variant1(__nt), __end);
493 (3, __symbol, 0)
494 }
495 pub(crate) fn __reduce2<
496 'input,
497 >(
498 input: &'input str,
499 __action: i8,
500 __lookahead_start: Option<&usize>,
501 __states: &mut ::std::vec::Vec<i8>,
502 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
503 _: ::std::marker::PhantomData<()>,
504 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
505 {
506 // (<(Integer Float)> ";")+ = Integer, Float, ";" => ActionFn(17);
507 let __sym2 = __pop_Variant0(__symbols);
508 let __sym1 = __pop_Variant3(__symbols);
509 let __sym0 = __pop_Variant5(__symbols);
510 let __start = __sym0.0.clone();
511 let __end = __sym2.2.clone();
512 let __nt = super::__action17::<>(input, __sym0, __sym1, __sym2);
513 let __symbol = (__start, __Symbol::Variant2(__nt), __end);
514 (3, __symbol, 1)
515 }
516 pub(crate) fn __reduce3<
517 'input,
518 >(
519 input: &'input str,
520 __action: i8,
521 __lookahead_start: Option<&usize>,
522 __states: &mut ::std::vec::Vec<i8>,
523 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
524 _: ::std::marker::PhantomData<()>,
525 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
526 {
527 // (<(Integer Float)> ";")+ = (<(Integer Float)> ";")+, Integer, Float, ";" => ActionFn(18);
528 let __sym3 = __pop_Variant0(__symbols);
529 let __sym2 = __pop_Variant3(__symbols);
530 let __sym1 = __pop_Variant5(__symbols);
531 let __sym0 = __pop_Variant2(__symbols);
532 let __start = __sym0.0.clone();
533 let __end = __sym3.2.clone();
534 let __nt = super::__action18::<>(input, __sym0, __sym1, __sym2, __sym3);
535 let __symbol = (__start, __Symbol::Variant2(__nt), __end);
536 (4, __symbol, 1)
537 }
538 pub(crate) fn __reduce4<
539 'input,
540 >(
541 input: &'input str,
542 __action: i8,
543 __lookahead_start: Option<&usize>,
544 __states: &mut ::std::vec::Vec<i8>,
545 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
546 _: ::std::marker::PhantomData<()>,
547 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
548 {
549 // (Integer Float) = Integer, Float => ActionFn(14);
550 let __sym1 = __pop_Variant3(__symbols);
551 let __sym0 = __pop_Variant5(__symbols);
552 let __start = __sym0.0.clone();
553 let __end = __sym1.2.clone();
554 let __nt = super::__action14::<>(input, __sym0, __sym1);
555 let __symbol = (__start, __Symbol::Variant1(__nt), __end);
556 (2, __symbol, 2)
557 }
558 pub(crate) fn __reduce5<
559 'input,
560 >(
561 input: &'input str,
562 __action: i8,
563 __lookahead_start: Option<&usize>,
564 __states: &mut ::std::vec::Vec<i8>,
565 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
566 _: ::std::marker::PhantomData<()>,
567 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
568 {
569 // Decibel = Float, "dB" => ActionFn(4);
570 let __sym1 = __pop_Variant0(__symbols);
571 let __sym0 = __pop_Variant3(__symbols);
572 let __start = __sym0.0.clone();
573 let __end = __sym1.2.clone();
574 let __nt = super::__action4::<>(input, __sym0, __sym1);
575 let __symbol = (__start, __Symbol::Variant3(__nt), __end);
576 (2, __symbol, 3)
577 }
578 pub(crate) fn __reduce6<
579 'input,
580 >(
581 input: &'input str,
582 __action: i8,
583 __lookahead_start: Option<&usize>,
584 __states: &mut ::std::vec::Vec<i8>,
585 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
586 _: ::std::marker::PhantomData<()>,
587 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
588 {
589 // Eq = "GraphicEQ:", (<(Integer Float)> ";")+, Integer, Float => ActionFn(16);
590 let __sym3 = __pop_Variant3(__symbols);
591 let __sym2 = __pop_Variant5(__symbols);
592 let __sym1 = __pop_Variant2(__symbols);
593 let __sym0 = __pop_Variant0(__symbols);
594 let __start = __sym0.0.clone();
595 let __end = __sym3.2.clone();
596 let __nt = super::__action16::<>(input, __sym0, __sym1, __sym2, __sym3);
597 let __symbol = (__start, __Symbol::Variant4(__nt), __end);
598 (4, __symbol, 4)
599 }
600 pub(crate) fn __reduce7<
601 'input,
602 >(
603 input: &'input str,
604 __action: i8,
605 __lookahead_start: Option<&usize>,
606 __states: &mut ::std::vec::Vec<i8>,
607 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
608 _: ::std::marker::PhantomData<()>,
609 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
610 {
611 // Float = RawFloat => ActionFn(5);
612 let __sym0 = __pop_Variant3(__symbols);
613 let __start = __sym0.0.clone();
614 let __end = __sym0.2.clone();
615 let __nt = super::__action5::<>(input, __sym0);
616 let __symbol = (__start, __Symbol::Variant3(__nt), __end);
617 (1, __symbol, 5)
618 }
619 pub(crate) fn __reduce8<
620 'input,
621 >(
622 input: &'input str,
623 __action: i8,
624 __lookahead_start: Option<&usize>,
625 __states: &mut ::std::vec::Vec<i8>,
626 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
627 _: ::std::marker::PhantomData<()>,
628 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
629 {
630 // Float = SignedInteger => ActionFn(6);
631 let __sym0 = __pop_Variant7(__symbols);
632 let __start = __sym0.0.clone();
633 let __end = __sym0.2.clone();
634 let __nt = super::__action6::<>(input, __sym0);
635 let __symbol = (__start, __Symbol::Variant3(__nt), __end);
636 (1, __symbol, 5)
637 }
638 pub(crate) fn __reduce9<
639 'input,
640 >(
641 input: &'input str,
642 __action: i8,
643 __lookahead_start: Option<&usize>,
644 __states: &mut ::std::vec::Vec<i8>,
645 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
646 _: ::std::marker::PhantomData<()>,
647 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
648 {
649 // Float = Integer => ActionFn(7);
650 let __sym0 = __pop_Variant5(__symbols);
651 let __start = __sym0.0.clone();
652 let __end = __sym0.2.clone();
653 let __nt = super::__action7::<>(input, __sym0);
654 let __symbol = (__start, __Symbol::Variant3(__nt), __end);
655 (1, __symbol, 5)
656 }
657 pub(crate) fn __reduce10<
658 'input,
659 >(
660 input: &'input str,
661 __action: i8,
662 __lookahead_start: Option<&usize>,
663 __states: &mut ::std::vec::Vec<i8>,
664 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
665 _: ::std::marker::PhantomData<()>,
666 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
667 {
668 // Integer = r#"[0-9]+"# => ActionFn(10);
669 let __sym0 = __pop_Variant0(__symbols);
670 let __start = __sym0.0.clone();
671 let __end = __sym0.2.clone();
672 let __nt = super::__action10::<>(input, __sym0);
673 let __symbol = (__start, __Symbol::Variant5(__nt), __end);
674 (1, __symbol, 6)
675 }
676 pub(crate) fn __reduce11<
677 'input,
678 >(
679 input: &'input str,
680 __action: i8,
681 __lookahead_start: Option<&usize>,
682 __states: &mut ::std::vec::Vec<i8>,
683 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
684 _: ::std::marker::PhantomData<()>,
685 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
686 {
687 // Main = Preamp, Eq => ActionFn(1);
688 let __sym1 = __pop_Variant4(__symbols);
689 let __sym0 = __pop_Variant3(__symbols);
690 let __start = __sym0.0.clone();
691 let __end = __sym1.2.clone();
692 let __nt = super::__action1::<>(input, __sym0, __sym1);
693 let __symbol = (__start, __Symbol::Variant6(__nt), __end);
694 (2, __symbol, 7)
695 }
696 pub(crate) fn __reduce12<
697 'input,
698 >(
699 input: &'input str,
700 __action: i8,
701 __lookahead_start: Option<&usize>,
702 __states: &mut ::std::vec::Vec<i8>,
703 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
704 _: ::std::marker::PhantomData<()>,
705 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
706 {
707 // Preamp = "Preamp:", Decibel => ActionFn(2);
708 let __sym1 = __pop_Variant3(__symbols);
709 let __sym0 = __pop_Variant0(__symbols);
710 let __start = __sym0.0.clone();
711 let __end = __sym1.2.clone();
712 let __nt = super::__action2::<>(input, __sym0, __sym1);
713 let __symbol = (__start, __Symbol::Variant3(__nt), __end);
714 (2, __symbol, 8)
715 }
716 pub(crate) fn __reduce13<
717 'input,
718 >(
719 input: &'input str,
720 __action: i8,
721 __lookahead_start: Option<&usize>,
722 __states: &mut ::std::vec::Vec<i8>,
723 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
724 _: ::std::marker::PhantomData<()>,
725 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
726 {
727 // RawFloat = r#"-?[0-9]*\\.[0-9]+"# => ActionFn(8);
728 let __sym0 = __pop_Variant0(__symbols);
729 let __start = __sym0.0.clone();
730 let __end = __sym0.2.clone();
731 let __nt = super::__action8::<>(input, __sym0);
732 let __symbol = (__start, __Symbol::Variant3(__nt), __end);
733 (1, __symbol, 9)
734 }
735 pub(crate) fn __reduce14<
736 'input,
737 >(
738 input: &'input str,
739 __action: i8,
740 __lookahead_start: Option<&usize>,
741 __states: &mut ::std::vec::Vec<i8>,
742 __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>,
743 _: ::std::marker::PhantomData<()>,
744 ) -> (usize, (usize,__Symbol<'input>,usize), usize)
745 {
746 // SignedInteger = r#"-[0-9]+"# => ActionFn(9);
747 let __sym0 = __pop_Variant0(__symbols);
748 let __start = __sym0.0.clone();
749 let __end = __sym0.2.clone();
750 let __nt = super::__action9::<>(input, __sym0);
751 let __symbol = (__start, __Symbol::Variant7(__nt), __end);
752 (1, __symbol, 10)
753 }
754}
755pub use self::__parse__Main::MainParser;
756#[cfg_attr(rustfmt, rustfmt_skip)]
757mod __intern_token {
758 #![allow(unused_imports)]
759 use ::Filter;
760 use std::str::FromStr;
761 #[allow(unused_extern_crates)]
762 extern crate lalrpop_util as __lalrpop_util;
763 extern crate regex as __regex;
764 use std::fmt as __fmt;
765
766 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
767 pub struct Token<'input>(pub usize, pub &'input str);
768 impl<'a> __fmt::Display for Token<'a> {
769 fn fmt(&self, formatter: &mut __fmt::Formatter) -> Result<(), __fmt::Error> {
770 __fmt::Display::fmt(self.1, formatter)
771 }
772 }
773
774 pub struct __MatcherBuilder {
775 regex_set: __regex::RegexSet,
776 regex_vec: Vec<__regex::Regex>,
777 }
778
779 impl __MatcherBuilder {
780 pub fn new() -> __MatcherBuilder {
781 let __strs: &[&str] = &[
782 "^((?u:\\-)?(?u:[0-9])*(?u:\\.)(?u:[0-9])+)",
783 "^((?u:\\-)(?u:[0-9])+)",
784 "^((?u:[0-9])+)",
785 "^((?u:;))",
786 "^((?u:GraphicEQ:))",
787 "^((?u:Preamp:))",
788 "^((?u:dB))",
789 ];
790 let __regex_set = __regex::RegexSet::new(__strs).unwrap();
791 let __regex_vec = vec![
792 __regex::Regex::new("^((?u:\\-)?(?u:[0-9])*(?u:\\.)(?u:[0-9])+)").unwrap(),
793 __regex::Regex::new("^((?u:\\-)(?u:[0-9])+)").unwrap(),
794 __regex::Regex::new("^((?u:[0-9])+)").unwrap(),
795 __regex::Regex::new("^((?u:;))").unwrap(),
796 __regex::Regex::new("^((?u:GraphicEQ:))").unwrap(),
797 __regex::Regex::new("^((?u:Preamp:))").unwrap(),
798 __regex::Regex::new("^((?u:dB))").unwrap(),
799 ];
800 __MatcherBuilder { regex_set: __regex_set, regex_vec: __regex_vec }
801 }
802 pub fn matcher<'input, 'builder>(&'builder self, s: &'input str) -> __Matcher<'input, 'builder> {
803 __Matcher {
804 text: s,
805 consumed: 0,
806 regex_set: &self.regex_set,
807 regex_vec: &self.regex_vec,
808 }
809 }
810 }
811
812 pub struct __Matcher<'input, 'builder> {
813 text: &'input str,
814 consumed: usize,
815 regex_set: &'builder __regex::RegexSet,
816 regex_vec: &'builder Vec<__regex::Regex>,
817 }
818
819 impl<'input, 'builder> Iterator for __Matcher<'input, 'builder> {
820 type Item = Result<(usize, Token<'input>, usize), __lalrpop_util::ParseError<usize,Token<'input>,&'static str>>;
821
822 fn next(&mut self) -> Option<Self::Item> {
823 let __text = self.text.trim_left();
824 let __whitespace = self.text.len() - __text.len();
825 let __start_offset = self.consumed + __whitespace;
826 if __text.is_empty() {
827 self.text = __text;
828 self.consumed = __start_offset;
829 None
830 } else {
831 let __matches = self.regex_set.matches(__text);
832 if !__matches.matched_any() {
833 Some(Err(__lalrpop_util::ParseError::InvalidToken {
834 location: __start_offset,
835 }))
836 } else {
837 let mut __longest_match = 0;
838 let mut __index = 0;
839 for __i in 0 .. 7 {
840 if __matches.matched(__i) {
841 let __match = self.regex_vec[__i].find(__text).unwrap();
842 let __len = __match.end();
843 if __len >= __longest_match {
844 __longest_match = __len;
845 __index = __i;
846 }
847 }
848 }
849 let __result = &__text[..__longest_match];
850 let __remaining = &__text[__longest_match..];
851 let __end_offset = __start_offset + __longest_match;
852 self.text = __remaining;
853 self.consumed = __end_offset;
854 Some(Ok((__start_offset, Token(__index, __result), __end_offset)))
855 }
856 }
857 }
858 }
859}
860pub use self::__intern_token::Token;
861
862#[allow(unused_variables)]
863fn __action0<
864 'input,
865>(
866 input: &'input str,
867 (_, __0, _): (usize, Filter, usize),
868) -> Filter
869{
870 (__0)
871}
872
873#[allow(unused_variables)]
874fn __action1<
875 'input,
876>(
877 input: &'input str,
878 (_, preamp, _): (usize, f64, usize),
879 (_, eq, _): (usize, (Vec<u32>, Vec<f64>), usize),
880) -> Filter
881{
882 Filter { preamp, frequencies: eq.0, coefficients: eq.1 }
883}
884
885#[allow(unused_variables)]
886fn __action2<
887 'input,
888>(
889 input: &'input str,
890 (_, _, _): (usize, &'input str, usize),
891 (_, __0, _): (usize, f64, usize),
892) -> f64
893{
894 (__0)
895}
896
897#[allow(unused_variables)]
898fn __action3<
899 'input,
900>(
901 input: &'input str,
902 (_, _, _): (usize, &'input str, usize),
903 (_, values, _): (usize, ::std::vec::Vec<(u32, f64)>, usize),
904 (_, end, _): (usize, (u32, f64), usize),
905) -> (Vec<u32>, Vec<f64>)
906{
907 {
908 let mut values = values;
909 values.push(end);
910 values.into_iter().unzip()
911 }
912}
913
914#[allow(unused_variables)]
915fn __action4<
916 'input,
917>(
918 input: &'input str,
919 (_, __0, _): (usize, f64, usize),
920 (_, _, _): (usize, &'input str, usize),
921) -> f64
922{
923 (__0)
924}
925
926#[allow(unused_variables)]
927fn __action5<
928 'input,
929>(
930 input: &'input str,
931 (_, __0, _): (usize, f64, usize),
932) -> f64
933{
934 (__0)
935}
936
937#[allow(unused_variables)]
938fn __action6<
939 'input,
940>(
941 input: &'input str,
942 (_, __0, _): (usize, i32, usize),
943) -> f64
944{
945 __0 as f64
946}
947
948#[allow(unused_variables)]
949fn __action7<
950 'input,
951>(
952 input: &'input str,
953 (_, __0, _): (usize, u32, usize),
954) -> f64
955{
956 __0 as f64
957}
958
959#[allow(unused_variables)]
960fn __action8<
961 'input,
962>(
963 input: &'input str,
964 (_, __0, _): (usize, &'input str, usize),
965) -> f64
966{
967 f64::from_str(__0).unwrap()
968}
969
970#[allow(unused_variables)]
971fn __action9<
972 'input,
973>(
974 input: &'input str,
975 (_, __0, _): (usize, &'input str, usize),
976) -> i32
977{
978 i32::from_str(__0).unwrap()
979}
980
981#[allow(unused_variables)]
982fn __action10<
983 'input,
984>(
985 input: &'input str,
986 (_, __0, _): (usize, &'input str, usize),
987) -> u32
988{
989 u32::from_str(__0).unwrap()
990}
991
992#[allow(unused_variables)]
993fn __action11<
994 'input,
995>(
996 input: &'input str,
997 (_, __0, _): (usize, (u32, f64), usize),
998) -> ::std::vec::Vec<(u32, f64)>
999{
1000 vec![__0]
1001}
1002
1003#[allow(unused_variables)]
1004fn __action12<
1005 'input,
1006>(
1007 input: &'input str,
1008 (_, v, _): (usize, ::std::vec::Vec<(u32, f64)>, usize),
1009 (_, e, _): (usize, (u32, f64), usize),
1010) -> ::std::vec::Vec<(u32, f64)>
1011{
1012 { let mut v = v; v.push(e); v }
1013}
1014
1015#[allow(unused_variables)]
1016fn __action13<
1017 'input,
1018>(
1019 input: &'input str,
1020 (_, __0, _): (usize, (u32, f64), usize),
1021 (_, _, _): (usize, &'input str, usize),
1022) -> (u32, f64)
1023{
1024 (__0)
1025}
1026
1027#[allow(unused_variables)]
1028fn __action14<
1029 'input,
1030>(
1031 input: &'input str,
1032 (_, __0, _): (usize, u32, usize),
1033 (_, __1, _): (usize, f64, usize),
1034) -> (u32, f64)
1035{
1036 (__0, __1)
1037}
1038
1039#[allow(unused_variables)]
1040fn __action15<
1041 'input,
1042>(
1043 input: &'input str,
1044 __0: (usize, u32, usize),
1045 __1: (usize, f64, usize),
1046 __2: (usize, &'input str, usize),
1047) -> (u32, f64)
1048{
1049 let __start0 = __0.0.clone();
1050 let __end0 = __1.2.clone();
1051 let __temp0 = __action14(
1052 input,
1053 __0,
1054 __1,
1055 );
1056 let __temp0 = (__start0, __temp0, __end0);
1057 __action13(
1058 input,
1059 __temp0,
1060 __2,
1061 )
1062}
1063
1064#[allow(unused_variables)]
1065fn __action16<
1066 'input,
1067>(
1068 input: &'input str,
1069 __0: (usize, &'input str, usize),
1070 __1: (usize, ::std::vec::Vec<(u32, f64)>, usize),
1071 __2: (usize, u32, usize),
1072 __3: (usize, f64, usize),
1073) -> (Vec<u32>, Vec<f64>)
1074{
1075 let __start0 = __2.0.clone();
1076 let __end0 = __3.2.clone();
1077 let __temp0 = __action14(
1078 input,
1079 __2,
1080 __3,
1081 );
1082 let __temp0 = (__start0, __temp0, __end0);
1083 __action3(
1084 input,
1085 __0,
1086 __1,
1087 __temp0,
1088 )
1089}
1090
1091#[allow(unused_variables)]
1092fn __action17<
1093 'input,
1094>(
1095 input: &'input str,
1096 __0: (usize, u32, usize),
1097 __1: (usize, f64, usize),
1098 __2: (usize, &'input str, usize),
1099) -> ::std::vec::Vec<(u32, f64)>
1100{
1101 let __start0 = __0.0.clone();
1102 let __end0 = __2.2.clone();
1103 let __temp0 = __action15(
1104 input,
1105 __0,
1106 __1,
1107 __2,
1108 );
1109 let __temp0 = (__start0, __temp0, __end0);
1110 __action11(
1111 input,
1112 __temp0,
1113 )
1114}
1115
1116#[allow(unused_variables)]
1117fn __action18<
1118 'input,
1119>(
1120 input: &'input str,
1121 __0: (usize, ::std::vec::Vec<(u32, f64)>, usize),
1122 __1: (usize, u32, usize),
1123 __2: (usize, f64, usize),
1124 __3: (usize, &'input str, usize),
1125) -> ::std::vec::Vec<(u32, f64)>
1126{
1127 let __start0 = __1.0.clone();
1128 let __end0 = __3.2.clone();
1129 let __temp0 = __action15(
1130 input,
1131 __1,
1132 __2,
1133 __3,
1134 );
1135 let __temp0 = (__start0, __temp0, __end0);
1136 __action12(
1137 input,
1138 __0,
1139 __temp0,
1140 )
1141}
1142
1143pub trait __ToTriple<'input, > {
1144 type Error;
1145 fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize),Self::Error>;
1146}
1147
1148impl<'input, > __ToTriple<'input, > for (usize, Token<'input>, usize) {
1149 type Error = &'static str;
1150 fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize),&'static str> {
1151 Ok(value)
1152 }
1153}
1154impl<'input, > __ToTriple<'input, > for Result<(usize, Token<'input>, usize),&'static str> {
1155 type Error = &'static str;
1156 fn to_triple(value: Self) -> Result<(usize,Token<'input>,usize),&'static str> {
1157 value
1158 }
1159}