{"action":"created","issue":{"url":"https://api.github.com/repos/SophieKoonin/JavaDecaf/issues/16","labels_url":"https://api.github.com/repos/SophieKoonin/JavaDecaf/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/SophieKoonin/JavaDecaf/issues/16/comments","events_url":"https://api.github.com/repos/SophieKoonin/JavaDecaf/issues/16/events","html_url":"https://github.com/SophieKoonin/JavaDecaf/issues/16","id":111679727,"number":16,"title":"Invalid operators are ignored by Java Decaf instead of producing an error","user":{"login":"sergutsan","id":1441098,"avatar_url":"https://avatars.githubusercontent.com/u/1441098?v=3","gravatar_id":"","url":"https://api.github.com/users/sergutsan","html_url":"https://github.com/sergutsan","followers_url":"https://api.github.com/users/sergutsan/followers","following_url":"https://api.github.com/users/sergutsan/following{/other_user}","gists_url":"https://api.github.com/users/sergutsan/gists{/gist_id}","starred_url":"https://api.github.com/users/sergutsan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergutsan/subscriptions","organizations_url":"https://api.github.com/users/sergutsan/orgs","repos_url":"https://api.github.com/users/sergutsan/repos","events_url":"https://api.github.com/users/sergutsan/events{/privacy}","received_events_url":"https://api.github.com/users/sergutsan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-15T18:34:46Z","updated_at":"2015-10-22T09:50:47Z","closed_at":null,"body":"**Summary of the problem:**\r\n\r\nWhen the Java Decaf compiler encounters an invalid operator, it ignores it instead of producing an error. \r\n\r\n**What do you see?**\r\n\r\nCode like \r\n\r\n    String str = readLine();\r\n    if (str.length() >> 5) {\r\n      println();\r\n    }\r\n\r\nproduces the following output: \r\n\r\n    Hello.java:9: error: ')' expected\r\n        if (str.length() 5) {\r\n                        ^\r\n    Hello.java:9: error: not a statement\r\n        if (str.length() 5) {\r\n                         ^\r\n    Hello.java:9: error: ';' expected\r\n        if (str.length() 5) {\r\n                          ^\r\n    3 errors\r\n\r\n**What should you see instead?**\r\n\r\nSomething like: \r\n\r\n    Hello.java:2: error: '>>' is not a valid operator for this type of data. \r\n        if (str.length() >> 5) {\r\n                         ^\r\n    1 error\r\n"},"comment":{"url":"https://api.github.com/repos/SophieKoonin/JavaDecaf/issues/comments/150164848","html_url":"https://github.com/SophieKoonin/JavaDecaf/issues/16#issuecomment-150164848","issue_url":"https://api.github.com/repos/SophieKoonin/JavaDecaf/issues/16","id":150164848,"user":{"login":"SophieKoonin","id":10195023,"avatar_url":"https://avatars.githubusercontent.com/u/10195023?v=3","gravatar_id":"","url":"https://api.github.com/users/SophieKoonin","html_url":"https://github.com/SophieKoonin","followers_url":"https://api.github.com/users/SophieKoonin/followers","following_url":"https://api.github.com/users/SophieKoonin/following{/other_user}","gists_url":"https://api.github.com/users/SophieKoonin/gists{/gist_id}","starred_url":"https://api.github.com/users/SophieKoonin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SophieKoonin/subscriptions","organizations_url":"https://api.github.com/users/SophieKoonin/orgs","repos_url":"https://api.github.com/users/SophieKoonin/repos","events_url":"https://api.github.com/users/SophieKoonin/events{/privacy}","received_events_url":"https://api.github.com/users/SophieKoonin/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T09:50:47Z","updated_at":"2015-10-22T09:50:47Z","body":"It's to do with how the conditional operators are processed - the condition\nis split into Expression() Operator() Expression() (simplified for\nexplanation) and if no operator node is defined it won't be added to the\nlist of children to process. Each node only processes its own content, so\nif any content such as an operator 'slips through the cracks' it will be\nforgotten.\n\n(JavaCC is horrible.)\n\nI made a decision not to create nodes for every single structure in the\ngrammar since I thought some were unlikely to be used.\n\nOn 22 October 2015 at 10:27, sergutsan <notifications@github.com> wrote:\n\n> Thanks, Sophie. Will try that. :-)\n>\n> Could you please explain why these operators are suppressed from the\n> output instead of being left verbatim? Maybe there are similar problems\n> lurking in other rarely-used operators...?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/SophieKoonin/JavaDecaf/issues/16#issuecomment-150160420>\n> .\n>\n"}}