Home | History | Annotate | Download | only in Dynamic

Lines Matching defs:Sema

61 class MockSema : public Parser::Sema {
105 MockSema Sema;
106 Sema.parse("0");
107 Sema.parse("123");
108 Sema.parse("0x1f");
109 Sema.parse("12345678901");
110 Sema.parse("1a1");
111 EXPECT_EQ(5U, Sema.Values.size());
112 EXPECT_EQ(0U, Sema.Values[0].getUnsigned());
113 EXPECT_EQ(123U, Sema.Values[1].getUnsigned());
114 EXPECT_EQ(31U, Sema.Values[2].getUnsigned());
115 EXPECT_EQ("1:1: Error parsing unsigned token: <12345678901>", Sema.Errors[3]);
116 EXPECT_EQ("1:1: Error parsing unsigned token: <1a1>", Sema.Errors[4]);
120 MockSema Sema;
121 Sema.parse("\"Foo\"");
122 Sema.parse("\"\"");
123 Sema.parse("\"Baz");
124 EXPECT_EQ(3ULL, Sema.Values.size());
125 EXPECT_EQ("Foo", Sema.Values[0].getString());
126 EXPECT_EQ("", Sema.Values[1].getString());
127 EXPECT_EQ("1:1: Error parsing string token: <\"Baz>", Sema.Errors[2]);
141 MockSema Sema;
142 const uint64_t ExpectedFoo = Sema.expectMatcher("Foo");
143 const uint64_t ExpectedBar = Sema.expectMatcher("Bar");
144 const uint64_t ExpectedBaz = Sema.expectMatcher("Baz");
145 Sema.parse(" Foo ( Bar ( 17), Baz( \n \"B A,Z\") ) .bind( \"Yo!\") ");
146 for (size_t i = 0, e = Sema.Errors.size(); i != e; ++i) {
147 EXPECT_EQ("", Sema.Errors[i]);
150 EXPECT_EQ(1ULL, Sema.Values.size());
151 EXPECT_EQ(ExpectedFoo, Sema.Values[0].getMatchers().matchers()[0]->getID());
153 Sema.Values[0].getMatchers().matchers()[0])->boundID());
155 EXPECT_EQ(3ULL, Sema.Matchers.size());
156 const MockSema::MatcherInfo Bar = Sema.Matchers[0];
162 const MockSema::MatcherInfo Baz = Sema.Matchers[1];
168 const MockSema::MatcherInfo Foo = Sema.Matchers[2];