summaryrefslogtreecommitdiff
path: root/synth/parser.h
blob: 192226ea885a4ab6162155c71a5bbdf0c07e5952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __PARSER_H__
#define __PARSET_H__


#include <set>
#include <map>
#include <list>
#include <string>

#include "fixed.h"
#include "programs.h"

using namespace std;

class Parser
{
	public:
		Parser();
		~Parser();
		void parse(string fn);
		program_t get_results() const;
		
	private:
		void init_stuff();
		void uninit_stuff();
		static string extract_array_name(string s);
		static list<string> extract_terms(string s);
		static list<string> extract_factors(string s); 
		static list<term_t> extract_formula(string s);
		static param_factor_t parse_pfactor(string s);
		static int extract_array_index(string s, int dim);
		
		int n_osc;
		oscillator_t *osc;
		env_settings_t *env;
		set<parameter_t> affect[128];
		map< parameter_t, list<term_t> > formula;
		int controller_default[128];
		filter_params_t filter;
		
		pfactor_formula_t pfactor;
		
		fixed_t sync_factor;
};


#endif