Mercurial > hg > Members > nobuyasu > SampleSource
comparison Bison-Flex/CALC/discrete-parser/EUC/calc-driver.h @ 0:db40c85cad7a default tip
upload sample source
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 09 May 2011 03:11:59 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:db40c85cad7a |
---|---|
1 #ifndef __CALC_DRIVER_H__ | |
2 #define __CALC_DRIVER_H__ | |
3 | |
4 #include <string> | |
5 #include <map> | |
6 #include "node.h" | |
7 | |
8 class calc_driver { | |
9 public: | |
10 calc_driver(); | |
11 virtual ~calc_driver(); | |
12 | |
13 bool calc(const std::string &f); | |
14 | |
15 int value(const std::string *name) | |
16 { | |
17 return values[*name]; | |
18 } | |
19 void assign(const std::string &value, cnode *node); | |
20 void print(cnode *node); | |
21 void list(); | |
22 | |
23 // Error handling. | |
24 void error(const std::string& m); | |
25 | |
26 private: | |
27 std::map<std::string, int> values; // 変数テーブル | |
28 } ; | |
29 | |
30 #endif |