diff options
author | Justyna Att Ilczuk <justyna.ilczuk@gmail.com> | 2012-10-28 13:18:37 +0100 |
---|---|---|
committer | Justyna Att Ilczuk <justyna.ilczuk@gmail.com> | 2012-10-28 13:18:37 +0100 |
commit | 0121614845ddaea26f8b3532ad3156c5302f2fe2 (patch) | |
tree | 67795d9806b72c8c5dab49539b3f4a91c199b855 /sencha | |
parent | e15c8be93ac3a5913122d0d045dd0bdc6120032e (diff) | |
download | sencha-lang-0121614845ddaea26f8b3532ad3156c5302f2fe2.tar.gz sencha-lang-0121614845ddaea26f8b3532ad3156c5302f2fe2.tar.bz2 sencha-lang-0121614845ddaea26f8b3532ad3156c5302f2fe2.tar.xz sencha-lang-0121614845ddaea26f8b3532ad3156c5302f2fe2.zip |
Some small changes in tests. There's a functionality I wanted to build, but still it doesn't look good ;P.
Diffstat (limited to 'sencha')
-rw-r--r-- | sencha/Parser.cpp | 2 | ||||
-rw-r--r-- | sencha/main.cpp | 17 | ||||
-rw-r--r-- | sencha/sencha.depend | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/sencha/Parser.cpp b/sencha/Parser.cpp index 9b816c1..d19d8e3 100644 --- a/sencha/Parser.cpp +++ b/sencha/Parser.cpp @@ -33,8 +33,6 @@ bool Parser::read_next() current_token = token_stream[position_in_stream]; tok_value = current_token.get_value(); position_in_stream++; - cout << "***Reading token: ..." << endl; - cout << "Token value: " << tok_value << "***" << endl << endl; return true; } else diff --git a/sencha/main.cpp b/sencha/main.cpp index a003b9d..4be25f9 100644 --- a/sencha/main.cpp +++ b/sencha/main.cpp @@ -30,13 +30,18 @@ void test_lexer() void test_parser() { - string text_line = "def i; bulb; i + 3; string banan = \"kartofel\"; banan = \"banan\"; string kaboom(num how_many_times) { def z; }"; + vector<string> lines; + lines.push_back("def i; bulb; i + 3; string banan = \"kartofel\"; banan = \"banan\"; string kaboom(num how_many_times) { def z; }"); Lexer lexer; - vector<Token> tokens = lexer.parse_line(text_line); - Parser parser = Parser(tokens); - parser.interpret(); - cout << parser.report_message; - cout << parser.error_message; + vector<Token> tokens; + for(i=0; i<lines.size(); i++) + { + tokens = lexer.parse_line(lines[i]); + Parser parser = Parser(tokens); + parser.interpret(); + cout << parser.report_message; + cout << parser.error_message; + } }
int main()
diff --git a/sencha/sencha.depend b/sencha/sencha.depend index 1a22907..0f0e6ce 100644 --- a/sencha/sencha.depend +++ b/sencha/sencha.depend @@ -16,7 +16,7 @@ <iostream> "Token.h" -1351425833 source:/home/attero/development/sencha-lang/sencha/main.cpp +1351426109 source:/home/attero/development/sencha-lang/sencha/main.cpp <iostream> <string> "Token.h" |