{"action":"created","issue":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1348","repository_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1348/labels{/name}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1348/comments","events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1348/events","html_url":"https://github.com/rubberduck-vba/Rubberduck/issues/1348","id":150325865,"number":1348,"title":"Implements should allow expressions instead of mere identifiers","user":{"login":"autoboosh","id":11047288,"avatar_url":"https://avatars.githubusercontent.com/u/11047288?v=3","gravatar_id":"","url":"https://api.github.com/users/autoboosh","html_url":"https://github.com/autoboosh","followers_url":"https://api.github.com/users/autoboosh/followers","following_url":"https://api.github.com/users/autoboosh/following{/other_user}","gists_url":"https://api.github.com/users/autoboosh/gists{/gist_id}","starred_url":"https://api.github.com/users/autoboosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autoboosh/subscriptions","organizations_url":"https://api.github.com/users/autoboosh/orgs","repos_url":"https://api.github.com/users/autoboosh/repos","events_url":"https://api.github.com/users/autoboosh/events{/privacy}","received_events_url":"https://api.github.com/users/autoboosh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/vba-grammar","name":"vba-grammar","color":"DDDDDd"}],"state":"open","locked":false,"assignee":{"login":"autoboosh","id":11047288,"avatar_url":"https://avatars.githubusercontent.com/u/11047288?v=3","gravatar_id":"","url":"https://api.github.com/users/autoboosh","html_url":"https://github.com/autoboosh","followers_url":"https://api.github.com/users/autoboosh/followers","following_url":"https://api.github.com/users/autoboosh/following{/other_user}","gists_url":"https://api.github.com/users/autoboosh/gists{/gist_id}","starred_url":"https://api.github.com/users/autoboosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autoboosh/subscriptions","organizations_url":"https://api.github.com/users/autoboosh/orgs","repos_url":"https://api.github.com/users/autoboosh/repos","events_url":"https://api.github.com/users/autoboosh/events{/privacy}","received_events_url":"https://api.github.com/users/autoboosh/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/milestones/20","html_url":"https://github.com/rubberduck-vba/Rubberduck/milestones/Version%202.0","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/milestones/20/labels","id":1063094,"number":20,"title":"Version 2.0","description":"This version will include source control (GitHub) integration, WPF controls in dockable hosts, many more refactorings and inspections, and lots of bug fixes.","creator":{"login":"retailcoder","id":5751684,"avatar_url":"https://avatars.githubusercontent.com/u/5751684?v=3","gravatar_id":"","url":"https://api.github.com/users/retailcoder","html_url":"https://github.com/retailcoder","followers_url":"https://api.github.com/users/retailcoder/followers","following_url":"https://api.github.com/users/retailcoder/following{/other_user}","gists_url":"https://api.github.com/users/retailcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/retailcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retailcoder/subscriptions","organizations_url":"https://api.github.com/users/retailcoder/orgs","repos_url":"https://api.github.com/users/retailcoder/repos","events_url":"https://api.github.com/users/retailcoder/events{/privacy}","received_events_url":"https://api.github.com/users/retailcoder/received_events","type":"User","site_admin":false},"open_issues":75,"closed_issues":197,"state":"open","created_at":"2015-04-11T13:20:05Z","updated_at":"2016-04-22T09:52:05Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-04-22T09:52:04Z","updated_at":"2016-04-22T10:59:24Z","closed_at":null,"body":"This is allowed:\r\n\r\n`Implements VBAProject.ITest`\r\n\r\nBut destroys the parser.\r\n\r\n\"Correct\" parser rule:\r\n\r\n`implementsStmt : IMPLEMENTS whiteSpace valueStmt;`\r\n\r\nI'd like to take this as an opportunity to sneak in expressions per VBA spec by creating an ExpressionParser. The expression parser could parse the valueStmt and build an expression tree. We could then hand off this tree to the binder. I'd start with simple-name-expressions in this case because that's what we currently support. This way we don't have to change everything in Rubberduck to accommodate the new grammar but at the same time we get to test the expression based binder with real world code.\r\n\r\nThis could also lead to an implementation of a solution to https://github.com/rubberduck-vba/Rubberduck/issues/1340."},"comment":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/comments/213379003","html_url":"https://github.com/rubberduck-vba/Rubberduck/issues/1348#issuecomment-213379003","issue_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/1348","id":213379003,"user":{"login":"autoboosh","id":11047288,"avatar_url":"https://avatars.githubusercontent.com/u/11047288?v=3","gravatar_id":"","url":"https://api.github.com/users/autoboosh","html_url":"https://github.com/autoboosh","followers_url":"https://api.github.com/users/autoboosh/followers","following_url":"https://api.github.com/users/autoboosh/following{/other_user}","gists_url":"https://api.github.com/users/autoboosh/gists{/gist_id}","starred_url":"https://api.github.com/users/autoboosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autoboosh/subscriptions","organizations_url":"https://api.github.com/users/autoboosh/orgs","repos_url":"https://api.github.com/users/autoboosh/repos","events_url":"https://api.github.com/users/autoboosh/events{/privacy}","received_events_url":"https://api.github.com/users/autoboosh/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T10:59:24Z","updated_at":"2016-04-22T10:59:24Z","body":"There's a bit of a chaos in the grammar right now because valueStmts should actually be expressions.\r\n\r\nThe VBA spec says that the implements-directive takes a class-type-name: https://msdn.microsoft.com/en-us/library/ee177434.aspx\r\n\r\nA class-type-name in turn is defined as a defined-type-expression: https://msdn.microsoft.com/en-us/library/ee200228.aspx.\r\n\r\nA defined-type-expression is then defined as simple-name-expression (basically an \"ambiguousIdentifier\") and a member-access-expression (this is the part the valueStmt covers): https://msdn.microsoft.com/en-us/library/ee199065.aspx.\r\n\r\nSo I'd say you are correct in saying that valueStmts are not the correct solution but it's the way treat cases like this right now. E.g. the value stmt also allows midStmts and typeOfStmts which are completely out of place. It would be nice to slowly move towards expressions."}}