Re: question
On 15 Aug 2005, at 05:20, David Ja wrote: Thank you guys very much. I noticed my mistakes as well. Forgetting to allocate memory is quite embrassing. Thank you very much again for helping me. I guess in a sense it is a pretty-printing function. The point however is not the print anything. I want to generate a bunch of strings based/ accepted on a given grammar. That is really fundamentally what I needed. As you seen I pick a random transition stepping through the grammar until I reach the end state. (pop out of the stack) If you want to generate a generate a random sentence, you need to generate a random parse tree, and for each token, a random string matching it. I do not see, though, how you intend to generate the random parse tree. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
Re: question
David Ja wrote: All I wanted to do was to take advantage of bison's parser which generates the DFA, which in turn, allows me to step through the DFA in sequence generating a sample string that fits the grammar input. Are you clear with the fact that the DFA generated by bison is not a DFA for the language generated by the grammar, but a handle-finding automaton, finding valid prefixes of right sentential forms? If generating terminal sentences for a given grammar is really what you are looking for, then you might find it easier to generate it directly from the grammar. -- Regards, Sylvain ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
Re: question
Hi, I see now. Thank you guys all very much. You have been extremely helpful. I'll tried it some more. Thanks again. Best, David On 8/15/05, Sylvain Schmitz <[EMAIL PROTECTED]> wrote: > > David Ja wrote: > > All I wanted to do was to > > take advantage of bison's parser which generates the DFA, which in turn, > > allows me to step through the DFA in sequence generating a sample string > > that fits the grammar input. > > Are you clear with the fact that the DFA generated by bison is not a DFA > for the language generated by the grammar, but a handle-finding > automaton, finding valid prefixes of right sentential forms? If > generating terminal sentences for a given grammar is really what you are > looking for, then you might find it easier to generate it directly from > the grammar. > > -- > Regards, > > Sylvain > ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison