 |
|
| |
|
 |
 |
at Global Oneness Community.
Share your dreams and let others help you with the interpretation!
Dream Sharing Forum
|
 |
Ambiguous grammar |  | Ambiguous grammar: Encyclopedia - Ambiguous grammar |  | | In computer science, a grammar is said to be an ambiguous grammar if there is some string that it can generate in more than one way (i.e., the string has more than one parse tree or more than one leftmost derivation). A language is inherently ambiguous if it can only be generated by ambiguous grammars.
For programming languages, ambiguous grammars can lead to difficulties for some compilers.
Ambiguous grammar - Example.
The context free grammar
A → A + A | A − A | aIncluding:
|  | | Ambiguous grammar, Ambiguous grammar - Example |  | |
|  |  | Ambiguous grammar: Encyclopedia - Ambiguous grammar
Ambiguous grammar
In computer science, a grammar is said to be an ambiguous grammar if there is some string that it can generate in more than one way (i.e., the string has more than one parse tree or more than one leftmost derivation). A language is inherently ambiguous if it can only be generated by ambiguous grammars.
For programming languages, ambiguous grammars can lead to difficulties for some compilers.
Ambiguous grammar - Example
The context free grammar
A → A + A | A − A | a
is ambiguous since there are two leftmost derivations for the string a + a − a:
Equivalently, it is ambiguous since there are two parse trees for the string a + a − a:
The language that it generates, however, is not inherently ambiguous; the following is a non-ambiguous grammar generating the same language:
A → A + a | A − a | a
 Adapted from the Wikipedia article "Ambiguous grammar", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |
|
|
More material related to Ambiguous Grammar can be found here:
|
|
« Back
|
Search the Global Oneness web site |
|
|
|
|
 |
Sneak-Peek of Global Oneness Community
Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas
Forum Home,
Articles,
Photo Gallery,
Videos,
News,
Sitemap
...and much more!
|