Generate sentences from cf grammar. Fix list initialization from copy constructor

This commit is contained in:
IlushaShurupov 2023-08-11 16:04:02 +03:00
parent d888aeb2b4
commit 6fcfa075f8
4 changed files with 84 additions and 4 deletions

View file

@ -23,7 +23,11 @@ void run(const String& source) {
printf("Grammar accepted.\n");
printf("Example text formed from grammar : TODO\n");
List<CfGrammar::Sentence> sentences;
grammar.generateSentences(sentences);
printf("Example sentences formed from grammar: \n");
for (auto sentence : sentences) tp::CfGrammar::printSentence(sentence.data());
CfGrammar::deinitializeCfGrammarParser(state);
}