From 5e731c349b63a557b2e705ce3cd741f90c62c694 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sat, 1 Jan 2011 17:02:53 +0100 Subject: Replace class Parser with function parse() --- note_compiler/main.cpp | 7 +--- note_compiler/parser.cpp | 95 +++++++++++++++++++++++------------------------- note_compiler/parser.h | 26 +------------ 3 files changed, 48 insertions(+), 80 deletions(-) (limited to 'note_compiler') diff --git a/note_compiler/main.cpp b/note_compiler/main.cpp index 3d59c3b..cd83eee 100644 --- a/note_compiler/main.cpp +++ b/note_compiler/main.cpp @@ -9,13 +9,8 @@ using namespace std; int main(int argc, char** argv) { - Parser parser; - program_t p; - - parser.parse("../../velotest.prog"); + program_t p=parse("../../velotest.prog"); - p=parser.get_result(); - cout << "n_osc="< #include -#include "../synth/fixed.h" #include "programs.h" using namespace std; -class Parser -{ - public: - Parser(); - ~Parser(); - void parse(string fn); - - program_t get_result(); - - private: - void init_stuff(); - void uninit_stuff(); - static string extract_array_name(string s); - static int extract_array_index(string s, int dim); - - int n_osc; - oscillator_t *osc; - env_settings_t *env; - filter_params_t filter; - - fixed_t sync_factor; - bool sync_factor_const; -}; - +program_t parse(string fn); #endif -- cgit v1.2.3