Skip to content

Instantly share code, notes, and snippets.

@megamen32
Created May 18, 2018 10:24
Show Gist options
  • Select an option

  • Save megamen32/44039127b5ec54d19e7357b5b725fd4e to your computer and use it in GitHub Desktop.

Select an option

Save megamen32/44039127b5ec54d19e7357b5b725fd4e to your computer and use it in GitHub Desktop.
123
#include <iostream>
#include <stack>
#include <sstream>
#include "err.hpp"
#include "lexeme.hpp"
#include "syntax.hpp"
using namespace std;
int main()
{
try {
LexemeChain lexAnalyse;
auto list = {"i i i i", "s=s","i=i"
};
stringstream is;
std::for_each(list.begin(), list.end(), [&](auto it) { is << it << "\n"; });
std::cin.rdbuf(is.rdbuf());
for(auto it:lexAnalyse){
cout<<it.getChain()<<endl;
}
cout<<std::endl;
//Parser SyntaxAnalyse(lexAnalyse);
//SyntaxAnalyse.S();
} catch (const ErrorStruct &err) {
std::cerr << err << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment