• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

programming language


Commit MetaInfo

Révision3712d467a9f05c0587450b39188c49ccd8f10b88 (tree)
l'heure2023-02-22 23:41:24
Auteurdhrname <dhrname@joes...>
Commiterdhrname

Message de Log

Modify the MetaPhrase class

Change Summary

Modification

Binary files a/bin/obj/main.o and b/bin/obj/main.o differ
--- a/include/phrase.hpp
+++ b/include/phrase.hpp
@@ -1240,11 +1240,13 @@ namespace jstr
12401240 class MetaPhrase: public Phrase
12411241 {
12421242 private:
1243- std::unordered_set<int64_t> firstSet;
1244- std::unordered_set<int64_t> followSet;
1243+ std::unordered_set<int32_t> firstSet;
1244+ std::unordered_set<int32_t> followSet;
12451245
12461246 public:
12471247 MetaPhrase()
1248+ : firstSet{},
1249+ followSet{}
12481250 {}
12491251
12501252 virtual ~MetaPhrase()
@@ -1255,11 +1257,11 @@ namespace jstr
12551257
12561258 /*getFirstSet メンバ関数
12571259 * BNF定義を元にFIRST集合を求める*/
1258- void getFirstSet();
1260+ virtual std::unordered_set<int32_t>& getFirstSet();
12591261
12601262 /*getFollowSet メンバ関数
12611263 * BNF定義を元にFOLLOW集合を求める*/
1262- void getFollowSet();
1264+ virtual std::unordered_set<int32_t>& getFollowSet();
12631265 };
12641266
12651267 /*Arrow クラス
--- a/main.cpp
+++ b/main.cpp
@@ -425,7 +425,13 @@ int main(int argc, char **argv)
425425 EXPECT(metaphr->nameSpace, "");
426426 metaphr->setSemanticValue("wpe");
427427 EXPECT(metaphr->value, "wpe");
428+ EXPECT(metaphr->getFirstSet().empty(), true);
429+ EXPECT(metaphr->getFollowSet().empty(), true);
430+ metaphr->setTokenId((int32_t)jstr::parser::nonterminal::modules_statement);
431+ std::unordered_set<int32_t> firstset = metaphr->getFirstSet();
432+ EXPECT(firstset.contains((int32_t)jstr::parser::token::CLASS), true);
428433 delete metaphr;
434+
429435 jstr::Arrow* arrowphr = new jstr::Arrow("a");
430436 EXPECT(arrowphr->getId(), "a");
431437 EXPECT(arrowphr->getDomain(), "#empty");