Mercurial > hg > Members > nobuyasu > SampleSource
annotate Bison-Flex/BasicCompiler-StackBase/EUC/script.cpp @ 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 |
rev | line source |
---|---|
0 | 1 #include <iostream> |
2 #include "compiler.h" | |
3 #include "vm.h" | |
4 | |
5 int main(int argc, char *argv[]) | |
6 { | |
7 for (++argv; argv[0]; ++argv) { | |
8 vm::data data; | |
9 bool compile_result; | |
10 { | |
11 compiler driver; | |
12 compile_result = driver.compile(*argv, data); | |
13 #ifdef _DEBUG | |
14 if (compile_result) | |
15 driver.debug_dump(); | |
16 #endif | |
17 } | |
18 if (compile_result) { | |
19 vm::vcpu machine(data); | |
20 int result = machine.run(); | |
21 std::cout << "result = " << result << std::endl; | |
22 } | |
23 } | |
24 return 0; | |
25 } |