{"action":"created","issue":{"url":"https://api.github.com/repos/antlr/intellij-plugin-v4/issues/230","labels_url":"https://api.github.com/repos/antlr/intellij-plugin-v4/issues/230/labels{/name}","comments_url":"https://api.github.com/repos/antlr/intellij-plugin-v4/issues/230/comments","events_url":"https://api.github.com/repos/antlr/intellij-plugin-v4/issues/230/events","html_url":"https://github.com/antlr/intellij-plugin-v4/issues/230","id":115374457,"number":230,"title":"Refactoring: Dup rule and make unique reference","user":{"login":"parrt","id":178777,"avatar_url":"https://avatars.githubusercontent.com/u/178777?v=3","gravatar_id":"","url":"https://api.github.com/users/parrt","html_url":"https://github.com/parrt","followers_url":"https://api.github.com/users/parrt/followers","following_url":"https://api.github.com/users/parrt/following{/other_user}","gists_url":"https://api.github.com/users/parrt/gists{/gist_id}","starred_url":"https://api.github.com/users/parrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parrt/subscriptions","organizations_url":"https://api.github.com/users/parrt/orgs","repos_url":"https://api.github.com/users/parrt/repos","events_url":"https://api.github.com/users/parrt/events{/privacy}","received_events_url":"https://api.github.com/users/parrt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/antlr/intellij-plugin-v4/labels/comp:grammar-editor","name":"comp:grammar-editor","color":"d4c5f9"},{"url":"https://api.github.com/repos/antlr/intellij-plugin-v4/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-05T21:06:03Z","updated_at":"2015-11-08T18:08:41Z","closed_at":null,"body":" This is helpful when trying to do away with full LL decisions. It allows different contexts. The following grammar is LL(2) but not SLL(2):\r\n\r\n```\r\ns : X a X\r\n  | Y a Y X\r\n  ;\r\na : Y | ; // called from two different contexts\r\n```\r\n\r\nInput `YX` predicts both alt 1 and alt 2 of rule `a`.\r\n\r\nIn order to make this SLL(2), we can simply duplicate rule `a` for one of the references:\r\n\r\n```\r\ns : X a X\r\n  | Y a1 Y X\r\n  ;\r\na : Y | ;\r\na1 : Y | ;   // only called from a single context (2nd alternative of s)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/antlr/intellij-plugin-v4/issues/comments/154854672","html_url":"https://github.com/antlr/intellij-plugin-v4/issues/230#issuecomment-154854672","issue_url":"https://api.github.com/repos/antlr/intellij-plugin-v4/issues/230","id":154854672,"user":{"login":"parrt","id":178777,"avatar_url":"https://avatars.githubusercontent.com/u/178777?v=3","gravatar_id":"","url":"https://api.github.com/users/parrt","html_url":"https://github.com/parrt","followers_url":"https://api.github.com/users/parrt/followers","following_url":"https://api.github.com/users/parrt/following{/other_user}","gists_url":"https://api.github.com/users/parrt/gists{/gist_id}","starred_url":"https://api.github.com/users/parrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parrt/subscriptions","organizations_url":"https://api.github.com/users/parrt/orgs","repos_url":"https://api.github.com/users/parrt/repos","events_url":"https://api.github.com/users/parrt/events{/privacy}","received_events_url":"https://api.github.com/users/parrt/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T18:08:41Z","updated_at":"2015-11-08T18:08:41Z","body":"Make it dup all refs; people can strip unneeded ones after isolating LL decision issue."}}