OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "src/vm/assembler.h" | 7 #include "src/vm/assembler.h" |
8 #include "src/vm/generator.h" | 8 #include "src/vm/generator.h" |
9 | 9 |
10 namespace fletch { | 10 namespace dartino { |
11 | 11 |
12 Generator* Generator::first_ = NULL; | 12 Generator* Generator::first_ = NULL; |
13 Generator* Generator::current_ = NULL; | 13 Generator* Generator::current_ = NULL; |
14 | 14 |
15 Generator::Generator(Function* function, const char* name) | 15 Generator::Generator(Function* function, const char* name) |
16 : next_(NULL), function_(function), name_(name) { | 16 : next_(NULL), function_(function), name_(name) { |
17 if (first_ == NULL) { | 17 if (first_ == NULL) { |
18 first_ = this; | 18 first_ = this; |
19 } else { | 19 } else { |
20 current_->next_ = this; | 20 current_->next_ = this; |
(...skipping 22 matching lines...) Expand all Loading... |
43 if (freopen(argv[1], "w", stdout) == NULL) { | 43 if (freopen(argv[1], "w", stdout) == NULL) { |
44 fprintf(stderr, "%s: Cannot open '%s' for writing.\n", argv[0], argv[1]); | 44 fprintf(stderr, "%s: Cannot open '%s' for writing.\n", argv[0], argv[1]); |
45 exit(1); | 45 exit(1); |
46 } | 46 } |
47 | 47 |
48 Assembler assembler; | 48 Assembler assembler; |
49 Generator::GenerateAll(&assembler); | 49 Generator::GenerateAll(&assembler); |
50 return 0; | 50 return 0; |
51 } | 51 } |
52 | 52 |
53 } // namespace fletch | 53 } // namespace dartino |
54 | 54 |
55 // Forward main calls to fletch::Main. | 55 // Forward main calls to dartino::Main. |
56 int main(int argc, char** argv) { return fletch::Main(argc, argv); } | 56 int main(int argc, char** argv) { return dartino::Main(argc, argv); } |
OLD | NEW |