LL(1) cannot be ambiguous

后端 未结 3 2102
栀梦
栀梦 2021-02-20 00:30

How can it be shown that no LL(1) grammar can be ambiguous?

I know what is ambiguous grammar but could not prove the above theorem/lemma.

3条回答
  •  名媛妹妹
    2021-02-20 01:19

    Prove that no ambiguous grammar can be an LL(1) grammar. For hints, see http://www.cse.ohio-state.edu/~rountev/756/pdf/SyntaxAnalysis.pdf, slides 18-20. Also see http://seclab.cs.sunysb.edu/sekar/cse304/Parse.pdf, pg. 11 and preceding.

提交回复
热议问题