{"action":"created","comment":{"url":"https://api.github.com/repos/SofiaCPP/IPL/pulls/comments/233777234","pull_request_review_id":175268753,"id":233777234,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzc3NzIzNA==","diff_hunk":"@@ -0,0 +1,390 @@\n+#include \"ByteCodeGenerator.h\"\r\n+#include \"ExpressionVisitor.h\"\r\n+#include <algorithm>\r\n+\r\n+class ByteCodeGenerator : public ExpressionVisitor\r\n+{\r\n+public:\r\n+\tByteCodeGenerator() {};\r\n+\t~ByteCodeGenerator() {};\r\n+\r\n+\r\n+\tvirtual void Visit(FunctionDeclaration* e) override;\r\n+\tvirtual void Visit(BlockStatement* e) override;\r\n+\tvirtual void Visit(BinaryExpression* e) override;\r\n+\tvirtual void Visit(LiteralNumber* e) override;\r\n+\tvirtual void Visit(TopStatements* e) override;\r\n+\tvirtual void Visit(ListExpression* e) override;\r\n+\tvirtual void Visit(VariableDefinitionExpression* e) override;\r\n+\r\n+\tIPLString GetCode();\r\n+\tunsigned ResolveRegisterName(IPLString& name);\r\n+private:\r\n+\r\n+\tstruct Instruction\r\n+\t{\r\n+\t\tenum Type : char\r\n+\t\t{\r\n+\t\t\tADD,\r\n+\t\t\tSUB,\r\n+\t\t\tMUL,\r\n+\t\t\tDIV,\r\n+\t\t\tMOD,\r\n+\t\t\tMOV,\r\n+\t\t\tPRINT,\r\n+\t\t\tREAD,\r\n+\t\t\tCALL,\r\n+\t\t\tRET,\r\n+\t\t\tJMP,\r\n+\t\t\tJMPT,\r\n+\t\t\tJMPF,\r\n+\t\t\tDUP,\r\n+\t\t\tPUSH,\r\n+\t\t\tPOP,\r\n+\t\t\tSAVE,\r\n+\t\t\tRESTORE,\r\n+\t\t\tLESS,\r\n+\t\t\tEQ,\r\n+\t\t\tLEQ,\r\n+\t\t\tGETG,\r\n+\t\t\tSETG,\r\n+\t\t\tGETUP,\r\n+\t\t\tSETUP,\r\n+\t\t\tGET,\r\n+\t\t\tSET,\r\n+\t\t\tINC,\r\n+\t\t\tDEC,\r\n+\t\t\tAND,\r\n+\t\t\tOR,\r\n+\t\t\tXOR,\r\n+\t\t\tNOT,\r\n+\t\t\tTHROW,\r\n+\t\t\tCATCH,\r\n+\t\t\tCONST,\r\n+\t\t\tSTRING,\r\n+\t\t\tHALT,\r\n+\t\t};\r\n+\r\n+\t\tType Descriptor;\r\n+\t\tIPLString Args[3];\r\n+\t\tdouble Number;\r\n+\t};\r\n+\tIPLVector<IPLString> m_RegisterTable;\r\n+\tIPLVector<Instruction> m_Code;\r\n+\r\n+\tIPLStack<IPLString> m_RegisterStack;\r\n+\tunsigned m_CurrentStackPointer;\r\r\tIPLString m_OutputCode;\r};\r","path":"JSImpl/src/ByteCodeGenerator.cpp","position":null,"original_position":76,"commit_id":"637077d60045c97e4de1638146adf5e6ad88cb77","original_commit_id":"60ff8830ed0d62820205420da2678cb3b410a66e","user":{"login":"NDobrev","id":6154617,"node_id":"MDQ6VXNlcjYxNTQ2MTc=","avatar_url":"https://avatars0.githubusercontent.com/u/6154617?v=4","gravatar_id":"","url":"https://api.github.com/users/NDobrev","html_url":"https://github.com/NDobrev","followers_url":"https://api.github.com/users/NDobrev/followers","following_url":"https://api.github.com/users/NDobrev/following{/other_user}","gists_url":"https://api.github.com/users/NDobrev/gists{/gist_id}","starred_url":"https://api.github.com/users/NDobrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NDobrev/subscriptions","organizations_url":"https://api.github.com/users/NDobrev/orgs","repos_url":"https://api.github.com/users/NDobrev/repos","events_url":"https://api.github.com/users/NDobrev/events{/privacy}","received_events_url":"https://api.github.com/users/NDobrev/received_events","type":"User","site_admin":false},"body":"something weird is happening between my editor and line ending in this file ","created_at":"2018-11-15T09:56:37Z","updated_at":"2018-11-15T09:56:37Z","html_url":"https://github.com/SofiaCPP/IPL/pull/49#discussion_r233777234","pull_request_url":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/SofiaCPP/IPL/pulls/comments/233777234"},"html":{"href":"https://github.com/SofiaCPP/IPL/pull/49#discussion_r233777234"},"pull_request":{"href":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49"}},"in_reply_to_id":233776497},"pull_request":{"url":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49","id":231128851,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMTI4ODUx","html_url":"https://github.com/SofiaCPP/IPL/pull/49","diff_url":"https://github.com/SofiaCPP/IPL/pull/49.diff","patch_url":"https://github.com/SofiaCPP/IPL/pull/49.patch","issue_url":"https://api.github.com/repos/SofiaCPP/IPL/issues/49","number":49,"state":"open","locked":false,"title":"Code gen","user":{"login":"NDobrev","id":6154617,"node_id":"MDQ6VXNlcjYxNTQ2MTc=","avatar_url":"https://avatars0.githubusercontent.com/u/6154617?v=4","gravatar_id":"","url":"https://api.github.com/users/NDobrev","html_url":"https://github.com/NDobrev","followers_url":"https://api.github.com/users/NDobrev/followers","following_url":"https://api.github.com/users/NDobrev/following{/other_user}","gists_url":"https://api.github.com/users/NDobrev/gists{/gist_id}","starred_url":"https://api.github.com/users/NDobrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NDobrev/subscriptions","organizations_url":"https://api.github.com/users/NDobrev/orgs","repos_url":"https://api.github.com/users/NDobrev/repos","events_url":"https://api.github.com/users/NDobrev/events{/privacy}","received_events_url":"https://api.github.com/users/NDobrev/received_events","type":"User","site_admin":false},"body":"# What\r\n\r\n> Initial code generator\r\n\r\n# Who\r\n\r\n> Marto - 25192\r\nCheck\r\n\r\n- Do not commit binary files\r\n- Do not commit generated project files\r\n\r\n","created_at":"2018-11-15T09:46:04Z","updated_at":"2018-11-15T09:56:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c45c015cd2a770cecb0ebff974d574e547aea9a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49/commits","review_comments_url":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49/comments","review_comment_url":"https://api.github.com/repos/SofiaCPP/IPL/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SofiaCPP/IPL/issues/49/comments","statuses_url":"https://api.github.com/repos/SofiaCPP/IPL/statuses/637077d60045c97e4de1638146adf5e6ad88cb77","head":{"label":"SofiaCPP:code-gen","ref":"code-gen","sha":"637077d60045c97e4de1638146adf5e6ad88cb77","user":{"login":"SofiaCPP","id":11199931,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMTk5OTMx","avatar_url":"https://avatars0.githubusercontent.com/u/11199931?v=4","gravatar_id":"","url":"https://api.github.com/users/SofiaCPP","html_url":"https://github.com/SofiaCPP","followers_url":"https://api.github.com/users/SofiaCPP/followers","following_url":"https://api.github.com/users/SofiaCPP/following{/other_user}","gists_url":"https://api.github.com/users/SofiaCPP/gists{/gist_id}","starred_url":"https://api.github.com/users/SofiaCPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SofiaCPP/subscriptions","organizations_url":"https://api.github.com/users/SofiaCPP/orgs","repos_url":"https://api.github.com/users/SofiaCPP/repos","events_url":"https://api.github.com/users/SofiaCPP/events{/privacy}","received_events_url":"https://api.github.com/users/SofiaCPP/received_events","type":"Organization","site_admin":false},"repo":{"id":146637650,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY2Mzc2NTA=","name":"IPL","full_name":"SofiaCPP/IPL","private":false,"owner":{"login":"SofiaCPP","id":11199931,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMTk5OTMx","avatar_url":"https://avatars0.githubusercontent.com/u/11199931?v=4","gravatar_id":"","url":"https://api.github.com/users/SofiaCPP","html_url":"https://github.com/SofiaCPP","followers_url":"https://api.github.com/users/SofiaCPP/followers","following_url":"https://api.github.com/users/SofiaCPP/following{/other_user}","gists_url":"https://api.github.com/users/SofiaCPP/gists{/gist_id}","starred_url":"https://api.github.com/users/SofiaCPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SofiaCPP/subscriptions","organizations_url":"https://api.github.com/users/SofiaCPP/orgs","repos_url":"https://api.github.com/users/SofiaCPP/repos","events_url":"https://api.github.com/users/SofiaCPP/events{/privacy}","received_events_url":"https://api.github.com/users/SofiaCPP/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SofiaCPP/IPL","description":"Implementation of Programming Languages course","fork":false,"url":"https://api.github.com/repos/SofiaCPP/IPL","forks_url":"https://api.github.com/repos/SofiaCPP/IPL/forks","keys_url":"https://api.github.com/repos/SofiaCPP/IPL/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SofiaCPP/IPL/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SofiaCPP/IPL/teams","hooks_url":"https://api.github.com/repos/SofiaCPP/IPL/hooks","issue_events_url":"https://api.github.com/repos/SofiaCPP/IPL/issues/events{/number}","events_url":"https://api.github.com/repos/SofiaCPP/IPL/events","assignees_url":"https://api.github.com/repos/SofiaCPP/IPL/assignees{/user}","branches_url":"https://api.github.com/repos/SofiaCPP/IPL/branches{/branch}","tags_url":"https://api.github.com/repos/SofiaCPP/IPL/tags","blobs_url":"https://api.github.com/repos/SofiaCPP/IPL/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SofiaCPP/IPL/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SofiaCPP/IPL/git/refs{/sha}","trees_url":"https://api.github.com/repos/SofiaCPP/IPL/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SofiaCPP/IPL/statuses/{sha}","languages_url":"https://api.github.com/repos/SofiaCPP/IPL/languages","stargazers_url":"https://api.github.com/repos/SofiaCPP/IPL/stargazers","contributors_url":"https://api.github.com/repos/SofiaCPP/IPL/contributors","subscribers_url":"https://api.github.com/repos/SofiaCPP/IPL/subscribers","subscription_url":"https://api.github.com/repos/SofiaCPP/IPL/subscription","commits_url":"https://api.github.com/repos/SofiaCPP/IPL/commits{/sha}","git_commits_url":"https://api.github.com/repos/SofiaCPP/IPL/git/commits{/sha}","comments_url":"https://api.github.com/repos/SofiaCPP/IPL/comments{/number}","issue_comment_url":"https://api.github.com/repos/SofiaCPP/IPL/issues/comments{/number}","contents_url":"https://api.github.com/repos/SofiaCPP/IPL/contents/{+path}","compare_url":"https://api.github.com/repos/SofiaCPP/IPL/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SofiaCPP/IPL/merges","archive_url":"https://api.github.com/repos/SofiaCPP/IPL/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SofiaCPP/IPL/downloads","issues_url":"https://api.github.com/repos/SofiaCPP/IPL/issues{/number}","pulls_url":"https://api.github.com/repos/SofiaCPP/IPL/pulls{/number}","milestones_url":"https://api.github.com/repos/SofiaCPP/IPL/milestones{/number}","notifications_url":"https://api.github.com/repos/SofiaCPP/IPL/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SofiaCPP/IPL/labels{/name}","releases_url":"https://api.github.com/repos/SofiaCPP/IPL/releases{/id}","deployments_url":"https://api.github.com/repos/SofiaCPP/IPL/deployments","created_at":"2018-08-29T17:51:02Z","updated_at":"2018-11-15T09:35:49Z","pushed_at":"2018-11-15T09:46:04Z","git_url":"git://github.com/SofiaCPP/IPL.git","ssh_url":"git@github.com:SofiaCPP/IPL.git","clone_url":"https://github.com/SofiaCPP/IPL.git","svn_url":"https://github.com/SofiaCPP/IPL","homepage":"https://sofiacpp.github.io/IPL","size":2985,"stargazers_count":9,"watchers_count":9,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":19,"open_issues":11,"watchers":9,"default_branch":"master"}},"base":{"label":"SofiaCPP:master","ref":"master","sha":"c32eda4e697803824e79878c74d541b81fbd04d8","user":{"login":"SofiaCPP","id":11199931,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMTk5OTMx","avatar_url":"https://avatars0.githubusercontent.com/u/11199931?v=4","gravatar_id":"","url":"https://api.github.com/users/SofiaCPP","html_url":"https://github.com/SofiaCPP","followers_url":"https://api.github.com/users/SofiaCPP/followers","following_url":"https://api.github.com/users/SofiaCPP/following{/other_user}","gists_url":"https://api.github.com/users/SofiaCPP/gists{/gist_id}","starred_url":"https://api.github.com/users/SofiaCPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SofiaCPP/subscriptions","organizations_url":"https://api.github.com/users/SofiaCPP/orgs","repos_url":"https://api.github.com/users/SofiaCPP/repos","events_url":"https://api.github.com/users/SofiaCPP/events{/privacy}","received_events_url":"https://api.github.com/users/SofiaCPP/received_events","type":"Organization","site_admin":false},"repo":{"id":146637650,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY2Mzc2NTA=","name":"IPL","full_name":"SofiaCPP/IPL","private":false,"owner":{"login":"SofiaCPP","id":11199931,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMTk5OTMx","avatar_url":"https://avatars0.githubusercontent.com/u/11199931?v=4","gravatar_id":"","url":"https://api.github.com/users/SofiaCPP","html_url":"https://github.com/SofiaCPP","followers_url":"https://api.github.com/users/SofiaCPP/followers","following_url":"https://api.github.com/users/SofiaCPP/following{/other_user}","gists_url":"https://api.github.com/users/SofiaCPP/gists{/gist_id}","starred_url":"https://api.github.com/users/SofiaCPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SofiaCPP/subscriptions","organizations_url":"https://api.github.com/users/SofiaCPP/orgs","repos_url":"https://api.github.com/users/SofiaCPP/repos","events_url":"https://api.github.com/users/SofiaCPP/events{/privacy}","received_events_url":"https://api.github.com/users/SofiaCPP/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SofiaCPP/IPL","description":"Implementation of Programming Languages course","fork":false,"url":"https://api.github.com/repos/SofiaCPP/IPL","forks_url":"https://api.github.com/repos/SofiaCPP/IPL/forks","keys_url":"https://api.github.com/repos/SofiaCPP/IPL/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SofiaCPP/IPL/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SofiaCPP/IPL/teams","hooks_url":"https://api.github.com/repos/SofiaCPP/IPL/hooks","issue_events_url":"https://api.github.com/repos/SofiaCPP/IPL/issues/events{/number}","events_url":"https://api.github.com/repos/SofiaCPP/IPL/events","assignees_url":"https://api.github.com/repos/SofiaCPP/IPL/assignees{/user}","branches_url":"https://api.github.com/repos/SofiaCPP/IPL/branches{/branch}","tags_url":"https://api.github.com/repos/SofiaCPP/IPL/tags","blobs_url":"https://api.github.com/repos/SofiaCPP/IPL/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SofiaCPP/IPL/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SofiaCPP/IPL/git/refs{/sha}","trees_url":"https://api.github.com/repos/SofiaCPP/IPL/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SofiaCPP/IPL/statuses/{sha}","languages_url":"https://api.github.com/repos/SofiaCPP/IPL/languages","stargazers_url":"https://api.github.com/repos/SofiaCPP/IPL/stargazers","contributors_url":"https://api.github.com/repos/SofiaCPP/IPL/contributors","subscribers_url":"https://api.github.com/repos/SofiaCPP/IPL/subscribers","subscription_url":"https://api.github.com/repos/SofiaCPP/IPL/subscription","commits_url":"https://api.github.com/repos/SofiaCPP/IPL/commits{/sha}","git_commits_url":"https://api.github.com/repos/SofiaCPP/IPL/git/commits{/sha}","comments_url":"https://api.github.com/repos/SofiaCPP/IPL/comments{/number}","issue_comment_url":"https://api.github.com/repos/SofiaCPP/IPL/issues/comments{/number}","contents_url":"https://api.github.com/repos/SofiaCPP/IPL/contents/{+path}","compare_url":"https://api.github.com/repos/SofiaCPP/IPL/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SofiaCPP/IPL/merges","archive_url":"https://api.github.com/repos/SofiaCPP/IPL/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SofiaCPP/IPL/downloads","issues_url":"https://api.github.com/repos/SofiaCPP/IPL/issues{/number}","pulls_url":"https://api.github.com/repos/SofiaCPP/IPL/pulls{/number}","milestones_url":"https://api.github.com/repos/SofiaCPP/IPL/milestones{/number}","notifications_url":"https://api.github.com/repos/SofiaCPP/IPL/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SofiaCPP/IPL/labels{/name}","releases_url":"https://api.github.com/repos/SofiaCPP/IPL/releases{/id}","deployments_url":"https://api.github.com/repos/SofiaCPP/IPL/deployments","created_at":"2018-08-29T17:51:02Z","updated_at":"2018-11-15T09:35:49Z","pushed_at":"2018-11-15T09:46:04Z","git_url":"git://github.com/SofiaCPP/IPL.git","ssh_url":"git@github.com:SofiaCPP/IPL.git","clone_url":"https://github.com/SofiaCPP/IPL.git","svn_url":"https://github.com/SofiaCPP/IPL","homepage":"https://sofiacpp.github.io/IPL","size":2985,"stargazers_count":9,"watchers_count":9,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":19,"open_issues":11,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49"},"html":{"href":"https://github.com/SofiaCPP/IPL/pull/49"},"issue":{"href":"https://api.github.com/repos/SofiaCPP/IPL/issues/49"},"comments":{"href":"https://api.github.com/repos/SofiaCPP/IPL/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/SofiaCPP/IPL/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SofiaCPP/IPL/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/SofiaCPP/IPL/statuses/637077d60045c97e4de1638146adf5e6ad88cb77"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"NDobrev"}}