Contains the source code from the course work throughout my undergraduate Computer Engineering degree at Brigham Young University. There is a mixture of Go, Python, C, C++, Java, VHDL, Verilog, Matlab, Bash, Assembly, etc..
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lab03.cpp 781B

1234567891011121314151617181920212223242526272829303132
  1. #include <vector>
  2. #include "lexer/lexi.h"
  3. #include "lexer/util.h"
  4. #include "lexer/token.h"
  5. #include "parser/parser.h"
  6. #include "rdbms/db.h"
  7. const string usage = "usage: app <input> <output>";
  8. int main(int argc, char* argv[]) {
  9. if(argc != 3) {
  10. cerr << usage << endl;
  11. return 1;
  12. }
  13. get_file_name(argv[1]);
  14. vector<string> data = open_file(argv[1]);
  15. lexi l;
  16. string temp = argv[2];
  17. vector<token> s = l.lexical_analyzer(data, temp);
  18. parser p;
  19. p.tokens = s;
  20. try {
  21. p.check_datalog();
  22. string out = p.out();
  23. write_file(out, argv[2]);
  24. } catch(string str) {
  25. stringstream s;
  26. s << "Failure!\n " << str;
  27. write_file(s.str(), argv[2]);
  28. }
  29. db database(p);
  30. }