@@ -31,7 +31,7 @@ TEST(parser, ParsingTable1) {
3131 auto firsts = utils::CalcFirsts (grammar, nullables);
3232 auto follows = utils::CalcFollows (grammar, firsts, nullables, " S" );
3333
34- std::vector<std::string> terminals = {" a" , " b" , " c" , " d" , " $ " };
34+ std::vector<std::string> terminals = {" a" , " b" , " c" , " d" };
3535 std::vector<std::string> non_terminals = {" A" , " S" , " B" };
3636
3737 ParsingTable table = ParsingTable (terminals, non_terminals);
@@ -90,7 +90,7 @@ TEST(parser, ParsingTable2) {
9090 auto firsts = utils::CalcFirsts (grammar, nullables);
9191 auto follows = utils::CalcFollows (grammar, firsts, nullables, " S" );
9292
93- std::vector<std::string> terminals = {" a" , " b" , " c" , " $ " };
93+ std::vector<std::string> terminals = {" a" , " b" , " c" };
9494 std::vector<std::string> non_terminals = {" C" , " S" , " B" };
9595
9696 ParsingTable table = ParsingTable (terminals, non_terminals);
@@ -112,15 +112,15 @@ TEST(parser, ParsingTable2) {
112112 ASSERT_EQ (p.first , 2 );
113113 ASSERT_EQ (p.second , 0 );
114114
115- p = table.GetEntry (" S" , " $ " );
115+ p = table.GetEntry (" S" , utils::STRING_ENDMARKER );
116116 ASSERT_EQ (p.first , 0 );
117117 ASSERT_EQ (p.second , 1 );
118118
119- p = table.GetEntry (" B" , " $ " );
119+ p = table.GetEntry (" B" , utils::STRING_ENDMARKER );
120120 ASSERT_EQ (p.first , 1 );
121121 ASSERT_EQ (p.second , 1 );
122122
123- p = table.GetEntry (" C" , " $ " );
123+ p = table.GetEntry (" C" , utils::STRING_ENDMARKER );
124124 ASSERT_EQ (p.first , 2 );
125125 ASSERT_EQ (p.second , 1 );
126126}
@@ -149,7 +149,7 @@ TEST(parser, ParsingTable3) {
149149 auto firsts = utils::CalcFirsts (grammar, nullables);
150150 auto follows = utils::CalcFollows (grammar, firsts, nullables, " S" );
151151
152- std::vector<std::string> terminals = {" a" , " b" , " c" , " $ " };
152+ std::vector<std::string> terminals = {" a" , " b" , " c" };
153153 std::vector<std::string> non_terminals = {" C" , " S" , " B" };
154154
155155 ParsingTable table = ParsingTable (terminals, non_terminals);
@@ -171,15 +171,15 @@ TEST(parser, ParsingTable3) {
171171 ASSERT_EQ (p.first , 2 );
172172 ASSERT_EQ (p.second , 0 );
173173
174- p = table.GetEntry (" S" , " $ " );
174+ p = table.GetEntry (" S" , utils::STRING_ENDMARKER );
175175 ASSERT_EQ (p.first , 0 );
176176 ASSERT_EQ (p.second , 1 );
177177
178- p = table.GetEntry (" B" , " $ " );
178+ p = table.GetEntry (" B" , utils::STRING_ENDMARKER );
179179 ASSERT_EQ (p.first , 1 );
180180 ASSERT_EQ (p.second , 1 );
181181
182- p = table.GetEntry (" C" , " $ " );
182+ p = table.GetEntry (" C" , utils::STRING_ENDMARKER );
183183 ASSERT_EQ (p.first , 2 );
184184 ASSERT_EQ (p.second , 1 );
185185}
@@ -208,7 +208,7 @@ TEST(parser, ParsingTable4) {
208208 auto firsts = utils::CalcFirsts (grammar, nullables);
209209 auto follows = utils::CalcFollows (grammar, firsts, nullables, " S" );
210210
211- std::vector<std::string> terminals = {" a" , " b" , " $ " };
211+ std::vector<std::string> terminals = {" a" , " b" };
212212 std::vector<std::string> non_terminals = {" A" , " S" , " B" };
213213
214214 ParsingTable table = ParsingTable (terminals, non_terminals);
@@ -234,19 +234,19 @@ TEST(parser, ParsingTable4) {
234234 ASSERT_EQ (p.first , 2 );
235235 ASSERT_EQ (p.second , 0 );
236236
237- p = table.GetEntry (" S" , " $ " );
237+ p = table.GetEntry (" S" , utils::STRING_ENDMARKER );
238238 ASSERT_EQ (p.first , 0 );
239239 ASSERT_EQ (p.second , 0 );
240240
241- p = table.GetEntry (" A" , " $ " );
241+ p = table.GetEntry (" A" , utils::STRING_ENDMARKER );
242242 ASSERT_EQ (p.first , 1 );
243243 ASSERT_EQ (p.second , 1 );
244244
245245 p = table.GetEntry (" A" , " b" );
246246 ASSERT_EQ (p.first , 1 );
247247 ASSERT_EQ (p.second , 1 );
248248
249- p = table.GetEntry (" B" , " $ " );
249+ p = table.GetEntry (" B" , utils::STRING_ENDMARKER );
250250 ASSERT_EQ (p.first , 2 );
251251 ASSERT_EQ (p.second , 1 );
252252}
0 commit comments