You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- 1$\begingroup$ Thanks for 1st point. Was unaware of it. But are your 1,2,3 points answers to corresponding 1,2,3 points in my question? If yes, I am unable to get how. Specifically, I want confirmation for this: All FIRST-FOLLOW conflict, FIRST-FIRST conflict and left recursion contribute to non determinism. None of them directly contributes to ambiguity. $\endgroup$RajS– RajS2019-06-16 12:52:17 +00:00Commented Jun 16, 2019 at 12:52
- 1$\begingroup$ @anir: No. Non-determinism leads to parsing conflicts. Parsing conflicts are a symptom, not a cause, but they are not always a symptom of non-determinism, much less ambiguity. And there is no procedure which can reliably "remove conflicts". You are misreading your sources, probably because you insist on your own incorrect mental model. There are some techniques which you might be able to use to debug grammars, but nothing guarantees that they will work with every grammar. $\endgroup$rici– rici2019-06-16 15:48:09 +00:00Commented Jun 16, 2019 at 15:48
- 1$\begingroup$ It is correct to say that "non-determinism manifests as conflicts". I don't know why you feel so uncomfortable with that statement. A parsing conflict is not a feature of a grammar. Non-determinism is. $\endgroup$rici– rici2019-06-16 15:55:48 +00:00Commented Jun 16, 2019 at 15:55
- 1$\begingroup$ @anir: you're right; that was a mistake. If a CFG is deterministic then there is some $k$ for which an $LR(k)$ parser exists. The problem is that there is no way to find such a $k$ other than trying all of them. So if we run the LR algorithm with some value of $k$ and find a conflict, we don't know that the grammar is non-deterministic. It might be that we just need a larger $k$. $\endgroup$rici– rici2019-06-16 19:52:03 +00:00Commented Jun 16, 2019 at 19:52
- 1$\begingroup$ In that sense, the conflict is produced by the parsing table construction algorithm. A conflict produced in the construction of an LR(1) parse table might or might not be present in the construction of an LALR(3) table. (Just as an example.) Non-determinism, on the other hand, is a feature of the grammar (but not a computable feature). $\endgroup$rici– rici2019-06-16 19:57:39 +00:00Commented Jun 16, 2019 at 19:57
| Show 10 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
- MathJax equations
$\sin^2 \theta$
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. complexity-theory), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you