| 25 | |
| 26 | namespace { |
| 27 | TEST(ParserTest, BasicParse) { |
| 28 | ParserHarness harness; |
| 29 | { |
| 30 | auto fC = harness.parse("module top(); assign a = b; endmodule"); |
| 31 | NodeId root = fC->getRootNode(); |
| 32 | NodeId assign = fC->sl_collect(root, VObjectType::paContinuous_assign); |
| 33 | EXPECT_TRUE(assign); |
| 34 | } |
| 35 | { |
| 36 | auto fC = harness.parse("module top(); assign a = !b; endmodule"); |
| 37 | NodeId root = fC->getRootNode(); |
| 38 | NodeId assign = fC->sl_collect(root, VObjectType::paContinuous_assign); |
| 39 | /* |
| 40 | n<> u<10> t<Net_lvalue> p<17> c<7> s<16> l<1:22> el<1:23> |
| 41 | n<b> u<11> t<StringConst> p<12> l<1:27> el<1:28> |
| 42 | n<> u<12> t<Primary_literal> p<13> c<11> l<1:27> el<1:28> |
| 43 | n<> u<13> t<Primary> p<14> c<12> l<1:27> el<1:28> |
| 44 | n<> u<14> t<Expression> p<16> c<13> l<1:27> el<1:28> |
| 45 | n<> u<15> t<Unary_Not> p<16> s<14> l<1:26> el<1:27> |
| 46 | n<> u<16> t<Expression> p<17> c<15> l<1:26> el<1:28> |
| 47 | n<> u<17> t<Net_assignment> p<18> c<10> l<1:22> el<1:28> |
| 48 | n<> u<18> t<List_of_net_assignments> p<19> c<17> l<1:22> el<1:28> |
| 49 | n<> u<19> t<Continuous_assign> p<20> c<18> l<1:15> el<1:29> |
| 50 | */ |
| 51 | NodeId List_of_net_assignments = fC->Child(assign); |
| 52 | NodeId Net_assignment = fC->Child(List_of_net_assignments); |
| 53 | NodeId Net_lvalue = fC->Child(Net_assignment); |
| 54 | NodeId Expression = fC->Sibling(Net_lvalue); |
| 55 | NodeId Unary_Not = fC->Child(Expression); |
| 56 | EXPECT_EQ(fC->Type(Unary_Not), VObjectType::paUnary_Not); |
| 57 | } |
| 58 | } |
| 59 | } // namespace |
| 60 | } // namespace SURELOG |
nothing calls this directly
no test coverage detected