ambiguous grammar

ambiguous grammar A context-free grammar that derives the same word by different derivation trees, or equivalently by different derivation sequences. A familiar programming language example is:

S → if C then S else S

S → if C then S

where S and C stand for statement and condition. This grammar is ambiguous since the following compound statement

if c1 then if c2 then s2 else s1

has two interpretations, corresponding with two derivation trees, as shown in the diagram. See also inherently ambiguous language.

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

JOHN DAINTITH. "ambiguous grammar." A Dictionary of Computing. 2004. Encyclopedia.com. 10 Feb. 2012 <http://www.encyclopedia.com>.

JOHN DAINTITH. "ambiguous grammar." A Dictionary of Computing. 2004. Encyclopedia.com. (February 10, 2012). http://www.encyclopedia.com/doc/1O11-ambiguousgrammar.html

JOHN DAINTITH. "ambiguous grammar." A Dictionary of Computing. 2004. Retrieved February 10, 2012 from Encyclopedia.com: http://www.encyclopedia.com/doc/1O11-ambiguousgrammar.html

Learn more about citation styles

Find thousands of answers for hundreds of subjects at Answers Encyclopedia .

All answers verified by trusted sources at Encyclopedia.com

Try Answers Encyclopedia now!

For students and teachers!

Encyclopedia.com provides students and teachers facts, information, and biographies from verified, citable sources, including:

Encyclopedia.com provides students and teachers facts, information, and biographies from verified, citable sources, including: