{"action":"created","comment":{"url":"https://api.github.com/repos/BNFC/bnfc/pulls/comments/43375351","id":43375351,"diff_hunk":"@@ -45,6 +45,13 @@ import BNFC.Utils (cstring)\n import BNFC.Backend.Common.NamedVariables\n import Text.PrettyPrint\n \n+-- This is for now the workaround to differentiate JLex and JFlex.","path":"source/src/BNFC/Backend/Java/CFtoJLex15.hs","position":13,"original_position":13,"commit_id":"f2f20ec5abb4155d5e652db96e24434bbf83d7c1","original_commit_id":"f2f20ec5abb4155d5e652db96e24434bbf83d7c1","user":{"login":"gdetrez","id":38019,"avatar_url":"https://avatars.githubusercontent.com/u/38019?v=3","gravatar_id":"","url":"https://api.github.com/users/gdetrez","html_url":"https://github.com/gdetrez","followers_url":"https://api.github.com/users/gdetrez/followers","following_url":"https://api.github.com/users/gdetrez/following{/other_user}","gists_url":"https://api.github.com/users/gdetrez/gists{/gist_id}","starred_url":"https://api.github.com/users/gdetrez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdetrez/subscriptions","organizations_url":"https://api.github.com/users/gdetrez/orgs","repos_url":"https://api.github.com/users/gdetrez/repos","events_url":"https://api.github.com/users/gdetrez/events{/privacy}","received_events_url":"https://api.github.com/users/gdetrez/received_events","type":"User","site_admin":false},"body":"I see the point about readability but given the small differences between the two versions, I don't think having two different functions would be any better... You could pass the `JavaLexerParser` value if you prefer (although that means raising an error on `Antlr4`)\r\n\r\nOr maybe create a datatype that encapsulate the difference between the two variants? (something like `data JLexVariant = JLexVariant { bufferVar :: String, escapeChars :: [Char], ... }`)\r\n","created_at":"2015-10-29T11:47:20Z","updated_at":"2015-10-29T11:47:20Z","html_url":"https://github.com/BNFC/bnfc/pull/155#discussion_r43375351","pull_request_url":"https://api.github.com/repos/BNFC/bnfc/pulls/155","_links":{"self":{"href":"https://api.github.com/repos/BNFC/bnfc/pulls/comments/43375351"},"html":{"href":"https://github.com/BNFC/bnfc/pull/155#discussion_r43375351"},"pull_request":{"href":"https://api.github.com/repos/BNFC/bnfc/pulls/155"}}},"pull_request":{"url":"https://api.github.com/repos/BNFC/bnfc/pulls/155","id":48585020,"html_url":"https://github.com/BNFC/bnfc/pull/155","diff_url":"https://github.com/BNFC/bnfc/pull/155.diff","patch_url":"https://github.com/BNFC/bnfc/pull/155.patch","issue_url":"https://api.github.com/repos/BNFC/bnfc/issues/155","number":155,"state":"open","locked":false,"title":"Add ANTLR4 Java backend ","user":{"login":"gapag","id":3069948,"avatar_url":"https://avatars.githubusercontent.com/u/3069948?v=3","gravatar_id":"","url":"https://api.github.com/users/gapag","html_url":"https://github.com/gapag","followers_url":"https://api.github.com/users/gapag/followers","following_url":"https://api.github.com/users/gapag/following{/other_user}","gists_url":"https://api.github.com/users/gapag/gists{/gist_id}","starred_url":"https://api.github.com/users/gapag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gapag/subscriptions","organizations_url":"https://api.github.com/users/gapag/orgs","repos_url":"https://api.github.com/users/gapag/repos","events_url":"https://api.github.com/users/gapag/events{/privacy}","received_events_url":"https://api.github.com/users/gapag/received_events","type":"User","site_admin":false},"body":"I wrote an [ANTLR4] (http://www.antlr.org/) backend hopefully substituting the old J(F)Lex+CUP . \r\nANTLR is a lexer+parser generator originally targetting Java. It has many commonalities with BNFC, but it deals mainly with parse trees whereas BNFC has its focus on ASTs.\r\n\r\nThe motivation is that \r\n 1. these tools are old and at least one of them is not supported anymore.\r\n 2. ANTLR has interesting features to manipulate parse trees, which could be integrated in BNFC.\r\n 3. ANTLR has also some other target languages (e.g. Python)\r\n\r\nCommit c7ba720 's message contains further details about what has been done and what is to do. \r\n\r\nSummarizing, what I did is\r\n- make ANTLR a non-default option for the Java backend\r\n- CF to ANTLR lexer/parser translation\r\n- Java Makefiles calling ANTLR\r\n- Blacklist Java keywords (abstract, native ...) (ONLY for ANTLR backend)\r\n\r\nSystem tests pass successfully on my machine.\r\n\r\nThe directory .idea is created by the IDE I use and you can of course remove it from the merge -- unless there are other people willing to use my same project.\r\n\r\nI did not set ANTLR as the default Java backend because I'd like to have more people trying it before promoting it.\r\n\r\nThanks for your time.","created_at":"2015-10-23T14:15:19Z","updated_at":"2015-10-29T11:47:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db26fa4560e6aa5308b5fc4049c6f830c4269086","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BNFC/bnfc/pulls/155/commits","review_comments_url":"https://api.github.com/repos/BNFC/bnfc/pulls/155/comments","review_comment_url":"https://api.github.com/repos/BNFC/bnfc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BNFC/bnfc/issues/155/comments","statuses_url":"https://api.github.com/repos/BNFC/bnfc/statuses/f2f20ec5abb4155d5e652db96e24434bbf83d7c1","head":{"label":"gapag:master","ref":"master","sha":"f2f20ec5abb4155d5e652db96e24434bbf83d7c1","user":{"login":"gapag","id":3069948,"avatar_url":"https://avatars.githubusercontent.com/u/3069948?v=3","gravatar_id":"","url":"https://api.github.com/users/gapag","html_url":"https://github.com/gapag","followers_url":"https://api.github.com/users/gapag/followers","following_url":"https://api.github.com/users/gapag/following{/other_user}","gists_url":"https://api.github.com/users/gapag/gists{/gist_id}","starred_url":"https://api.github.com/users/gapag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gapag/subscriptions","organizations_url":"https://api.github.com/users/gapag/orgs","repos_url":"https://api.github.com/users/gapag/repos","events_url":"https://api.github.com/users/gapag/events{/privacy}","received_events_url":"https://api.github.com/users/gapag/received_events","type":"User","site_admin":false},"repo":{"id":27480073,"name":"bnfc","full_name":"gapag/bnfc","owner":{"login":"gapag","id":3069948,"avatar_url":"https://avatars.githubusercontent.com/u/3069948?v=3","gravatar_id":"","url":"https://api.github.com/users/gapag","html_url":"https://github.com/gapag","followers_url":"https://api.github.com/users/gapag/followers","following_url":"https://api.github.com/users/gapag/following{/other_user}","gists_url":"https://api.github.com/users/gapag/gists{/gist_id}","starred_url":"https://api.github.com/users/gapag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gapag/subscriptions","organizations_url":"https://api.github.com/users/gapag/orgs","repos_url":"https://api.github.com/users/gapag/repos","events_url":"https://api.github.com/users/gapag/events{/privacy}","received_events_url":"https://api.github.com/users/gapag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gapag/bnfc","description":"BNF Converter","fork":true,"url":"https://api.github.com/repos/gapag/bnfc","forks_url":"https://api.github.com/repos/gapag/bnfc/forks","keys_url":"https://api.github.com/repos/gapag/bnfc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gapag/bnfc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gapag/bnfc/teams","hooks_url":"https://api.github.com/repos/gapag/bnfc/hooks","issue_events_url":"https://api.github.com/repos/gapag/bnfc/issues/events{/number}","events_url":"https://api.github.com/repos/gapag/bnfc/events","assignees_url":"https://api.github.com/repos/gapag/bnfc/assignees{/user}","branches_url":"https://api.github.com/repos/gapag/bnfc/branches{/branch}","tags_url":"https://api.github.com/repos/gapag/bnfc/tags","blobs_url":"https://api.github.com/repos/gapag/bnfc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gapag/bnfc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gapag/bnfc/git/refs{/sha}","trees_url":"https://api.github.com/repos/gapag/bnfc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gapag/bnfc/statuses/{sha}","languages_url":"https://api.github.com/repos/gapag/bnfc/languages","stargazers_url":"https://api.github.com/repos/gapag/bnfc/stargazers","contributors_url":"https://api.github.com/repos/gapag/bnfc/contributors","subscribers_url":"https://api.github.com/repos/gapag/bnfc/subscribers","subscription_url":"https://api.github.com/repos/gapag/bnfc/subscription","commits_url":"https://api.github.com/repos/gapag/bnfc/commits{/sha}","git_commits_url":"https://api.github.com/repos/gapag/bnfc/git/commits{/sha}","comments_url":"https://api.github.com/repos/gapag/bnfc/comments{/number}","issue_comment_url":"https://api.github.com/repos/gapag/bnfc/issues/comments{/number}","contents_url":"https://api.github.com/repos/gapag/bnfc/contents/{+path}","compare_url":"https://api.github.com/repos/gapag/bnfc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gapag/bnfc/merges","archive_url":"https://api.github.com/repos/gapag/bnfc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gapag/bnfc/downloads","issues_url":"https://api.github.com/repos/gapag/bnfc/issues{/number}","pulls_url":"https://api.github.com/repos/gapag/bnfc/pulls{/number}","milestones_url":"https://api.github.com/repos/gapag/bnfc/milestones{/number}","notifications_url":"https://api.github.com/repos/gapag/bnfc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gapag/bnfc/labels{/name}","releases_url":"https://api.github.com/repos/gapag/bnfc/releases{/id}","created_at":"2014-12-03T09:46:17Z","updated_at":"2014-12-03T09:46:18Z","pushed_at":"2015-10-23T22:52:07Z","git_url":"git://github.com/gapag/bnfc.git","ssh_url":"git@github.com:gapag/bnfc.git","clone_url":"https://github.com/gapag/bnfc.git","svn_url":"https://github.com/gapag/bnfc","homepage":null,"size":3996,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"BNFC:master","ref":"master","sha":"a3ce809dca3cac422b51dd046871f52c2b862892","user":{"login":"BNFC","id":2845160,"avatar_url":"https://avatars.githubusercontent.com/u/2845160?v=3","gravatar_id":"","url":"https://api.github.com/users/BNFC","html_url":"https://github.com/BNFC","followers_url":"https://api.github.com/users/BNFC/followers","following_url":"https://api.github.com/users/BNFC/following{/other_user}","gists_url":"https://api.github.com/users/BNFC/gists{/gist_id}","starred_url":"https://api.github.com/users/BNFC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BNFC/subscriptions","organizations_url":"https://api.github.com/users/BNFC/orgs","repos_url":"https://api.github.com/users/BNFC/repos","events_url":"https://api.github.com/users/BNFC/events{/privacy}","received_events_url":"https://api.github.com/users/BNFC/received_events","type":"Organization","site_admin":false},"repo":{"id":6782974,"name":"bnfc","full_name":"BNFC/bnfc","owner":{"login":"BNFC","id":2845160,"avatar_url":"https://avatars.githubusercontent.com/u/2845160?v=3","gravatar_id":"","url":"https://api.github.com/users/BNFC","html_url":"https://github.com/BNFC","followers_url":"https://api.github.com/users/BNFC/followers","following_url":"https://api.github.com/users/BNFC/following{/other_user}","gists_url":"https://api.github.com/users/BNFC/gists{/gist_id}","starred_url":"https://api.github.com/users/BNFC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BNFC/subscriptions","organizations_url":"https://api.github.com/users/BNFC/orgs","repos_url":"https://api.github.com/users/BNFC/repos","events_url":"https://api.github.com/users/BNFC/events{/privacy}","received_events_url":"https://api.github.com/users/BNFC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BNFC/bnfc","description":"BNF Converter","fork":false,"url":"https://api.github.com/repos/BNFC/bnfc","forks_url":"https://api.github.com/repos/BNFC/bnfc/forks","keys_url":"https://api.github.com/repos/BNFC/bnfc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BNFC/bnfc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BNFC/bnfc/teams","hooks_url":"https://api.github.com/repos/BNFC/bnfc/hooks","issue_events_url":"https://api.github.com/repos/BNFC/bnfc/issues/events{/number}","events_url":"https://api.github.com/repos/BNFC/bnfc/events","assignees_url":"https://api.github.com/repos/BNFC/bnfc/assignees{/user}","branches_url":"https://api.github.com/repos/BNFC/bnfc/branches{/branch}","tags_url":"https://api.github.com/repos/BNFC/bnfc/tags","blobs_url":"https://api.github.com/repos/BNFC/bnfc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BNFC/bnfc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BNFC/bnfc/git/refs{/sha}","trees_url":"https://api.github.com/repos/BNFC/bnfc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BNFC/bnfc/statuses/{sha}","languages_url":"https://api.github.com/repos/BNFC/bnfc/languages","stargazers_url":"https://api.github.com/repos/BNFC/bnfc/stargazers","contributors_url":"https://api.github.com/repos/BNFC/bnfc/contributors","subscribers_url":"https://api.github.com/repos/BNFC/bnfc/subscribers","subscription_url":"https://api.github.com/repos/BNFC/bnfc/subscription","commits_url":"https://api.github.com/repos/BNFC/bnfc/commits{/sha}","git_commits_url":"https://api.github.com/repos/BNFC/bnfc/git/commits{/sha}","comments_url":"https://api.github.com/repos/BNFC/bnfc/comments{/number}","issue_comment_url":"https://api.github.com/repos/BNFC/bnfc/issues/comments{/number}","contents_url":"https://api.github.com/repos/BNFC/bnfc/contents/{+path}","compare_url":"https://api.github.com/repos/BNFC/bnfc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BNFC/bnfc/merges","archive_url":"https://api.github.com/repos/BNFC/bnfc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BNFC/bnfc/downloads","issues_url":"https://api.github.com/repos/BNFC/bnfc/issues{/number}","pulls_url":"https://api.github.com/repos/BNFC/bnfc/pulls{/number}","milestones_url":"https://api.github.com/repos/BNFC/bnfc/milestones{/number}","notifications_url":"https://api.github.com/repos/BNFC/bnfc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BNFC/bnfc/labels{/name}","releases_url":"https://api.github.com/repos/BNFC/bnfc/releases{/id}","created_at":"2012-11-20T18:33:10Z","updated_at":"2015-10-25T18:32:21Z","pushed_at":"2015-10-23T22:52:08Z","git_url":"git://github.com/BNFC/bnfc.git","ssh_url":"git@github.com:BNFC/bnfc.git","clone_url":"https://github.com/BNFC/bnfc.git","svn_url":"https://github.com/BNFC/bnfc","homepage":"http://bnfc.digitalgrammars.com/","size":5568,"stargazers_count":104,"watchers_count":104,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":26,"forks":51,"open_issues":26,"watchers":104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BNFC/bnfc/pulls/155"},"html":{"href":"https://github.com/BNFC/bnfc/pull/155"},"issue":{"href":"https://api.github.com/repos/BNFC/bnfc/issues/155"},"comments":{"href":"https://api.github.com/repos/BNFC/bnfc/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/BNFC/bnfc/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/BNFC/bnfc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BNFC/bnfc/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/BNFC/bnfc/statuses/f2f20ec5abb4155d5e652db96e24434bbf83d7c1"}}}}