12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include <iostream>
- #include "File.h"
- #include "Tokenizer.h"
- #include "Exception.h"
- using namespace std;
- int main(int argc, char** argv)
- {
- File f("tests/if.snuvi");
- if(f.exists())
- {
- Tokenizer t(f.read());
- ArrayList<Token*> tokens;
- try
- {
- t.tokenize(tokens);
- }
- catch(Exception ex)
- {
- ex.print();
- }
-
- tokens.forEach([](Token* t)
- {
- cout << *t << endl;
- });
-
- tokens.forEach([](Token* t)
- {
- delete t;
- });
- tokens.clear();
- }
- else
- {
- cout << "no" << endl;
- }
- return 0;
- }
|