{"action":"created","issue":{"url":"https://api.github.com/repos/swmaestro06-apus/apus/issues/110","labels_url":"https://api.github.com/repos/swmaestro06-apus/apus/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/swmaestro06-apus/apus/issues/110/comments","events_url":"https://api.github.com/repos/swmaestro06-apus/apus/issues/110/events","html_url":"https://github.com/swmaestro06-apus/apus/issues/110","id":103239640,"number":110,"title":"struct variable 구현","user":{"login":"namhyung","id":48503,"avatar_url":"https://avatars.githubusercontent.com/u/48503?v=3","gravatar_id":"","url":"https://api.github.com/users/namhyung","html_url":"https://github.com/namhyung","followers_url":"https://api.github.com/users/namhyung/followers","following_url":"https://api.github.com/users/namhyung/following{/other_user}","gists_url":"https://api.github.com/users/namhyung/gists{/gist_id}","starred_url":"https://api.github.com/users/namhyung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namhyung/subscriptions","organizations_url":"https://api.github.com/users/namhyung/orgs","repos_url":"https://api.github.com/users/namhyung/repos","events_url":"https://api.github.com/users/namhyung/events{/privacy}","received_events_url":"https://api.github.com/users/namhyung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-26T11:08:26Z","updated_at":"2015-08-26T11:29:07Z","closed_at":null,"body":"사용자 정의 타입 (struct)을 지원하기 위한 variable/value 타입을 구현합니다. 기존의 DataType을 이용하여 struct 내부에 대한 variable/value 처리를 재귀적으로 할 수 있어야 합니다.\r\n\r\n```\r\nstruct foo {\r\n  u8 c\r\n}\r\n\r\nstruct bar {\r\n  struct foo b\r\n}\r\n\r\nvar bar a\r\na.b.c = 1\r\n```"},"comment":{"url":"https://api.github.com/repos/swmaestro06-apus/apus/issues/comments/134956229","html_url":"https://github.com/swmaestro06-apus/apus/issues/110#issuecomment-134956229","issue_url":"https://api.github.com/repos/swmaestro06-apus/apus/issues/110","id":134956229,"user":{"login":"namhyung","id":48503,"avatar_url":"https://avatars.githubusercontent.com/u/48503?v=3","gravatar_id":"","url":"https://api.github.com/users/namhyung","html_url":"https://github.com/namhyung","followers_url":"https://api.github.com/users/namhyung/followers","following_url":"https://api.github.com/users/namhyung/following{/other_user}","gists_url":"https://api.github.com/users/namhyung/gists{/gist_id}","starred_url":"https://api.github.com/users/namhyung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namhyung/subscriptions","organizations_url":"https://api.github.com/users/namhyung/orgs","repos_url":"https://api.github.com/users/namhyung/repos","events_url":"https://api.github.com/users/namhyung/events{/privacy}","received_events_url":"https://api.github.com/users/namhyung/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T11:29:07Z","updated_at":"2015-08-26T11:29:07Z","body":"```\r\nVariable::Variable(char *name, DataType dt) {\r\n  child_ = map;\r\n  for each item in dt->map\r\n    child_[item.name] = new Variable(item.name, item.type);\r\n}\r\n\r\nMemberExpression::MemberExpression(char *ref) {\r\n  ref_ = ref;  /* ref = \"a.b.c\" */\r\n}\r\n\r\nMemberExpression::Evaluate(context) {\r\n  table = context->var_table\r\n  for each member in ref_.split(\".\")\r\n    var = table->find(member)\r\n    table = var->child_\r\n  var.Evaluate(context)\r\n}\r\n```"}}