Created
May 18, 2018 10:24
-
-
Save megamen32/44039127b5ec54d19e7357b5b725fd4e to your computer and use it in GitHub Desktop.
123
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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