00001
00002
00003
00004 #ifndef FITYK_RUNNER_H_
00005 #define FITYK_RUNNER_H_
00006
00007 #include <vector>
00008 #include "lexer.h"
00009 #include "eparser.h"
00010 #include "view.h"
00011
00012 class Ftk;
00013 struct Statement;
00014 struct Command;
00015 class DataAndModel;
00016
00017 RealRange args2range(const Token& t1, const Token& t2);
00018
00019 class Runner
00020 {
00021 public:
00022 Runner(Ftk* F) : F_(F), ep_(F) {}
00023
00024
00025
00026
00027
00028 void execute_statement(Statement& st);
00029
00030 private:
00031 Ftk* F_;
00032 std::vector<VMData>* vdlist_;
00033 ExpressionParser ep_;
00034
00035 void execute_command(Command& c, int ds);
00036 void command_set(const std::vector<Token>& args);
00037 void command_delete(const std::vector<Token>& args);
00038 void command_delete_points(const std::vector<Token>& args, int ds);
00039 void command_exec(TokenType tt, const std::string& str);
00040 void command_fit(const std::vector<Token>& args, int ds);
00041 void command_guess(const std::vector<Token>& args, int ds);
00042 void command_plot(const std::vector<Token>& args, int ds);
00043 void command_undefine(const std::vector<Token>& args);
00044 void command_load(const std::vector<Token>& args);
00045 void command_dataset_tr(const std::vector<Token>& args);
00046 void command_name_func(const std::vector<Token>& args, int ds);
00047 void command_all_points_tr(const std::vector<Token>& args, int ds);
00048 void command_point_tr(const std::vector<Token>& args, int ds);
00049 void command_resize_p(const std::vector<Token>& args, int ds);
00050 void command_assign_param(const std::vector<Token>& args, int ds);
00051 void command_assign_all(const std::vector<Token>& args, int ds);
00052 void command_name_var(const std::vector<Token>& args);
00053 void command_change_model(const std::vector<Token>& args, int ds);
00054 void read_dms(std::vector<Token>::const_iterator first,
00055 std::vector<Token>::const_iterator last,
00056 std::vector<DataAndModel*>& dms);
00057 void recalculate_command(Command& c, int ds, Statement& st);
00058 int make_func_from_template(const std::string& name,
00059 const std::vector<Token>& args, int pos);
00060 VMData* get_vm_from_token(const Token& t) const;
00061 };
00062
00063 #endif //FITYK_RUNNER_H_