{"action":"created","issue":{"url":"https://api.github.com/repos/djspiewak/gll-combinators/issues/25","labels_url":"https://api.github.com/repos/djspiewak/gll-combinators/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/djspiewak/gll-combinators/issues/25/comments","events_url":"https://api.github.com/repos/djspiewak/gll-combinators/issues/25/events","html_url":"https://github.com/djspiewak/gll-combinators/issues/25","id":60029368,"number":25,"title":"Stop on first ambiguity","user":{"login":"EECOLOR","id":1486362,"avatar_url":"https://avatars.githubusercontent.com/u/1486362?v=3","gravatar_id":"","url":"https://api.github.com/users/EECOLOR","html_url":"https://github.com/EECOLOR","followers_url":"https://api.github.com/users/EECOLOR/followers","following_url":"https://api.github.com/users/EECOLOR/following{/other_user}","gists_url":"https://api.github.com/users/EECOLOR/gists{/gist_id}","starred_url":"https://api.github.com/users/EECOLOR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EECOLOR/subscriptions","organizations_url":"https://api.github.com/users/EECOLOR/orgs","repos_url":"https://api.github.com/users/EECOLOR/repos","events_url":"https://api.github.com/users/EECOLOR/events{/privacy}","received_events_url":"https://api.github.com/users/EECOLOR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-05T22:48:31Z","updated_at":"2015-03-05T23:23:26Z","closed_at":null,"body":"Is there an option to stop on the first ambiguity?\r\n\r\nI am looking for a Scala implementation of a parser that I can use to detect if a specific grammar is ambiguous. I haven't looked at the source code of your project yet.\r\n\r\nI understand this is probably an unintended use case, how hard would it be to adjust the code to support (and possibly optimize for) this?"},"comment":{"url":"https://api.github.com/repos/djspiewak/gll-combinators/issues/comments/77474636","html_url":"https://github.com/djspiewak/gll-combinators/issues/25#issuecomment-77474636","issue_url":"https://api.github.com/repos/djspiewak/gll-combinators/issues/25","id":77474636,"user":{"login":"EECOLOR","id":1486362,"avatar_url":"https://avatars.githubusercontent.com/u/1486362?v=3","gravatar_id":"","url":"https://api.github.com/users/EECOLOR","html_url":"https://github.com/EECOLOR","followers_url":"https://api.github.com/users/EECOLOR/followers","following_url":"https://api.github.com/users/EECOLOR/following{/other_user}","gists_url":"https://api.github.com/users/EECOLOR/gists{/gist_id}","starred_url":"https://api.github.com/users/EECOLOR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EECOLOR/subscriptions","organizations_url":"https://api.github.com/users/EECOLOR/orgs","repos_url":"https://api.github.com/users/EECOLOR/repos","events_url":"https://api.github.com/users/EECOLOR/events{/privacy}","received_events_url":"https://api.github.com/users/EECOLOR/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T23:23:26Z","updated_at":"2015-03-05T23:23:26Z","body":"That sounds very reasonable. Note that I'm a total noob in this field. I am reading this paper: [Detecting Ambiguity in Programming Language\r\nGrammars](http://soft-dev.org/pubs/pdf/vasudevan_tratt__detecting_ambiguity_in_programming_language_grammars.pdf)\r\n\r\nIf you scroll down, you see that they use an `Earley parser`. From what I have gathered, your parser is capable of similar stuff.\r\n\r\nThey are using `ACCENT` to check for ambiguity. They might parse until completion (I wouldn't know, haha).\r\n\r\nIf that is the case, am I correct that using something like the following would have the same effect?\r\n\r\n``` scala\r\ndef result:Stream[Result] = ???\r\n\r\nval ambiguous = result.take(2).toList.size == 2\r\n```\r\n"}}