Some small changes in tests. There's a functionality I wanted to build, but still it doesn't look good ;P.

devel
Justyna Att Ilczuk 2012-10-28 13:18:37 +01:00
parent e15c8be93a
commit 0121614845
3 changed files with 12 additions and 9 deletions

View File

@ -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

View File

@ -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()

View File

@ -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"