Changeset 609
- Timestamp:
- 07/22/08 16:13:24 (4 months ago)
- Files:
-
- trunk/rphp/compiler/parser/php.g (modified) (2 diffs)
- trunk/rphp/compiler/parser/rphp_ast.h (modified) (1 diff)
- trunk/rphp/compiler/parser/rphp_parser.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/rphp/compiler/parser/php.g
r607 r609 26 26 #include <string> 27 27 #include <iostream> 28 #include <sstream> 29 30 // I hope this makes life easier 31 #define str(stdstring) std::string(stdstring) 28 32 29 33 namespace rphp … … 781 785 void parser::yy_expected_symbol(int kind, const char* name) 782 786 { 783 #ifdef PEDNING_THOMAS784 // TODO pending785 786 787 rint64 line; 787 788 rint64 col; 788 789 rint64 index = token_stream->index()-1; 789 790 token_type &token = token_stream->token(index); 790 kDebug()<< "token starts at:" << token.begin;791 kDebug()<< "index is:" << index;792 token_stream->startPosition(index, &line, &col);791 std::cout << "token starts at:" << token.begin; 792 std::cout << "index is:" << index; 793 // token_stream->start_position(index, &line, &col); 793 794 UnicodeString tokenValue = tokenText(token.begin, token.end); 795 796 std::stringstream msg; 797 msg << "Expected symbol " 798 << name 799 << " (current token: \"" 800 // + ( token.kind != 0 ? tokenValue : \"EOF\" ) 801 + token.kind 802 << " at line: " 803 << line 804 << " col: " 805 << col; 806 807 // reportProblem( parser::Error, msg.str() ); 808 809 #ifdef PENDING_THOMAS // can be removed 794 810 reportProblem( parser::Error, 795 // TODO port me 796 // QString("Expected symbol \"%1\" (current token: \"%2\" [%3] at line: %4 col: %5)") 811 QString("Expected symbol \"%1\" (current token: \"%2\" [%3] at line: %4 col: %5)") 797 812 .arg(name) 798 813 .arg(token.kind != 0 ? tokenValue : "EOF") trunk/rphp/compiler/parser/rphp_ast.h
r607 r609 12 12 #include <string> 13 13 #include <iostream> 14 #include <sstream> 15 16 // I hope this makes life easier 17 #define str(stdstring) std::string(stdstring) 14 18 15 19 namespace rphp trunk/rphp/compiler/parser/rphp_parser.cpp
r607 r609 72 72 void parser::yy_expected_symbol(int kind, const char* name) 73 73 { 74 #ifdef PEDNING_THOMAS75 // TODO pending76 77 74 rint64 line; 78 75 rint64 col; 79 76 rint64 index = token_stream->index() - 1; 80 77 token_type &token = token_stream->token(index); 81 kDebug()<< "token starts at:" << token.begin;82 kDebug()<< "index is:" << index;83 token_stream->startPosition(index, &line,&col);78 std::cout << "token starts at:" << token.begin; 79 std::cout << "index is:" << index; 80 // token_stream->start_position(index, &line, &col); 84 81 UnicodeString tokenValue = tokenText(token.begin, token.end); 82 83 std::stringstream msg; 84 msg << "Expected symbol " 85 << name 86 << " (current token: \"" 87 // + ( token.kind != 0 ? tokenValue : \"EOF\" ) 88 + token.kind 89 << " at line: " 90 << line 91 << " col: " 92 << col; 93 94 // reportProblem( parser::Error, msg.str() ); 95 96 #ifdef PENDING_THOMAS 97 85 98 reportProblem( parser::Error, 86 99 // TODO port me
