adding cs236
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#include <vector>
|
||||
#include "lexer/lexi.h"
|
||||
#include "lexer/util.h"
|
||||
#include "lexer/token.h"
|
||||
|
||||
const string usage = "usage: app <input> <output>";
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if(argc != 3) {
|
||||
cerr << usage << endl;
|
||||
return 1;
|
||||
}
|
||||
get_file_name(argv[1]);
|
||||
vector<string> data = open_file(argv[1]);
|
||||
lexi l;
|
||||
string temp = argv[2];
|
||||
l.lexical_analyzer(data, temp);
|
||||
cout << "getting called here in lab 1" << endl;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#include <vector>
|
||||
#include "lexer/lexi.h"
|
||||
#include "lexer/util.h"
|
||||
#include "lexer/token.h"
|
||||
#include "parser/parser.h"
|
||||
|
||||
const string usage = "usage: app <input> <output>";
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if(argc != 3) {
|
||||
cerr << usage << endl;
|
||||
return 1;
|
||||
}
|
||||
get_file_name(argv[1]);
|
||||
vector<string> data = open_file(argv[1]);
|
||||
lexi l;
|
||||
string temp = argv[2];
|
||||
vector<token> s = l.lexical_analyzer(data, temp);
|
||||
parser p;
|
||||
p.tokens = s;
|
||||
try {
|
||||
p.check_datalog();
|
||||
string out = p.out();
|
||||
write_file(out, argv[2]);
|
||||
} catch(string str) {
|
||||
stringstream s;
|
||||
s << "Failure!\n " << str;
|
||||
write_file(s.str(), argv[2]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#include <vector>
|
||||
#include "lexer/lexi.h"
|
||||
#include "lexer/util.h"
|
||||
#include "lexer/token.h"
|
||||
#include "parser/parser.h"
|
||||
#include "rdbms/db.h"
|
||||
|
||||
const string usage = "usage: app <input> <output>";
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if(argc != 3) {
|
||||
cerr << usage << endl;
|
||||
return 1;
|
||||
}
|
||||
get_file_name(argv[1]);
|
||||
vector<string> data = open_file(argv[1]);
|
||||
lexi l;
|
||||
string temp = argv[2];
|
||||
vector<token> s = l.lexical_analyzer(data, temp);
|
||||
parser p;
|
||||
p.tokens = s;
|
||||
try {
|
||||
p.check_datalog();
|
||||
string out = p.out();
|
||||
write_file(out, argv[2]);
|
||||
} catch(string str) {
|
||||
stringstream s;
|
||||
s << "Failure!\n " << str;
|
||||
write_file(s.str(), argv[2]);
|
||||
}
|
||||
db database(p);
|
||||
}
|
||||
Reference in New Issue
Block a user