Context-sensitivity vs Ambiguity

后端 未结 3 1692
悲哀的现实
悲哀的现实 2021-02-19 01:14

I\'m confused about how context-sensitivity and ambiguity influence each other.

What i think is correct is:

Ambiguity:

An ambiguous grammar leads to the

3条回答
  •  我在风中等你
    2021-02-19 01:47

    Context-sensitivity and ambiguity are entirely orthogonal. There exist ambiguous context-free languages and unambiguous context-sensitive languages.

    A context-sensitive language is a formal language that can be parsed by a context-sensitive grammar (CSG). Every context-free language is also a context-sensitive language since context-free grammars are simplified context-sensitive languages. Not every formal language is context-sensitive though; there are languages that even a CSG cannot describe.

提交回复
热议问题