{"action":"created","comment":{"url":"https://api.github.com/repos/bdfhjk/VIPER/pulls/comments/28456417","id":28456417,"diff_hunk":"@@ -0,0 +1,24 @@\n+define([\n+    '../Cfg',\n+], function (Cfg) {\n+    var cfgGenerator;\n+    \n+    function Return(paramNode) {\n+\tvar cfgFromParam = cfgGenerator(paramNode.rexpression);\n+\tif(!cfgFromParam)","path":"src/backend/preprocessor/cfgGenerator/Return.js","position":8,"original_position":8,"commit_id":"ad737da17924acaef4181fabc4a7c040da22aa3e","original_commit_id":"ad737da17924acaef4181fabc4a7c040da22aa3e","user":{"login":"adriankral","id":6266115,"avatar_url":"https://avatars.githubusercontent.com/u/6266115?v=3","gravatar_id":"","url":"https://api.github.com/users/adriankral","html_url":"https://github.com/adriankral","followers_url":"https://api.github.com/users/adriankral/followers","following_url":"https://api.github.com/users/adriankral/following{/other_user}","gists_url":"https://api.github.com/users/adriankral/gists{/gist_id}","starred_url":"https://api.github.com/users/adriankral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriankral/subscriptions","organizations_url":"https://api.github.com/users/adriankral/orgs","repos_url":"https://api.github.com/users/adriankral/repos","events_url":"https://api.github.com/users/adriankral/events{/privacy}","received_events_url":"https://api.github.com/users/adriankral/received_events","type":"User","site_admin":false},"body":"<llama>","created_at":"2015-04-15T19:57:15Z","updated_at":"2015-04-15T19:57:15Z","html_url":"https://github.com/bdfhjk/VIPER/pull/38#discussion_r28456417","pull_request_url":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/bdfhjk/VIPER/pulls/comments/28456417"},"html":{"href":"https://github.com/bdfhjk/VIPER/pull/38#discussion_r28456417"},"pull_request":{"href":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38","id":32892750,"html_url":"https://github.com/bdfhjk/VIPER/pull/38","diff_url":"https://github.com/bdfhjk/VIPER/pull/38.diff","patch_url":"https://github.com/bdfhjk/VIPER/pull/38.patch","issue_url":"https://api.github.com/repos/bdfhjk/VIPER/issues/38","number":38,"state":"open","locked":false,"title":"Add Preprocessor","user":{"login":"adriankral","id":6266115,"avatar_url":"https://avatars.githubusercontent.com/u/6266115?v=3","gravatar_id":"","url":"https://api.github.com/users/adriankral","html_url":"https://github.com/adriankral","followers_url":"https://api.github.com/users/adriankral/followers","following_url":"https://api.github.com/users/adriankral/following{/other_user}","gists_url":"https://api.github.com/users/adriankral/gists{/gist_id}","starred_url":"https://api.github.com/users/adriankral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriankral/subscriptions","organizations_url":"https://api.github.com/users/adriankral/orgs","repos_url":"https://api.github.com/users/adriankral/repos","events_url":"https://api.github.com/users/adriankral/events{/privacy}","received_events_url":"https://api.github.com/users/adriankral/received_events","type":"User","site_admin":false},"body":"Add a Preprocessor module that, given an AST, produces JSON that VM can digest. It substitutes variable names so that those variables that are in the same function but in different blocks are distinguishable. Also, it produces a CFG from given AST for each function. CFG is produced by DFS traversal.\r\n\r\nAdd a \"NOOP\" instruction in the VM. If it wasn't for that instruction, producing CFG would be much harder. Example:\r\n\r\n`if(a == 0) {\r\n  return b;\r\n} else {\r\n  return c;\r\n}`\r\n\r\nI create the graph recursively by connecting the smaller graphs - and graph representing an \"IF\" instruction doesn't have one end - so if it weren't for NOOP instruction, I would have to mark it somehow and then deal with connecting many nodes to the beginning of another graph. I think it would be quite messy if we had to connect some ill-designed Whiles and Ifs that way.\r\n\r\nI included an integration test, I can add unit tests in the next milestone. However, a proper check needs the test to walk the graph anyway, so an integration test is in my opinion not a bad idea.","created_at":"2015-04-08T19:21:17Z","updated_at":"2015-04-15T19:57:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25e6bbe29cc36a63f5aa9dc58f7e90d563d94cff","assignee":{"login":"chaser92","id":2059806,"avatar_url":"https://avatars.githubusercontent.com/u/2059806?v=3","gravatar_id":"","url":"https://api.github.com/users/chaser92","html_url":"https://github.com/chaser92","followers_url":"https://api.github.com/users/chaser92/followers","following_url":"https://api.github.com/users/chaser92/following{/other_user}","gists_url":"https://api.github.com/users/chaser92/gists{/gist_id}","starred_url":"https://api.github.com/users/chaser92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaser92/subscriptions","organizations_url":"https://api.github.com/users/chaser92/orgs","repos_url":"https://api.github.com/users/chaser92/repos","events_url":"https://api.github.com/users/chaser92/events{/privacy}","received_events_url":"https://api.github.com/users/chaser92/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/bdfhjk/VIPER/milestones/2","html_url":"https://github.com/bdfhjk/VIPER/milestones/Milestone%202","labels_url":"https://api.github.com/repos/bdfhjk/VIPER/milestones/2/labels","id":1017919,"number":2,"title":"Milestone 2","description":"- Jesteśmy w stanie wykonać program - tj. dla danego kodu źródłowego produkowane jest odpowiednie wyjście, jest zaimplementowany model pamięci itp.\r\n- Są podwaliny biblioteki standardowej - nie jest ona zaimplementowana, ale wiadomo już, jak będzie to zrobione. Działa tylko funkcja printf\r\n- Frontend komunikuje się już sensownie z backendem - umie wydawać mu polecenia: następny krok, pauza, stop, wczytaj program itp. Backend wysyła informacje, który fragment kodu przetwarza. Nie musi mówić o zachowaniu struktur danych, nie musi ich też rozpoznawać.\r\n- Zakres poprawności parsera bez zmian - ale dla programów, które uprzednio rozpoznawał jako poprawne, musi teraz \"rozumieć\" - generować AST, czy cokolwiek tam chcecie\r\n- Umiemy zwizualizować pojedyncze zmienne\r\n- Ustaliliśmy już, jak będziemy pisać pracę licencjacką","creator":{"login":"bdfhjk","id":2317613,"avatar_url":"https://avatars.githubusercontent.com/u/2317613?v=3","gravatar_id":"","url":"https://api.github.com/users/bdfhjk","html_url":"https://github.com/bdfhjk","followers_url":"https://api.github.com/users/bdfhjk/followers","following_url":"https://api.github.com/users/bdfhjk/following{/other_user}","gists_url":"https://api.github.com/users/bdfhjk/gists{/gist_id}","starred_url":"https://api.github.com/users/bdfhjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdfhjk/subscriptions","organizations_url":"https://api.github.com/users/bdfhjk/orgs","repos_url":"https://api.github.com/users/bdfhjk/repos","events_url":"https://api.github.com/users/bdfhjk/events{/privacy}","received_events_url":"https://api.github.com/users/bdfhjk/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":6,"state":"open","created_at":"2015-03-12T08:23:11Z","updated_at":"2015-04-08T19:21:31Z","due_on":"2015-04-08T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38/commits","review_comments_url":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38/comments","review_comment_url":"https://api.github.com/repos/bdfhjk/VIPER/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bdfhjk/VIPER/issues/38/comments","statuses_url":"https://api.github.com/repos/bdfhjk/VIPER/statuses/ad737da17924acaef4181fabc4a7c040da22aa3e","head":{"label":"adriankral:master","ref":"master","sha":"ad737da17924acaef4181fabc4a7c040da22aa3e","user":{"login":"adriankral","id":6266115,"avatar_url":"https://avatars.githubusercontent.com/u/6266115?v=3","gravatar_id":"","url":"https://api.github.com/users/adriankral","html_url":"https://github.com/adriankral","followers_url":"https://api.github.com/users/adriankral/followers","following_url":"https://api.github.com/users/adriankral/following{/other_user}","gists_url":"https://api.github.com/users/adriankral/gists{/gist_id}","starred_url":"https://api.github.com/users/adriankral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriankral/subscriptions","organizations_url":"https://api.github.com/users/adriankral/orgs","repos_url":"https://api.github.com/users/adriankral/repos","events_url":"https://api.github.com/users/adriankral/events{/privacy}","received_events_url":"https://api.github.com/users/adriankral/received_events","type":"User","site_admin":false},"repo":{"id":31555720,"name":"VIPER","full_name":"adriankral/VIPER","owner":{"login":"adriankral","id":6266115,"avatar_url":"https://avatars.githubusercontent.com/u/6266115?v=3","gravatar_id":"","url":"https://api.github.com/users/adriankral","html_url":"https://github.com/adriankral","followers_url":"https://api.github.com/users/adriankral/followers","following_url":"https://api.github.com/users/adriankral/following{/other_user}","gists_url":"https://api.github.com/users/adriankral/gists{/gist_id}","starred_url":"https://api.github.com/users/adriankral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriankral/subscriptions","organizations_url":"https://api.github.com/users/adriankral/orgs","repos_url":"https://api.github.com/users/adriankral/repos","events_url":"https://api.github.com/users/adriankral/events{/privacy}","received_events_url":"https://api.github.com/users/adriankral/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adriankral/VIPER","description":"","fork":true,"url":"https://api.github.com/repos/adriankral/VIPER","forks_url":"https://api.github.com/repos/adriankral/VIPER/forks","keys_url":"https://api.github.com/repos/adriankral/VIPER/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adriankral/VIPER/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adriankral/VIPER/teams","hooks_url":"https://api.github.com/repos/adriankral/VIPER/hooks","issue_events_url":"https://api.github.com/repos/adriankral/VIPER/issues/events{/number}","events_url":"https://api.github.com/repos/adriankral/VIPER/events","assignees_url":"https://api.github.com/repos/adriankral/VIPER/assignees{/user}","branches_url":"https://api.github.com/repos/adriankral/VIPER/branches{/branch}","tags_url":"https://api.github.com/repos/adriankral/VIPER/tags","blobs_url":"https://api.github.com/repos/adriankral/VIPER/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adriankral/VIPER/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adriankral/VIPER/git/refs{/sha}","trees_url":"https://api.github.com/repos/adriankral/VIPER/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adriankral/VIPER/statuses/{sha}","languages_url":"https://api.github.com/repos/adriankral/VIPER/languages","stargazers_url":"https://api.github.com/repos/adriankral/VIPER/stargazers","contributors_url":"https://api.github.com/repos/adriankral/VIPER/contributors","subscribers_url":"https://api.github.com/repos/adriankral/VIPER/subscribers","subscription_url":"https://api.github.com/repos/adriankral/VIPER/subscription","commits_url":"https://api.github.com/repos/adriankral/VIPER/commits{/sha}","git_commits_url":"https://api.github.com/repos/adriankral/VIPER/git/commits{/sha}","comments_url":"https://api.github.com/repos/adriankral/VIPER/comments{/number}","issue_comment_url":"https://api.github.com/repos/adriankral/VIPER/issues/comments{/number}","contents_url":"https://api.github.com/repos/adriankral/VIPER/contents/{+path}","compare_url":"https://api.github.com/repos/adriankral/VIPER/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adriankral/VIPER/merges","archive_url":"https://api.github.com/repos/adriankral/VIPER/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adriankral/VIPER/downloads","issues_url":"https://api.github.com/repos/adriankral/VIPER/issues{/number}","pulls_url":"https://api.github.com/repos/adriankral/VIPER/pulls{/number}","milestones_url":"https://api.github.com/repos/adriankral/VIPER/milestones{/number}","notifications_url":"https://api.github.com/repos/adriankral/VIPER/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adriankral/VIPER/labels{/name}","releases_url":"https://api.github.com/repos/adriankral/VIPER/releases{/id}","created_at":"2015-03-02T18:27:51Z","updated_at":"2015-04-15T17:43:13Z","pushed_at":"2015-04-15T17:43:13Z","git_url":"git://github.com/adriankral/VIPER.git","ssh_url":"git@github.com:adriankral/VIPER.git","clone_url":"https://github.com/adriankral/VIPER.git","svn_url":"https://github.com/adriankral/VIPER","homepage":null,"size":389,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"bdfhjk:master","ref":"master","sha":"72d5799b6f3dbc32c7a1481a2d4f6f414343808c","user":{"login":"bdfhjk","id":2317613,"avatar_url":"https://avatars.githubusercontent.com/u/2317613?v=3","gravatar_id":"","url":"https://api.github.com/users/bdfhjk","html_url":"https://github.com/bdfhjk","followers_url":"https://api.github.com/users/bdfhjk/followers","following_url":"https://api.github.com/users/bdfhjk/following{/other_user}","gists_url":"https://api.github.com/users/bdfhjk/gists{/gist_id}","starred_url":"https://api.github.com/users/bdfhjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdfhjk/subscriptions","organizations_url":"https://api.github.com/users/bdfhjk/orgs","repos_url":"https://api.github.com/users/bdfhjk/repos","events_url":"https://api.github.com/users/bdfhjk/events{/privacy}","received_events_url":"https://api.github.com/users/bdfhjk/received_events","type":"User","site_admin":false},"repo":{"id":28754896,"name":"VIPER","full_name":"bdfhjk/VIPER","owner":{"login":"bdfhjk","id":2317613,"avatar_url":"https://avatars.githubusercontent.com/u/2317613?v=3","gravatar_id":"","url":"https://api.github.com/users/bdfhjk","html_url":"https://github.com/bdfhjk","followers_url":"https://api.github.com/users/bdfhjk/followers","following_url":"https://api.github.com/users/bdfhjk/following{/other_user}","gists_url":"https://api.github.com/users/bdfhjk/gists{/gist_id}","starred_url":"https://api.github.com/users/bdfhjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdfhjk/subscriptions","organizations_url":"https://api.github.com/users/bdfhjk/orgs","repos_url":"https://api.github.com/users/bdfhjk/repos","events_url":"https://api.github.com/users/bdfhjk/events{/privacy}","received_events_url":"https://api.github.com/users/bdfhjk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bdfhjk/VIPER","description":"","fork":false,"url":"https://api.github.com/repos/bdfhjk/VIPER","forks_url":"https://api.github.com/repos/bdfhjk/VIPER/forks","keys_url":"https://api.github.com/repos/bdfhjk/VIPER/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bdfhjk/VIPER/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bdfhjk/VIPER/teams","hooks_url":"https://api.github.com/repos/bdfhjk/VIPER/hooks","issue_events_url":"https://api.github.com/repos/bdfhjk/VIPER/issues/events{/number}","events_url":"https://api.github.com/repos/bdfhjk/VIPER/events","assignees_url":"https://api.github.com/repos/bdfhjk/VIPER/assignees{/user}","branches_url":"https://api.github.com/repos/bdfhjk/VIPER/branches{/branch}","tags_url":"https://api.github.com/repos/bdfhjk/VIPER/tags","blobs_url":"https://api.github.com/repos/bdfhjk/VIPER/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bdfhjk/VIPER/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bdfhjk/VIPER/git/refs{/sha}","trees_url":"https://api.github.com/repos/bdfhjk/VIPER/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bdfhjk/VIPER/statuses/{sha}","languages_url":"https://api.github.com/repos/bdfhjk/VIPER/languages","stargazers_url":"https://api.github.com/repos/bdfhjk/VIPER/stargazers","contributors_url":"https://api.github.com/repos/bdfhjk/VIPER/contributors","subscribers_url":"https://api.github.com/repos/bdfhjk/VIPER/subscribers","subscription_url":"https://api.github.com/repos/bdfhjk/VIPER/subscription","commits_url":"https://api.github.com/repos/bdfhjk/VIPER/commits{/sha}","git_commits_url":"https://api.github.com/repos/bdfhjk/VIPER/git/commits{/sha}","comments_url":"https://api.github.com/repos/bdfhjk/VIPER/comments{/number}","issue_comment_url":"https://api.github.com/repos/bdfhjk/VIPER/issues/comments{/number}","contents_url":"https://api.github.com/repos/bdfhjk/VIPER/contents/{+path}","compare_url":"https://api.github.com/repos/bdfhjk/VIPER/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bdfhjk/VIPER/merges","archive_url":"https://api.github.com/repos/bdfhjk/VIPER/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bdfhjk/VIPER/downloads","issues_url":"https://api.github.com/repos/bdfhjk/VIPER/issues{/number}","pulls_url":"https://api.github.com/repos/bdfhjk/VIPER/pulls{/number}","milestones_url":"https://api.github.com/repos/bdfhjk/VIPER/milestones{/number}","notifications_url":"https://api.github.com/repos/bdfhjk/VIPER/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bdfhjk/VIPER/labels{/name}","releases_url":"https://api.github.com/repos/bdfhjk/VIPER/releases{/id}","created_at":"2015-01-03T21:16:25Z","updated_at":"2015-04-15T18:16:01Z","pushed_at":"2015-04-15T18:16:01Z","git_url":"git://github.com/bdfhjk/VIPER.git","ssh_url":"git@github.com:bdfhjk/VIPER.git","clone_url":"https://github.com/bdfhjk/VIPER.git","svn_url":"https://github.com/bdfhjk/VIPER","homepage":null,"size":1051,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":6,"forks":3,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38"},"html":{"href":"https://github.com/bdfhjk/VIPER/pull/38"},"issue":{"href":"https://api.github.com/repos/bdfhjk/VIPER/issues/38"},"comments":{"href":"https://api.github.com/repos/bdfhjk/VIPER/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/bdfhjk/VIPER/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bdfhjk/VIPER/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/bdfhjk/VIPER/statuses/ad737da17924acaef4181fabc4a7c040da22aa3e"}}}}