+/EE312

software design

git clone https://git.julia.blue/+/EE312

Joseph RyanAdd functions to blip5dbb718

master
550 B26 linesraw
1#include "lex.h"
2#include "parse.h"
3#include <iostream>
4
5using namespace std;
6
7void run() {
8    advance();
9    vector<Statement*> program;
10    do {
11        Statement* s = new Statement();
12        s->execute();
13        // s->debugPrint();
14        program.push_back(s);
15    } while (current.type != END);
16    for (unsigned int i = 0; i < program.size(); ++i) { delete program[i]; }
17}
18
19int main(int argc, char** argv) {
20    if (argc > 1) {
21        set_input(argv[1]);
22        run();
23    } else {
24        cout << "Error: no input files" << endl;
25    }
26}