From: <hp...@us...> - 2003-07-27 04:47:01
|
Update of /cvsroot/tora/tora In directory sc8-pr-cvs1:/tmp/cvs-serv14704 Modified Files: NEWS todebug.cpp todebug.h toinvalid.cpp tosqlparse.cpp Log Message: Index: NEWS =================================================================== RCS file: /cvsroot/tora/tora/NEWS,v retrieving revision 1.878 retrieving revision 1.879 diff -C2 -d -r1.878 -r1.879 *** NEWS 27 Jul 2003 03:09:59 -0000 1.878 --- NEWS 27 Jul 2003 04:46:56 -0000 1.879 *************** *** 1,4 **** --- 1,7 ---- 1.3.11: + 2003-07-26: Added parameter name parsing in debugger. + 2003-07-26: Fixed problem parsing non packages in debugger. + 2003-07-26: Added variable names parsing in debugger again. 2003-07-26: Don't signal error in debugger on userbreak. 2003-07-26: Fixed problem in debugger in windows. Index: todebug.cpp =================================================================== RCS file: /cvsroot/tora/tora/todebug.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** todebug.cpp 27 Jul 2003 03:09:59 -0000 1.108 --- todebug.cpp 27 Jul 2003 04:46:56 -0000 1.109 *************** *** 823,839 **** char *Description; bool WantName; ! } TypeMap[] = { { "FUNCTION", "Function", true}, // Must be first in list ! { "PROCEDURE", "Procedure", true}, ! { "PACKAGE", "Package", true}, ! { "TYPE", "Type", true}, ! { "CURSOR", "Cursor", true}, ! { "IF", "Conditional",false}, ! { "LOOP", "Loop", false}, ! { "WHILE", "Loop", false}, ! { "FOR", "Loop", false}, ! { NULL, NULL, false} }; ! static bool FindKeyword(toSQLParse::statement &statements,bool onlyNames,int &line,QString &name) { if (statements.Type==toSQLParse::statement::Keyword|| --- 823,841 ---- char *Description; bool WantName; ! bool Declaration; ! } TypeMap[] = { { "FUNCTION", "Function", true ,true }, // Must be first in list ! { "PROCEDURE", "Procedure", true ,true }, ! { "PACKAGE", "Package", true ,true }, ! { "DECLARE", "Anonymous", false,true }, ! { "TYPE", "Type", true ,false}, ! { "CURSOR", "Cursor", true ,false}, ! { "IF", "Conditional",false,false}, ! { "LOOP", "Loop", false,false}, ! { "WHILE", "Loop", false,false}, ! { "FOR", "Loop", false,false}, ! { NULL, NULL, false,false} }; ! static bool FindKeyword(toSQLParse::statement &statements,bool onlyNames,bool &declaration,int &line,QString &name) { if (statements.Type==toSQLParse::statement::Keyword|| *************** *** 851,854 **** --- 853,858 ---- name="Anonymous"; + declaration=TypeMap[j].Declaration; + if (onlyNames&&!TypeMap[j].WantName) { name=QString::null; *************** *** 863,867 **** } for(std::list<toSQLParse::statement>::iterator i=statements.subTokens().begin();i!=statements.subTokens().end();i++) { ! bool ret=FindKeyword(*i,onlyNames,line,name); if (ret) return ret; --- 867,871 ---- } for(std::list<toSQLParse::statement>::iterator i=statements.subTokens().begin();i!=statements.subTokens().end();i++) { ! bool ret=FindKeyword(*i,onlyNames,declaration,line,name); if (ret) return ret; *************** *** 870,889 **** } ! void toDebug::updateContent(toSQLParse::statement &statements,QListViewItem *parent) { QListViewItem *item=NULL; int line; QString name; ! if (!FindKeyword(statements,statements.Type==toSQLParse::statement::Statement,line,name)||name.isNull()) return; ! item=new toContentsItem(parent,name,line); std::list<toSQLParse::statement>::iterator i=statements.subTokens().begin(); ! if (i!=statements.subTokens().end()) ! i++; while(i!=statements.subTokens().end()) { ! if ((*i).Type==toSQLParse::statement::Block||(*i).Type==toSQLParse::statement::Statement) updateContent(*i,item); i++; } --- 874,931 ---- } ! void toDebug::updateArguments(toSQLParse::statement &statements,QListViewItem *parent) ! { ! for(std::list<toSQLParse::statement>::iterator i=statements.subTokens().begin();i!=statements.subTokens().end();i++) { ! if ((*i).Type==toSQLParse::statement::List) { ! bool first=true; ! for(std::list<toSQLParse::statement>::iterator j=(*i).subTokens().begin();j!=(*i).subTokens().end();j++) { ! if ((*j).String==",") ! first=true; ! else if (first) { ! new toContentsItem(parent,"Parameter "+(*j).String,(*j).Line); ! first=false; ! } ! } ! } ! } ! } ! ! void toDebug::updateContent(toSQLParse::statement &statements,QListViewItem *parent,bool createnew) { QListViewItem *item=NULL; int line; QString name; ! bool declaration; ! if (!FindKeyword(statements,statements.Type==toSQLParse::statement::Statement,declaration,line,name)||name.isNull()) return; ! if (createnew) ! item=new toContentsItem(parent,name,line); ! else ! item=parent; std::list<toSQLParse::statement>::iterator i=statements.subTokens().begin(); ! if (statements.Type==toSQLParse::statement::Block) { ! if (i!=statements.subTokens().end()) { ! updateArguments(*i,item); ! i++; ! } ! } else { ! updateArguments(statements,item); ! if (i!=statements.subTokens().end()) ! i++; ! } while(i!=statements.subTokens().end()) { ! if ((*i).Type==toSQLParse::statement::Block||(*i).Type==toSQLParse::statement::Statement) { ! if (declaration) { ! std::list<toSQLParse::statement>::iterator j=(*i).subTokens().begin(); ! if (j!=(*i).subTokens().end()) ! if ((*j).String.upper()=="BEGIN") ! declaration=false; ! else if ((*j).Type==toSQLParse::statement::Token&&(*j).String.upper()!="END") ! new toContentsItem(item,"Variable "+(*j).String,(*j).Line); ! } updateContent(*i,item); + } i++; } *************** *** 892,896 **** void toDebug::updateContent(bool body) { ! toHighlightedText *current; QString topName; if (body) { --- 934,938 ---- void toDebug::updateContent(bool body) { ! toDebugText *current; QString topName; if (body) { *************** *** 919,931 **** parent->setOpen(true); ! for(std::list<toSQLParse::statement>::iterator i=statements.begin();i!=statements.end();i++) { ! std::list<toSQLParse::statement>::iterator j=(*i).subTokens().begin(); ! if (j!=(*i).subTokens().end()) ! j++; ! while(j!=(*i).subTokens().end()) { ! updateContent(*j,parent); ! j++; ! } ! } if (!parent->firstChild()) --- 961,966 ---- parent->setOpen(true); ! for(std::list<toSQLParse::statement>::iterator i=statements.begin();i!=statements.end();i++) ! updateContent(*i,parent,false); if (!parent->firstChild()) *************** *** 1641,1647 **** sizes[1]=200; splitter->setSizes(sizes); - splitter->setResizeMode(DebugTabs,QSplitter::KeepSize); } #endif QSplitter *objSplitter=new QSplitter(Vertical,hsplitter); --- 1676,1682 ---- sizes[1]=200; splitter->setSizes(sizes); } #endif + splitter->setResizeMode(DebugTabs,QSplitter::KeepSize); QSplitter *objSplitter=new QSplitter(Vertical,hsplitter); Index: todebug.h =================================================================== RCS file: /cvsroot/tora/tora/todebug.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** todebug.h 22 Jul 2003 13:50:18 -0000 1.32 --- todebug.h 27 Jul 2003 04:46:56 -0000 1.33 *************** *** 170,174 **** void readLog(void); void updateState(int reason); ! void updateContent(toSQLParse::statement &statements,QListViewItem *parent); void updateContent(bool body); void reorderContent(QListViewItem *item,int,int); --- 170,175 ---- void readLog(void); void updateState(int reason); ! void updateArguments(toSQLParse::statement &statements,QListViewItem *parent); ! void updateContent(toSQLParse::statement &statements,QListViewItem *parent,bool createnew=true); void updateContent(bool body); void reorderContent(QListViewItem *item,int,int); Index: toinvalid.cpp =================================================================== RCS file: /cvsroot/tora/tora/toinvalid.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** toinvalid.cpp 24 Jul 2003 14:20:48 -0000 1.21 --- toinvalid.cpp 27 Jul 2003 04:46:56 -0000 1.22 *************** *** 137,140 **** --- 137,141 ---- connect(Source,SIGNAL(executed()),this,SLOT(refresh())); + #if 0 { QValueList<int> sizes=splitter->sizes(); *************** *** 143,146 **** --- 144,148 ---- splitter->setResizeMode(Objects,QSplitter::KeepSize); } + #endif ToolMenu=NULL; Index: tosqlparse.cpp =================================================================== RCS file: /cvsroot/tora/tora/tosqlparse.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** tosqlparse.cpp 25 Jul 2003 00:20:57 -0000 1.42 --- tosqlparse.cpp 27 Jul 2003 04:46:56 -0000 1.43 *************** *** 89,92 **** --- 89,112 ---- int main(int,char **) { QString res="\n" + "PACKAGE oasSIMActivation AS\n" + " FUNCTION ParseCommand(Command VARCHAR2,inICC VARCHAR2,Param VARCHAR2) RETURN VARCHAR2;\n" + "\n" + " PROCEDURE InsertActions(inCommandType VARCHAR2,\n" + " Sim oasSIM%ROWTYPE,\n" + " inParam VARCHAR2);\n" + "\n" + " PROCEDURE InsertActions(CommandType VARCHAR2,\n" + " inICC VARCHAR2,\n" + " inParam VARCHAR2);\n" + "\n" + " PROCEDURE InsertActions(inCommandType VARCHAR2,\n" + " Service oasService%ROWTYPE);\n" + "\n" + " PROCEDURE InsertActions(CommandType VARCHAR2,\n" + " inCustomerID NUMBER,\n" + " inSubID NUMBER,\n" + " inServiceType VARCHAR2,\n" + " Param VARCHAR2);\n" + "END;\n" "DECLARE\n" "grade CHAR(1);\n" |