bool mx_mul::UpdateDbTask::isNickNameExisits() { bool ret = false; try { std::auto_ptr<mxsql::SqlConnection> connection( datasource_->getConnection()); { std::string sql = "select `nickname` from `base_user_info` where `user_id` = ?"; std::auto_ptr<mxsql::SqlPreparedStatement> stmt( connection->preparedStatement(sql)); stmt->setInt(1, userId_); std::auto_ptr<mxsql::SqlResultSet> rs(stmt->executeQuery()); if (rs->next()) { nickname_ = rs->getString(1); } else { return false; } } { std::string sql1 = "select `user_id` from `base_user_info` where `nickname` = ?"; std::auto_ptr<mxsql::SqlPreparedStatement> stmt1( connection->preparedStatement(sql1)); stmt1->setString(1, nickname_); std::auto_ptr<mxsql::SqlResultSet> rs1(stmt1->executeQuery()); while (rs1->next()) { if (userId_ != rs1->getInt(1)) { ret = true; break; } } } } catch (mxsql::SqlException & e) { printf(">>ERROR %d %s\n", e.getErrorCode(), e.getMessage().c_str()); } return ret; }
// Returns a vector of ItemAdjusts. bool QuasarDB::select(vector<ItemAdjust>& adjusts, const ItemAdjustSelect& select) { adjusts.clear(); QString cmd = gltxCmd("item_adjust", "item_adjust_id", "reason_id,account_id", select); Stmt stmt(_connection, cmd); if (!execute(stmt)) return false; while (stmt.next()) { ItemAdjust adjustment; int next = 1; selectData(adjustment, stmt, next); selectGltx(adjustment, stmt, next); adjustment.setReasonId(stmtGetId(stmt, next++)); adjustment.setAccountId(stmtGetId(stmt, next++)); adjusts.push_back(adjustment); } QString cmd1 = "select item_id,account_id,number,description," "size_name,size_qty,quantity,inv_cost,sale_price," "ext_deposit,voided from gltx_item where gltx_id = ? " "order by seq_num"; Stmt stmt1(_connection, cmd1); for (unsigned int i = 0; i < adjusts.size(); ++i) { Id gltx_id = adjusts[i].id(); GLTX_ACCOUNTS(adjusts); stmtSetId(stmt1, gltx_id); if (!execute(stmt1)) return false; while (stmt1.next()) { ItemLine line; int next = 1; line.item_id = stmtGetId(stmt1, next++); line.account_id = stmtGetId(stmt1, next++); line.number = stmtGetString(stmt1, next++); line.description = stmtGetString(stmt1, next++); line.size = stmtGetString(stmt1, next++); line.size_qty = stmtGetFixed(stmt1, next++); line.quantity = stmtGetFixed(stmt1, next++); line.inv_cost = stmtGetFixed(stmt1, next++); line.sale_price = stmtGetFixed(stmt1, next++); line.ext_deposit = stmtGetFixed(stmt1, next++); line.voided = stmtGetBool(stmt1, next++); adjusts[i].items().push_back(line); } } commit(); return true; }
// method to test the checking of stmt table to see if it contains the specified nodetype void StatementTest::testIfContainsStmt(){ TNode stmt1("assign","a = y", 1,0); TNode stmt2("while","b", 2,0); TNode stmt3("assign","b = z", 3,0); StatementTable s; s.insertStatement(&stmt1); s.insertStatement(&stmt2); s.insertStatement(&stmt3); CPPUNIT_ASSERT(s.containsStatement("assign")); CPPUNIT_ASSERT(s.containsStatement("while")); CPPUNIT_ASSERT(!(s.containsStatement("if"))); return; }
void StatementTest::testGetStmtNumUsingNodeType(){ TNode stmt1("assign","a = y", 1,0); TNode stmt2("while","b", 2,0); TNode stmt3("assign","b = z", 3,0); StatementTable s; s.insertStatement(&stmt1); s.insertStatement(&stmt2); s.insertStatement(&stmt3); vector<int> stmt = s.getStmtNumUsingNodeType("assign"); CPPUNIT_ASSERT_EQUAL(1,stmt[0]); CPPUNIT_ASSERT_EQUAL(3,stmt[1]); return; }
// method to test insertion of procedures void StatementTest::testInsert(){ //inserting non duplicates procedures TNode stmt1("assign","a = y", 1,0); TNode stmt2("while","b", 2,0); TNode stmt3("assign","b = z", 3,0); StatementTable s; s.insertStatement(&stmt1); CPPUNIT_ASSERT_EQUAL(1,s.getSize()); s.insertStatement(&stmt2); CPPUNIT_ASSERT_EQUAL(2,s.getSize()); s.insertStatement(&stmt3); CPPUNIT_ASSERT_EQUAL(3,s.getSize()); CPPUNIT_ASSERT(s.getTNode(1)->getData() == "a = y"); CPPUNIT_ASSERT(s.getTNode(1)->getNodeType() == "assign"); CPPUNIT_ASSERT_EQUAL(1, s.getTNode(1)->getStmtNum()); CPPUNIT_ASSERT_EQUAL(0, s.getTNode(1)->getProcIndex()); return; }
// Returns a vector of Splits. bool QuasarDB::select(vector<Split>& splits, const SplitSelect& conditions) { splits.clear(); QString cmd = gltxCmd("split", "split_id", "account_id," "split.amount,transfer_id", conditions); Statement stmt(connection(), cmd); if (!execute(stmt)) return false; while (stmt.next()) { Split split; int next = 1; selectData(split, stmt, next); selectGltx(split, stmt, next); split.setAccountId(stmtGetId(stmt, next++)); split.setAmount(stmtGetFixed(stmt, next++)); split.setTransferAccount(stmtGetId(stmt, next++)); splits.push_back(split); } QString cmd1 = "select store_id,amount from split_alloc where " "split_id = ? order by seq_num"; Statement stmt1(connection(), cmd1); for (unsigned int i = 0; i < splits.size(); ++i) { Id gltx_id = splits[i].id(); GLTX_ACCOUNTS(splits); stmtSetId(stmt1, gltx_id); if (!execute(stmt1)) return false; while (stmt1.next()) { AllocLine line; line.store_id = stmtGetId(stmt1, 1); line.amount = stmtGetFixed(stmt1, 2); splits[i].allocations().push_back(line); } } commit(); return true; }
TEST_F(AuxiliaryVariablesOptimizerTests, DoNotOptimizeWhenRhsIsGlobalVariable) { // Add a body to the testing function: // // global a // // a = 1 (AssignStmt) // b = a (VarDefStmt) // return b // ShPtr<Variable> varA(Variable::create("a", IntType::create(16))); module->addGlobalVar(varA); ShPtr<Variable> varB(Variable::create("b", IntType::create(16))); ShPtr<ConstInt> constInt1(ConstInt::create(llvm::APInt(16, 1))); ShPtr<ReturnStmt> returnB(ReturnStmt::create(varB)); ShPtr<VarDefStmt> varDefB( VarDefStmt::create(varB, varA, returnB)); ShPtr<AssignStmt> assignA1( AssignStmt::create(varA, constInt1, varDefB)); testFunc->setBody(assignA1); INSTANTIATE_ALIAS_ANALYSIS_AND_VALUE_ANALYSIS(module); // Optimize the module. Optimizer::optimize<AuxiliaryVariablesOptimizer>(module, va, OptimCallInfoObtainer::create()); // Check that the output is correct. // a = 1 ShPtr<Statement> stmt1(testFunc->getBody()); ASSERT_EQ(assignA1, stmt1) << "expected `" << assignA1 << "`, got `" << stmt1 << "`"; // b = a ShPtr<Statement> stmt2(stmt1->getSuccessor()); ASSERT_EQ(varDefB, stmt2) << "expected `" << varDefB << "`, got `" << stmt2 << "`"; // return b ShPtr<Statement> stmt3(stmt2->getSuccessor()); ASSERT_EQ(returnB, stmt3) << "expected `" << returnB << "`, got `" << stmt3 << "`"; }
TEST_F(AuxiliaryVariablesOptimizerTests, DoNotOptimizeWhenAuxiliaryVariableIsExternal) { // Add a body to the testing function: // // a = 1 (VarDefStmt) // b = a (VarDefStmt, where 'b' is an 'external' variable comming from a // volatile load/store, see #1146) // return b // ShPtr<Variable> varA(Variable::create("a", IntType::create(16))); ShPtr<Variable> varB(Variable::create("b", IntType::create(16))); varB->markAsExternal(); ShPtr<ConstInt> constInt1(ConstInt::create(llvm::APInt(16, 1))); ShPtr<ReturnStmt> returnB(ReturnStmt::create(varB)); ShPtr<VarDefStmt> varDefB( VarDefStmt::create(varB, varA, returnB)); ShPtr<VarDefStmt> varDefA( VarDefStmt::create(varA, constInt1, varDefB)); testFunc->setBody(varDefA); INSTANTIATE_ALIAS_ANALYSIS_AND_VALUE_ANALYSIS(module); // Optimize the module. Optimizer::optimize<AuxiliaryVariablesOptimizer>(module, va, OptimCallInfoObtainer::create()); // Check that the output is correct. // a = 1 ShPtr<Statement> stmt1(testFunc->getBody()); ASSERT_EQ(varDefA, stmt1) << "expected `" << varDefA << "`, got `" << stmt1 << "`"; // b = a ShPtr<Statement> stmt2(stmt1->getSuccessor()); ASSERT_EQ(varDefB, stmt2) << "expected `" << varDefB << "`, got `" << stmt2 << "`"; // return b ShPtr<Statement> stmt3(stmt2->getSuccessor()); ASSERT_EQ(returnB, stmt3) << "expected `" << returnB << "`, got `" << stmt3 << "`"; }
bool QuasarDB::sqlCreateLines(const ItemAdjust& adjustment) { QString cmd1 = insertText("gltx_item", "gltx_id", "seq_num,item_id," "account_id,number,description,size_name," "size_qty,quantity,inv_cost,sale_price," "ext_deposit,voided"); Stmt stmt1(_connection, cmd1); for (unsigned int i = 0; i < adjustment.items().size(); ++i) { const ItemLine& line = adjustment.items()[i]; stmtSetId(stmt1, adjustment.id()); stmtSetInt(stmt1, i); stmtSetId(stmt1, line.item_id); stmtSetId(stmt1, line.account_id); stmtSetString(stmt1, line.number); stmtSetString(stmt1, line.description); stmtSetString(stmt1, line.size); stmtSetFixed(stmt1, line.size_qty); stmtSetFixed(stmt1, line.quantity); stmtSetFixed(stmt1, line.inv_cost); stmtSetFixed(stmt1, line.sale_price); stmtSetFixed(stmt1, line.ext_deposit); stmtSetBool(stmt1, line.voided); if (!execute(stmt1)) return false; if (line.item_id == INVALID_ID) continue; if (!adjustment.isActive()) continue; if (line.voided) continue; itemAdjustment(line.item_id, line.size, adjustment.storeId(), adjustment.postDate(), line.quantity * line.size_qty, line.inv_cost); } return true; }
// method to test getting nodes / stmt num using node type void StatementTest::testGetNodesMatchingNodeType (){ TNode stmt1("assign","a = y", 1,0); TNode stmt2("while","b", 2,0); TNode stmt3("assign","b = z", 3,0); StatementTable s; s.insertStatement(&stmt1); s.insertStatement(&stmt2); s.insertStatement(&stmt3); vector<TNode *> nodes = s.getNodesMatchingNodeType("assign"); CPPUNIT_ASSERT(nodes[0]->getData() == "a = y"); CPPUNIT_ASSERT_EQUAL(1,nodes[0]->getStmtNum()); CPPUNIT_ASSERT(nodes[0]->getNodeType() == "assign"); CPPUNIT_ASSERT(nodes[1]->getData() == "b = z"); CPPUNIT_ASSERT_EQUAL(3,nodes[1]->getStmtNum()); CPPUNIT_ASSERT(nodes[1]->getNodeType() == "assign"); vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); CPPUNIT_ASSERT(v.size() == s.getAllStmtNum().size()); return; }
// Returns a vector of Slips. bool QuasarDB::select(vector<Slip>& slips, const SlipSelect& conditions) { slips.clear(); QString cmd = selectCmd("slip", "slip_id", "vendor_id,number," "waybill,carrier,ship_date,store_id," "inv_num,num_pieces,status,post_date", conditions, "slip_id"); Stmt stmt(_connection, cmd); if (!execute(stmt)) return false; while (stmt.next()) { Slip slip; int next = 1; selectData(slip, stmt, next); slip.setVendorId(stmtGetId(stmt, next++)); slip.setNumber(stmtGetString(stmt, next++)); slip.setWaybill(stmtGetString(stmt, next++)); slip.setCarrier(stmtGetString(stmt, next++)); slip.setShipDate(stmtGetDate(stmt, next++)); slip.setStoreId(stmtGetId(stmt, next++)); slip.setInvoiceNumber(stmtGetString(stmt, next++)); slip.setNumPieces(stmtGetInt(stmt, next++)); slip.setStatus(stmtGetString(stmt, next++)); slip.setPostDate(stmtGetDate(stmt, next++)); slips.push_back(slip); } QString cmd1 = "select item_id,number,size_name,size_qty,quantity," "ext_cost from slip_item where slip_id = ? order by seq_num"; Stmt stmt1(_connection, cmd1); QString cmd2 = "select order_number from slip_orders where " "slip_id = ? order by seq_num"; Stmt stmt2(_connection, cmd2); for (unsigned int i = 0; i < slips.size(); ++i) { Id slip_id = slips[i].id(); stmtSetId(stmt1, slip_id); if (!execute(stmt1)) return false; while (stmt1.next()) { SlipItem line; int next = 1; line.item_id = stmtGetId(stmt1, next++); line.number = stmtGetString(stmt1, next++); line.size = stmtGetString(stmt1, next++); line.size_qty = stmtGetFixed(stmt1, next++); line.quantity = stmtGetFixed(stmt1, next++); line.ext_cost = stmtGetFixed(stmt1, next++); slips[i].items().push_back(line); } stmtSetId(stmt2, slip_id); if (!execute(stmt2)) return false; while (stmt2.next()) { slips[i].orders().push_back(stmtGetString(stmt2, 1)); } } commit(); return true; }
void QueryEvaluatorTest::testQE() { /** SIMPLE source code procedure First{ x = 2; // 1 z = 3; // 2 call Second;} // 3 procedure Second{ x = 0; // 4 i = 5; // 5 while i { // 6 x = x + 2 * y // 7 if m then { // 8 m = n;} // 9 else { n = Second;} // 10 call Third; // 11 i = i - 1;} // 12 if x then { // 13 x = x + 1; // 14 while m { // 15 m = m - 1;}} // 16 else { z = 1;} // 17 z = z + x + i; // 18 y = z + 2; // 19 x = x * y + z;} // 20 procedure Third{ z = 5; // 21 v = z;} // 22 **/ pk = new PKBController(); synonymTable = map<string, string>(); TNode stmt1("ASSIGN_NODE", "x = 2", 1, 0); TNode stmt2("ASSIGN_NODE", "z = 3", 2, 0); TNode stmt3("CALL_NODE", "Second", 3, 0); TNode stmt4("ASSIGN_NODE", "x = 0", 4, 1); TNode stmt5("ASSIGN_NODE", "i = 5", 5, 1); TNode stmt6("WHILE_NODE", "i", 6, 1); TNode stmt7("ASSIGN_NODE", "x = x + 2 * y", 7, 1); TNode stmt8("IF_NODE", "m", 8, 1); TNode stmt9("ASSIGN_NODE", "m = n", 9, 1); TNode stmt10("ASSIGN_NODE", "n = Second", 10, 1); TNode stmt11("CALL_NODE", "Third", 11, 1); TNode stmt12("ASSIGN_NODE", "i = i - 1", 12, 1); TNode stmt13("IF_NODE", "x", 13, 1); TNode stmt14("ASSIGN_NODE", "x = x + 1", 14, 1); TNode stmt15("WHILE_NODE", "m", 15, 1); TNode stmt16("ASSIGN_NODE", "m = m - 1", 16, 1); TNode stmt17("ASSIGN_NODE", "z = 1", 17, 1); TNode stmt18("ASSIGN_NODE", "z = z + x + i", 18, 1); TNode stmt19("ASSIGN_NODE", "y = z + 2", 19, 1); TNode stmt20("ASSIGN_NODE", "x = x * y + z", 20, 1); TNode stmt21("ASSIGN_NODE", "z = 5", 21, 2); TNode stmt22("ASSIGN_NODE", "v = z", 22, 2); pk->statementTable->insertStatement(&stmt1); pk->statementTable->insertStatement(&stmt2); pk->statementTable->insertStatement(&stmt3); pk->statementTable->insertStatement(&stmt4); pk->statementTable->insertStatement(&stmt5); pk->statementTable->insertStatement(&stmt6); pk->statementTable->insertStatement(&stmt7); pk->statementTable->insertStatement(&stmt8); pk->statementTable->insertStatement(&stmt9); pk->statementTable->insertStatement(&stmt10); pk->statementTable->insertStatement(&stmt11); pk->statementTable->insertStatement(&stmt12); pk->statementTable->insertStatement(&stmt13); pk->statementTable->insertStatement(&stmt14); pk->statementTable->insertStatement(&stmt15); pk->statementTable->insertStatement(&stmt16); pk->statementTable->insertStatement(&stmt17); pk->statementTable->insertStatement(&stmt18); pk->statementTable->insertStatement(&stmt19); pk->statementTable->insertStatement(&stmt20); pk->statementTable->insertStatement(&stmt21); pk->statementTable->insertStatement(&stmt22); pk->procTable->insertProc("First"); // 0 pk->procTable->insertProc("Second"); // 1 pk->procTable->insertProc("Third"); // 2 pk->varTable->insertVar("x"); // 0 pk->varTable->insertVar("z"); // 1 pk->varTable->insertVar("i"); // 2 pk->varTable->insertVar("y"); // 3 pk->varTable->insertVar("m"); // 4 pk->varTable->insertVar("n"); // 5 pk->varTable->insertVar("Second"); // 6 pk->varTable->insertVar("v"); // 7 pk->constantTable->insertConst(2); pk->constantTable->insertConst(3); pk->constantTable->insertConst(0); pk->constantTable->insertConst(5); pk->constantTable->insertConst(1); pk->followsTable->insertFollows(1, 2); pk->followsTable->insertFollows(2, 3); pk->followsTable->insertFollows(4, 5); pk->followsTable->insertFollows(5, 6); pk->followsTable->insertFollows(6, 13); pk->followsTable->insertFollows(13, 18); pk->followsTable->insertFollows(18, 19); pk->followsTable->insertFollows(19, 20); pk->followsTable->insertFollows(21, 22); pk->followsTable->insertFollows(7, 8); pk->followsTable->insertFollows(8, 11); pk->followsTable->insertFollows(11, 12); pk->followsTable->insertFollows(14, 15); pk->parentTable->insertParent(6, 7); pk->parentTable->insertParent(6, 8); pk->parentTable->insertParent(6, 11); pk->parentTable->insertParent(6, 12); pk->parentTable->insertParent(8, 9); pk->parentTable->insertParent(8, 10); pk->parentTable->insertParent(13, 14); pk->parentTable->insertParent(13, 15); pk->parentTable->insertParent(13, 17); pk->parentTable->insertParent(15, 16); pk->callsTable->insertCalls(0, 1); pk->callsTable->insertCalls(1, 2); pk->modifiesTable->insertModifiesProc(0, 0); pk->modifiesTable->insertModifiesProc(0, 1); pk->modifiesTable->insertModifiesProc(0, 2); pk->modifiesTable->insertModifiesProc(0, 3); pk->modifiesTable->insertModifiesProc(0, 4); pk->modifiesTable->insertModifiesProc(0, 5); pk->modifiesTable->insertModifiesProc(0, 7); pk->modifiesTable->insertModifiesProc(1, 0); pk->modifiesTable->insertModifiesProc(1, 1); pk->modifiesTable->insertModifiesProc(1, 2); pk->modifiesTable->insertModifiesProc(1, 3); pk->modifiesTable->insertModifiesProc(1, 4); pk->modifiesTable->insertModifiesProc(1, 5); pk->modifiesTable->insertModifiesProc(1, 7); pk->modifiesTable->insertModifiesProc(2, 1); pk->modifiesTable->insertModifiesProc(2, 7); pk->modifiesTable->insertModifiesStmt(1, 0); pk->modifiesTable->insertModifiesStmt(2, 1); pk->modifiesTable->insertModifiesStmt(3, 0); pk->modifiesTable->insertModifiesStmt(3, 2); pk->modifiesTable->insertModifiesStmt(3, 4); pk->modifiesTable->insertModifiesStmt(3, 5); pk->modifiesTable->insertModifiesStmt(3, 1); pk->modifiesTable->insertModifiesStmt(3, 3); pk->modifiesTable->insertModifiesStmt(3, 7); pk->modifiesTable->insertModifiesStmt(4, 0); pk->modifiesTable->insertModifiesStmt(5, 2); pk->modifiesTable->insertModifiesStmt(6, 0); pk->modifiesTable->insertModifiesStmt(6, 4); pk->modifiesTable->insertModifiesStmt(6, 5); pk->modifiesTable->insertModifiesStmt(6, 1); pk->modifiesTable->insertModifiesStmt(6, 7); pk->modifiesTable->insertModifiesStmt(6, 2); pk->modifiesTable->insertModifiesStmt(7, 0); pk->modifiesTable->insertModifiesStmt(8, 4); pk->modifiesTable->insertModifiesStmt(8, 5); pk->modifiesTable->insertModifiesStmt(9, 4); pk->modifiesTable->insertModifiesStmt(10, 5); pk->modifiesTable->insertModifiesStmt(11, 1); pk->modifiesTable->insertModifiesStmt(11, 7); pk->modifiesTable->insertModifiesStmt(12, 2); pk->modifiesTable->insertModifiesStmt(13, 0); pk->modifiesTable->insertModifiesStmt(13, 4); pk->modifiesTable->insertModifiesStmt(13, 1); pk->modifiesTable->insertModifiesStmt(14, 0); pk->modifiesTable->insertModifiesStmt(15, 4); pk->modifiesTable->insertModifiesStmt(16, 4); pk->modifiesTable->insertModifiesStmt(17, 1); pk->modifiesTable->insertModifiesStmt(18, 1); pk->modifiesTable->insertModifiesStmt(19, 3); pk->modifiesTable->insertModifiesStmt(20, 0); pk->modifiesTable->insertModifiesStmt(21, 1); pk->modifiesTable->insertModifiesStmt(22, 7); pk->usesTable->insertUsesProc(0, 0); pk->usesTable->insertUsesProc(0, 1); pk->usesTable->insertUsesProc(0, 2); pk->usesTable->insertUsesProc(0, 3); pk->usesTable->insertUsesProc(0, 4); pk->usesTable->insertUsesProc(0, 5); pk->usesTable->insertUsesProc(0, 6); pk->usesTable->insertUsesProc(1, 0); pk->usesTable->insertUsesProc(1, 1); pk->usesTable->insertUsesProc(1, 2); pk->usesTable->insertUsesProc(1, 3); pk->usesTable->insertUsesProc(1, 4); pk->usesTable->insertUsesProc(1, 5); pk->usesTable->insertUsesProc(1, 6); pk->usesTable->insertUsesProc(2, 1); pk->usesTable->insertUsesStmt(3, 0); pk->usesTable->insertUsesStmt(3, 1); pk->usesTable->insertUsesStmt(3, 2); pk->usesTable->insertUsesStmt(3, 3); pk->usesTable->insertUsesStmt(3, 4); pk->usesTable->insertUsesStmt(3, 5); pk->usesTable->insertUsesStmt(3, 6); pk->usesTable->insertUsesStmt(6, 2); pk->usesTable->insertUsesStmt(6, 0); pk->usesTable->insertUsesStmt(6, 3); pk->usesTable->insertUsesStmt(6, 4); pk->usesTable->insertUsesStmt(6, 5); pk->usesTable->insertUsesStmt(6, 6); pk->usesTable->insertUsesStmt(6, 1); pk->usesTable->insertUsesStmt(7, 0); pk->usesTable->insertUsesStmt(7, 3); pk->usesTable->insertUsesStmt(8, 4); pk->usesTable->insertUsesStmt(8, 5); pk->usesTable->insertUsesStmt(8, 6); pk->usesTable->insertUsesStmt(9, 5); pk->usesTable->insertUsesStmt(10, 6); pk->usesTable->insertUsesStmt(11, 1); pk->usesTable->insertUsesStmt(12, 2); pk->usesTable->insertUsesStmt(13, 0); pk->usesTable->insertUsesStmt(13, 4); pk->usesTable->insertUsesStmt(14, 0); pk->usesTable->insertUsesStmt(15, 4); pk->usesTable->insertUsesStmt(16, 4); pk->usesTable->insertUsesStmt(18, 1); pk->usesTable->insertUsesStmt(18, 0); pk->usesTable->insertUsesStmt(18, 2); pk->usesTable->insertUsesStmt(19, 1); pk->usesTable->insertUsesStmt(20, 0); pk->usesTable->insertUsesStmt(20, 1); pk->usesTable->insertUsesStmt(20, 3); pk->usesTable->insertUsesStmt(22, 1); pk->constructCalls(); pk->constructFollows(); pk->constructModifies(); pk->constructParent(); // pk->constructNext(); pk->constructUses(); synonymTable["s1"]="stmt"; synonymTable["s2"]="stmt"; synonymTable["a1"]="assign"; synonymTable["a2"]="assign"; synonymTable["w1"]="while"; synonymTable["w2"]="while"; synonymTable["i1"]="if"; synonymTable["i2"]="if"; synonymTable["v1"]="variable"; synonymTable["v2"]="variable"; synonymTable["proc1"]="procedure"; synonymTable["proc2"]="procedure"; synonymTable["c1"]="call"; synonymTable["c2"]="call"; synonymTable["l1"]="prog_line"; synonymTable["l2"]="prog_line"; synonymTable["const1"]="constant"; synonymTable["const2"]="constant"; testInsert(); testValidate(); testConvertString(); }