-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdriver.hh
More file actions
42 lines (28 loc) · 747 Bytes
/
Copy pathdriver.hh
File metadata and controls
42 lines (28 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include "scanner.h"
#include "parser.hh"
#include <map>
#include <string>
#include <fstream>
#include "Program.hpp"
class Driver {
public:
Driver();
int Parse(const std::string& filename);
void BeginScan();
void EndScan();
std::string filename_; // filename to read data from
bool trace_parsing_; // debug levels
bool trace_scanning_;
int result_; // success or failure code
friend class Scanner;
Scanner scanner_;
yy::parser parser_;
yy::location location_;
void PrintTree(const std::string& filename);
void Evaluate(const std::string& filename);
// void RunInterpreter(const std::string& filename);
ast::Program* program_;
private:
std::ifstream stream_; // stream for scanner
};