[YG Conlang Archives] > [engelang group] > messages [Date Index] [Thread Index] >
On Fri, Sep 28, 2012 at 9:37 PM, Mike S. <maikxlx@gmail.com> wrote: > >> >> >> >> >> >> formula := CCA | term formula | foretree formula | formula >> >> >> aftertree >> >> >> aftertree := HI | term aftertree | JA aftertree aftertree >> >> >> foretree := HE | term foretree | JA foretree foretree >> >> >> term := NA | LA formula | JA formula >> >> I do want to keep the formal grammar unambiguous though, so it will >> need to be considerably more complex if we want to keep he/hi. > > I am not sure what you have in mind, This: http://en.wikipedia.org/wiki/Formal_grammar "Any particular sequence of production rules on the start symbol yields a distinct string in the language. If there are multiple ways of generating the same single string, the grammar is said to be ambiguous." How we may deal with that ambiguity is a different matter, but that grammar is ambiguous by that definition. > Terms in front of formulas and aftertrees would have to be cleared before > anything else can happen, so I *think* that terms in front of foretrees are > the only rub. I assume that you have something in mind to somehow enforce > that precedence in the formal grammar? Do you know of a reason why we can't > just specify a precedence rule? Ignoring aftertrees for now, I think this *might* remove the foretree ambiguity: formula := core-formula | closed-foretree-formula | open-foretree formula closed-foretree-formula := closed-foretree formula | term closed-foretree-formula foretree := open-foretree | closed-foretree closed-foretree := JA foretree foretree open-foretree := HE | term open-foretree core-formula := CCA | term core-formula term := NA | LA formula | JA formula Assuming that's unambiguous (and that it generates everything we want it to generate), we now need to add HI in such a way that it doesn't create ambiguities with parentheticals. co ma'a xrxe