{"id":10737,"date":"2020-12-31T17:13:13","date_gmt":"2020-12-31T08:13:13","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=10737"},"modified":"2020-12-31T17:16:46","modified_gmt":"2020-12-31T08:16:46","slug":"%e4%bb%8a%e5%b9%b4%e8%aa%ad%e3%82%93%e3%81%a7%e8%89%af%e3%81%8b%e3%81%a3%e3%81%9f%e6%9b%b8%e7%b1%8d%e3%81%af%e3%80%81%e3%80%8cgo%e8%a8%80%e8%aa%9e%e3%81%a7%e3%81%a4%e3%81%8f%e3%82%8b%e3%82%a4%e3%83%b3","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=10737","title":{"rendered":"\u4eca\u5e74\u8aad\u3093\u3067\u826f\u304b\u3063\u305f\u66f8\u7c4d\u306f\u3001\u300cGo\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u300d\u3067\u3057\u305f\u3002"},"content":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002<\/p>\n<p>\u3044\u3084\u3041\u3002\u3002<\/p>\n<p>2020\u5e74\u3082\u4eca\u65e5\u3067\u7d42\u308f\u308a\u3068\u8a00\u3046\u3053\u3068\u3067\u3001\u4eca\u5e74\u3082\u672c\u5f53\u306b\u3042\u3063\u3068\u8a00\u3046\u9593\u3060\u3063\u305f\u306a\u3041\u3002\u3068\u3044\u3063\u305f\u611f\u60f3\u3002<\/p>\n<p>\u4eca\u5e74\u306f\u4f55\u3088\u308a\u3001\u30b3\u30ed\u30ca\u306e\u8a71\u984c\u3067\u6301\u3061\u304d\u308a\u306e\u4e00\u5e74\u3067\u3057\u305f\u306d\u3002<\/p>\n<p>\u3053\u308c\u307e\u3067\u306b\u306a\u3044\u72b6\u6cc1\u306e\u4e2d\u3001\u8272\u3005\u3068\u5909\u5316\u3092\u6c42\u3081\u3089\u308c\u305f\u5e74\u306b\u306a\u308a\u307e\u3057\u305f\u306d\u3002<\/p>\n<p>\u4eca\u5e74\u306f\u4eca\u307e\u3067\u306b\u7121\u3044\u304f\u3089\u3044\u306b\u5bb6\u306b\u3044\u308b\u6642\u9593\u304c\u591a\u304b\u3063\u305f\u5e74\u3067\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u304a\u9670\u304b\u3001\u7a4d\u307f\u672c\u3068\u306a\u3063\u3066\u3044\u305f\u672c\u3092\u6d88\u5316\u3057\u3066\u3044\u304f\u3053\u3068\u3082\u51fa\u6765\u305f\u3057\u3001\u66f4\u306a\u308b\u7a4d\u307f\u672c\u3082\u5897\u3048\u3066\u884c\u304d\u307e\u3057\u305fw<\/p>\n<p>\u66f4\u306b\u3001\u7a4d\u307f\u30b2\u30fc\u30e0\u3082\u5897\u3048\u305f\u308a\u3068\u3002\u3002\u3068\u3001\u3044\u304f\u3089\u6642\u9593\u304c\u3042\u3063\u3066\u3082\u8db3\u308a\u306a\u3044\u304f\u3089\u3044\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u5f15\u304d\u7bed\u3082\u308b\u6642\u9593\u304c\u5897\u3048\u305f\u5e74\u3060\u3063\u305f\u304c\u3001\u307e\u3060\u307e\u3060\u3069\u3093\u3060\u3051\u3067\u3082\u5f15\u304d\u7bed\u3082\u308b\u306e\u304c\u5206\u304b\u3063\u305f\u5e74\u3067\u3057\u305fw<\/p>\n<p>&nbsp;<\/p>\n<p>\u305d\u3093\u306a\u4e2d\u3001\u7a4d\u307f\u306b\u7a4d\u307e\u308c\u305f\u6280\u8853\u66f8\u306e\u4e2d\u304b\u3089\u3001\u4eca\u5e74\u826f\u304b\u3063\u305f\u306a\u3041\u3068\u601d\u3063\u305f\u6280\u8853\u66f8\u7c4d\u30921\u518a\u3054\u7d39\u4ecb\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3059\u3002<\/p>\n<p>\u3068\u3001\u3059\u3067\u306b\u30bf\u30a4\u30c8\u30eb\u306b\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u30aa\u30e9\u30a4\u30ea\u30fc\u304b\u3089\u51fa\u7248\u3055\u308c\u3066\u3044\u308b\u300c<strong>Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf<\/strong>\u300d\u3067\u3057\u305f\u3002<\/p>\n<div id=\"rinkerid10739\" class=\"yyi-rinker-contents  yyi-rinker-tagid-246 yyi-rinker-postid-10739 yyi-rinker-img-m yyi-rinker-catid-134 \">\n\t<div class=\"yyi-rinker-box\">\n\t\t<div class=\"yyi-rinker-image\">\n\t\t\t\t\t\t\t<a href=\"https:\/\/www.amazon.co.jp\/dp\/4873118220?tag=panicdragon-22&#038;linkCode=ogi&#038;th=1&#038;psc=1\" rel=\"nofollow\" class=\"yyi-rinker-tracking\"  data-click-tracking=\"amazon_img 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\" data-vars-click-id=\"amazon_img 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/m.media-amazon.com\/images\/I\/51sLCPa8DBL._SL160_.jpg\"  width=\"124\" height=\"160\" class=\"yyi-rinker-main-img\" style=\"border: none;\"><\/a>\t\t\t\t\t<\/div>\n\t\t<div class=\"yyi-rinker-info\">\n\t\t\t<div class=\"yyi-rinker-title\">\n\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/www.amazon.co.jp\/dp\/4873118220?tag=panicdragon-22&#038;linkCode=ogi&#038;th=1&#038;psc=1\" rel=\"nofollow\" class=\"yyi-rinker-tracking\" data-click-tracking=\"amazon_title 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\" data-vars-amp-click-id=\"amazon_title 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\" >Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf<\/a>\t\t\t\t\t\t\t<\/div>\n\t\t\t<div class=\"yyi-rinker-detail\">\n\t\t\t\t\t\t\t<div class=\"credit-box\">created by&nbsp;<a href=\"https:\/\/oyakosodate.com\/rinker\/\" rel=\"nofollow noopener\" target=\"_blank\" >Rinker<\/a><\/div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"brand\">\u30aa\u30e9\u30a4\u30ea\u30fc\u30fb\u30b8\u30e3\u30d1\u30f3<\/div>\n\t\t\t\t\t\t\t<div class=\"price-box\">\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<ul class=\"yyi-rinker-links\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t                    <li class=\"amazonlink\">\n\t\t\t\t\t\t<a href=\"https:\/\/www.amazon.co.jp\/dp\/4873118220?tag=panicdragon-22&amp;linkCode=ogi&amp;th=1&amp;psc=1\" rel=\"nofollow\" class=\"yyi-rinker-link yyi-rinker-tracking\"  data-click-tracking=\"amazon 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\"  data-vars-amp-click-id=\"amazon 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\">Amazon<\/a>\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<li class=\"rakutenlink\">\n\t\t\t\t\t\t<a href=\"https:\/\/hb.afl.rakuten.co.jp\/hgc\/2cd584c0.7789074a.2cd584c1.9c3f8e52\/Rinker_o_20201231152234?pc=https%3A%2F%2Fsearch.rakuten.co.jp%2Fsearch%2Fmall%2Fgo%2B%25E3%2582%25A4%25E3%2583%25B3%25E3%2582%25BF%25E3%2583%2597%25E3%2583%25AA%25E3%2582%25BF%2F%3Ff%3D1%26grp%3Dproduct&amp;m=https%3A%2F%2Fsearch.rakuten.co.jp%2Fsearch%2Fmall%2Fgo%2B%25E3%2582%25A4%25E3%2583%25B3%25E3%2582%25BF%25E3%2583%2597%25E3%2583%25AA%25E3%2582%25BF%2F%3Ff%3D1%26grp%3Dproduct\" rel=\"nofollow\" class=\"yyi-rinker-link yyi-rinker-tracking\"  data-click-tracking=\"rakuten 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\"  data-vars-amp-click-id=\"rakuten 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\">\u697d\u5929\u5e02\u5834<\/a>\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<li class=\"yahoolink\">\n\t\t\t\t\t\t<a href=\"https:\/\/ck.jp.ap.valuecommerce.com\/servlet\/referral?sid=3670338&amp;pid=888118650&amp;vc_url=https%3A%2F%2Fshopping.yahoo.co.jp%2Fsearch%3Fp%3Dgo%2B%25E3%2582%25A4%25E3%2583%25B3%25E3%2582%25BF%25E3%2583%2597%25E3%2583%25AA%25E3%2582%25BF\" rel=\"nofollow\" class=\"yyi-rinker-link yyi-rinker-tracking\"  data-click-tracking=\"yahoo 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\"  data-vars-amp-click-id=\"yahoo 10739 Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\">Yahoo\u30b7\u30e7\u30c3\u30d4\u30f3\u30b0<\/a><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ad.jp.ap.valuecommerce.com\/servlet\/gifbanner?sid=3670338&pid=888118650\" height=\"1\" width=\"1\" border=\"0\">\t\t\t\t\t<\/li>\n\t\t\t\t                \t\t\t\t\t\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t<\/div>\n\t<\/div>\n<\/div>\n\n<p>\u8ca9\u58f2\u3055\u308c\u305f\u306e\u306f\u30012018\u5e746\u6708\u3067\u3001\u8a55\u4fa1\u3082\u9ad8\u304f\u8272\u3005\u3068\u8a71\u984c\u306b\u306a\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u4eca\u5e74\u3088\u3046\u3084\u304f\u8aad\u3081\u307e\u3057\u305f\u3002<\/p>\n<p>\u4f55\u3092\u3059\u308b\u672c\u306a\u306e\u304b\u3068\u8a00\u308f\u308c\u307e\u3059\u3068\u3001\u30bf\u30a4\u30c8\u30eb\u305d\u306e\u307e\u3093\u307e\u306a\u306e\u3067\u3059\u304c\u3001go\u8a00\u8a9e\u3067\u72ec\u81ea\u306eMonkey\u3068\u8a00\u308f\u308c\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u8a00\u8a9e\u3092\u4f5c\u6210\u3057\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u307e\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u4f5c\u6210\u3082\u884c\u3063\u305f\u4e8b\u304c\u306a\u304b\u3063\u305f\u79c1\u3068\u3057\u3066\u306f\u3001\u975e\u5e38\u306b\u5206\u304b\u308a\u3084\u3059\u304f\u70ba\u306b\u306a\u308b\u66f8\u7c4d\u3067\u3057\u305f\u3002<\/p>\n<p>\u540c\u3058\u3088\u3046\u306b\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u3084\u30b3\u30f3\u30d1\u30a4\u30e9\u30fc\u306a\u3069\u4f5c\u6210\u306e\u7d4c\u9a13\u306e\u306a\u3044\u65b9\u306a\u3069\u306b\u306f\u3001\u53d6\u308a\u639b\u304b\u308a\u3068\u3057\u3066\u306f\u5165\u308a\u3084\u3059\u3044\u5185\u5bb9\u3067\u304a\u52e7\u3081\u51fa\u6765\u308b\u66f8\u7c4d\u3067\u3059\u3002<\/p>\n<h4><strong>Go\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf<\/strong><\/h4>\n<p>\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3001<\/p>\n<ul>\n<li>C\u8a00\u8a9e\u306e\u69cb\u6587<\/li>\n<li>\u5909\u6570\u675f\u7e1b<\/li>\n<li>\u5909\u6570\u3068\u771f\u507d\u5024<\/li>\n<li>\u7b97\u8853\u5f0f<\/li>\n<li>\u7d44\u307f\u8fbc\u307f\u95a2\u6570<\/li>\n<li>\u7b2c\u4e00\u7d1a\u9ad8\u968e\u95a2\u6570<\/li>\n<li>\u30af\u30ed\u30fc\u30b8\u30e3\u30fc<\/li>\n<li>\u6587\u5b57\u5217\u30c7\u30fc\u30bf\u578b<\/li>\n<li>\u914d\u5217\u30c7\u30fc\u30bf\u578b<\/li>\n<li>\u30cf\u30c3\u30b7\u30e5\u30c7\u30fc\u30bf\u578b<\/li>\n<li>\u5b57\u53e5\u89e3\u6790\u5668<\/li>\n<li>\u69cb\u6587\u89e3\u6790\u5668<\/li>\n<li>\u62bd\u8c61\u69cb\u6587\u6728\uff08AST\uff09<\/li>\n<li>\u5185\u90e8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30b7\u30b9\u30c6\u30e0<\/li>\n<li>\u8a55\u4fa1\u5668<\/li>\n<\/ul>\n<p>\u3068\u8a00\u3063\u305f\u6a5f\u80fd\u3092\u6301\u3063\u305f\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u8a00\u8a9e\u300c<strong>monkey<\/strong>\u300d\u3092\u4f5c\u6210\u3057\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n<p><strong>1\u7ae0 \u5b57\u53e5\u89e3\u6790<\/strong><\/p>\n<p>\u307e\u305a\u3001\u5b57\u53e5\u89e3\u6790\u3067\u3059\u304c\u3001<\/p>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9 \u2192 \u30c8\u30fc\u30af\u30f3\u5217 \u2192 \u62bd\u8c61\u69cb\u6587\u6728<\/p>\n<p>\u3068\u8a00\u3063\u305f\u6d41\u308c\u3067\u89e3\u6790\u3067\u304d\u308b\u3088\u3046\u306b\u4f5c\u6210\u3057\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c8\u30fc\u30af\u30f3\u5217\u306f\u3001\u4ee5\u4e0b\u306e\u69d8\u306b\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">const (\r\nILLEGAL = &quot;ILLEGAL&quot;\r\nEOF = &quot;EOF&quot;&lt;\/code&gt;\r\n\r\n\/\/ \u8b58\u5225\u5b50 + \u30ea\u30c6\u30e9\u30eb\r\nIDENT = &quot;IDENT&quot; \/\/ add, foobar, x, y,...\r\nINT = &quot;INT&quot; \/\/ 123456\r\n\r\n\/\/ \u6f14\u7b97\u5b50\r\nASSIGN = &quot;=&quot;\r\n....\r\n)<\/pre>\n<p>\u3068\u8a00\u3063\u305f\u5177\u5408\u306b\u30c8\u30fc\u30af\u30f3\u5217\u3092\u4f5c\u6210\u3057\u3001\u5b57\u53e5\u89e3\u6790\u5668\u3092\u7528\u3044\u3066\u89e3\u6790\u3002<\/p>\n<p><strong>\u5b57\u53e5\u89e3\u6790\u5668\uff08\u30ec\u30ad\u30b5\u30fc\uff09<\/strong><\/p>\n<p>\u5b9a\u7fa9\u3057\u305f\u30c8\u30fc\u30af\u30f3\u5217\u3092\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u5b57\u53e5\u89e3\u6790\u5668\u3092\u4f5c\u6210\u3057\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">func (l *Lexer) NextToken() token.Token {\r\nvar tok token.Token&lt;\/code&gt;\r\n\r\nswitch l.ch {\r\ncase '+':\r\ntok = newToken(token.PLUS, l.ch)\r\ncase '-':\r\ntok = newToken(token.MINUS, l.ch)\r\n....<\/pre>\n<h5>2\u7ae0 \u69cb\u6587\u89e3\u6790<\/h5>\n<p>2\u7ae0\u306f\u69cb\u6587\u89e3\u6790\u306b\u53d6\u308a\u639b\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5185\u90e8<\/p>\n<ul>\n<li>\u69cb\u6587\u6728 Syntax Tree<\/li>\n<li>\u62bd\u8c61\u69cb\u6587\u6728 Abstract syntax tree AST<\/li>\n<\/ul>\n<p>\u30d1\u30fc\u30b5\u30fc\u30b8\u30a7\u30ec\u30ec\u30fc\u30bf\u306b\u95a2\u3059\u308b\u4e8b\u3001<\/p>\n<p>CFG\u306e\u8a18\u6cd5<\/p>\n<ul>\n<li>\u30d0\u30c3\u30ab\u30b9\u30ca\u30a6\u30a2\u8a18\u6cd5 Backus-Naur Form: BNF<\/li>\n<li>\u62e1\u5f35\u30d0\u30c3\u30ab\u30b9\u30ca\u30a6\u30a2\u8a18\u6cd5 Extended Backus-Naur Form: EBNF<\/li>\n<\/ul>\n<p>\u69cb\u6587\u89e3\u6790\uff12\u3064\u306e\u6226\u7565<\/p>\n<ul>\n<li>\u30c8\u30c3\u30d7\u30c0\u30a6\u30f3\u69cb\u6587\u89e3\u6790<\/li>\n<li>\u30dc\u30c8\u30e0\u30a2\u30c3\u30d7\u69cb\u6587\u89e3\u6790<\/li>\n<\/ul>\n<p>\u30c8\u30c3\u30d7\u30c0\u30a6\u30f3\u69cb\u6587\u89e3\u6790<\/p>\n<ul>\n<li>\u518d\u5e30\u4e0b\u964d\u69cb\u6587\u89e3\u6790 recursive descent parsing<\/li>\n<li>\u30a2\u30fc\u30ea\u30fc\u6cd5 Early parsing<\/li>\n<li>\u4e88\u6e2c\u7684\u69cb\u6587\u89e3\u6790 predictive parsing<\/li>\n<\/ul>\n<p>\u306a\u3069\u3068\u8a00\u3063\u305f\u89e3\u8aac\u306a\u3069\u3082\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u975e\u5e38\u306b\u89e3\u6790\u5668\u306b\u95a2\u3057\u3066\u70ba\u306b\u306a\u308b\u4e8b\u304c\u3044\u3063\u3071\u3044\u8a18\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u306e\u66f8\u7c4d\u3067\u306f\u3001\u518d\u5e30\u4e0b\u964d\u69cb\u6587\u89e3\u6790\u2192\u30c8\u30c3\u30d7\u30c0\u30a6\u30f3\u6f14\u7b97\u5b50\u512a\u5148\u9806\u4f4d\u306e\u65b9\u5f0f\u3068\u306a\u308a\u3001\u300cPratt\u69cb\u6587\u89e3\u6790\u300d\u3092\u30d9\u30fc\u30b9\u306bAST\u30ce\u30fc\u30c9\u3092\u69cb\u7bc9\u3067\u304d\u308b\u4ed5\u7d44\u307f\u3092\u4f5c\u3063\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n<h5>3\u7ae0 \u8a55\u4fa1<\/h5>\n<p>3\u7ae0\u3067\u306f\u3001REPL \u306e E\uff08eval\uff09 \u3068\u3057\u3066 Monkey \u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8a55\u4fa1\u3059\u308b\u8a55\u4fa1\u5668\u306e\u4f5c\u6210\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u95a2\u6570\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u3067Monkey\u306e\u57fa\u672c\u3092\u4f5c\u6210\u3057\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210\u3057\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u7ae0\u3092\u7d42\u3048\u305f\u9803\u306b\u306f\u3001\u7b2c\u4e00\u7d1a\u95a2\u6570\u3084\u30af\u30ed\u30fc\u30b8\u30e3\u30fc\u306e\u3088\u3046\u306a\u6a5f\u80fd\u307e\u3067\u5b9f\u88c5\u51fa\u6765\u3066\u3044\u307e\u3059\u3002<\/p>\n<h5>4\u7ae0 \u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306e\u62e1\u5f35<\/h5>\n<p>\u3053\u306e\u7ae0\u3067\u306f\u3001\u30c7\u30fc\u30bf\u578b\u3068\u95a2\u6570\u3001\u6587\u5b57\u5217\u3001\u914d\u5217\u3092\u5b57\u53e5\u89e3\u6790\u5668\u304b\u3089\u632f\u308a\u8fd4\u308a\u3001\u914d\u5217\u3084\u30cf\u30c3\u30b7\u30e5\u306a\u3069\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u304f\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3068\u3001\u3056\u3063\u304f\u308a\u8aac\u660e\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3082\u3063\u3068\u8a73\u7d30\u66f8\u3044\u3066\u3057\u307e\u3046\u3068\u3059\u3054\u304f\u9577\u304f\u306a\u308a\u305d\u3046\u306a\u306e\u3067\uff08\u9014\u4e2d\u3067\u6c17\u304c\u4ed8\u3044\u305f\uff09\u3001\u6539\u3081\u3066\u3044\u3064\u304b\u7e8f\u3081\u305f\u3044\u306a\u3068\u601d\u3046\u6b21\u7b2c\u3067\u3059\u3002<\/p>\n<h4>\u826f\u304b\u3063\u305f\u70b9<\/h4>\n<p>\u57fa\u672c\u7684\u306b\u306f\u3001\u5199\u7d4c\u3059\u308b\u3060\u3051\u3067\u6700\u5f8c\u306b\u306f\u3001\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u304c\u5b9f\u88c5\u51fa\u6765\u308b\u3068\u8a00\u3046\u6d41\u308c\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u826f\u304b\u3063\u305f\u306e\u304c\u3001\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a\u3067\u9032\u3081\u3066\u3044\u304f\u70b9\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3001<\/p>\n<p><strong>lexer\/lexer_test.go<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">func TestNextToken(t *testing.T) {\r\n    input := `=+(){},;`\r\n    \r\n    tests := &#x5B;]struct {\r\n        expectedType token.TokenType\r\n        expectedLiteral string\r\n    }{\r\n        {token.ASSIGN, \"=\"},\r\n        {token.PLUS, \"+\"},\r\n        {token.LPAREN, \"(\"},\r\n        ....<\/pre>\n<p>\u5931\u6557\uff08red\uff09\u306e\u30c6\u30b9\u30c8\u3092\u66f8\u304d\u3001\u6210\u529f\uff08green\uff09\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3068\u8a00\u3046\u6d41\u308c\u306a\u306e\u3067\u3001\u300c\u306a\u3093\u3067\u304b\u52d5\u304b\u306a\u3044\u300d\u3068\u8a00\u3063\u305f\u72b6\u6cc1\u304c\u3042\u307e\u308a\u767a\u751f\u305b\u305a\u306b\u3001\u3069\u3093\u3069\u3093\u9032\u3081\u3089\u308c\u3066\u3044\u3051\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3042\u3068\u3001\u4f55\u3088\u308a\u8981\u6240\u8981\u6240\u306e\u300c\u30a8\u30f3\u30ab\u30ec\u30c3\u30b8\u300d\u304c\u51c4\u3044w<\/p>\n<ul>\n<li>\u7d20\u6674\u3089\u3057\u3044\uff01<\/li>\n<li>\u7c21\u5358\u3060\uff01<\/li>\n<li>\u5b8c\u74a7\u3060\uff01<\/li>\n<li>\u96e3\u3057\u304f\u306a\u3044\u3002<\/li>\n<\/ul>\n<p>\u3059\u3050\u8a00\u3063\u3066\u304f\u308c\u307e\u3059w<\/p>\n<ul>\n<li>\u7d20\u6674\u3089\u3057\u3044\u30cb\u30e5\u30fc\u30b9<\/li>\n<\/ul>\n<p>\u3059\u3050\u3001\u826f\u3044\u30cb\u30e5\u30fc\u30b9\u304c\u5165\u308a\u307e\u3059\u3002w <\/p>\n<p>\u3053\u3046\u8a00\u3063\u305f\u611f\u3058\u3067\u80cc\u4e2d\u3092\u62bc\u3057\u3066\u3082\u3089\u3048\u308b\u4e8b\u3067\u3001\u6700\u5f8c\u307e\u3067\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u3092\u4e0b\u3052\u305a\u306b\u53d6\u308a\u639b\u304b\u308c\u307e\u3059\u3002<\/p>\n<p>\u3042\u3068\u3001Go\u8a00\u8a9e\u3068\u8a00\u3046\u306e\u304c\u826f\u304b\u3063\u305f\u3002Go\u8a00\u8a9e\u306e\u30b7\u30f3\u30d7\u30eb\u3055\u3092\u5341\u5206\u306b\u751f\u304b\u3057\u3001\u518d\u3073Go\u71b1\u304c\u51fa\u305f\u306e\u3082\u3053\u306e\u672c\u304d\u3063\u304b\u3051\u3067\u3057\u305f\u3002<\/p>\n<p>\u76ca\u3005\u3001Go\u8a00\u8a9e\u304c\u597d\u304d\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u6700\u5f8c\u307e\u3067\u5b8c\u6210\u3055\u305b\u308b\u6642\u9593\u304c\u4e01\u5ea6\u3044\u3044\u3068\u3053\u308d\u3067\u3059\u304b\u306d\u3002<\/p>\n<p>\u81ea\u5206\u306e\u5834\u5408\u306f10\u65e5\u9593\u304f\u3089\u3044\u3067\u3057\u305f\u3002\uff08git commit\u958b\u59cb\u304b\u3089\uff09<\/p>\n<p>\u3068\u8a00\u3046\u306e\u3082\u3001\u3053\u306e\u6642\u671f<strong>\u3081\u3061\u3083\u304f\u3061\u3083\u30b9\u30d7\u30e9\u30c8\u30a5\u30fc\u30f32\u306b\u30cf\u30de\u3063\u3066\u3044\u307e\u3057\u3066\uff08\u518d\u3073\uff09<\/strong>\u3001\u6bce\u65e52\u6642\u9593\u4ee5\u4e0a\u306f\u30d7\u30ec\u30a4\u3057\u3066\u3057\u307e\u3044\u3001\u305d\u306e\u7d50\u679c\u3001\u7dcf\u5408\u30d7\u30ec\u30a4\u6642\u9593\u304c400\u6642\u9593\u4ee5\u4e0a\u3068\u306a\u3063\u3066\uff08\u3082\u3046500\u6642\u9593\uff09\u3057\u307e\u3063\u305f\u306e\u3067\u3059\u304c\u3001<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10749\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/8116665A-CE0F-4A3C-83DA-9E686E23AF73-1024x955.jpg\" alt=\"\" width=\"319\" height=\"298\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/8116665A-CE0F-4A3C-83DA-9E686E23AF73-1024x955.jpg 1024w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/8116665A-CE0F-4A3C-83DA-9E686E23AF73-300x280.jpg 300w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/8116665A-CE0F-4A3C-83DA-9E686E23AF73-768x716.jpg 768w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/8116665A-CE0F-4A3C-83DA-9E686E23AF73.jpg 1125w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/p>\n<p>\u305d\u3093\u306a\u65e5\u3005\u306e\u4e2d\u9032\u3081\u3066\u3044\u3066\u308210\u65e5\u9593\u304f\u3089\u3044\u3060\u3063\u305f\u306e\u3067\u3001\u96c6\u4e2d\u3059\u308c\u30701\u9031\u9593\u3082\u3042\u308c\u3070\u7d42\u308f\u308b\u306e\u3067\u306f\u7121\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u307e\u305f\u3001\u305d\u3093\u306a\u4e2d\u3084\u3063\u3066\u3044\u305f\u306e\u3067\u3001\u899a\u3048\u3082\u4e2d\u9014\u534a\u7aef\u306a\u3068\u3053\u308d\u304c\u3042\u308b\u306e\u3067\u3001\u6765\u5e74\u306f\u5fa9\u7fd2\u3082\u517c\u306d\u3066\u96c6\u4e2d\u3057\u3066\u518d\u3073\u3084\u308a\u305f\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10750\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/b17664eefe5e60bc9dd1775db63e0894.png\" alt=\"\" width=\"218\" height=\"270\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/b17664eefe5e60bc9dd1775db63e0894.png 299w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2020\/12\/b17664eefe5e60bc9dd1775db63e0894-242x300.png 242w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/p>\n<p>\u3068\u8a00\u3046\u4e8b\u3067\u3001\u99c6\u3051\u8db3\u3067\u300cGo\u8a00\u8a9e\u3067\u3064\u304f\u308b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u300d\u3092\u7d39\u4ecb\u3055\u305b\u3066\u9802\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u6765\u5e74\u3001\u518d\u5ea6\u4f5c\u6210\u3057\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306e\u4ed5\u7d44\u307f\u3092\u7e8f\u3081\u305f\u8a18\u4e8b\u3092\u30a2\u30c3\u30d7\u3067\u304d\u308c\u3070\u3068\u601d\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u6765\u5e74\u3053\u305d\u306f\u3001\u672c\u6765\u4f5c\u6210\u3057\u305f\u304b\u3063\u305fOS\u3084\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u4f5c\u6210\u306b\u5165\u308c\u308c\u3070\u306a\u3041\u3068\u601d\u3046\u5927\u6666\u65e5\u3067\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u6765\u5e74\u3082\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\u30fc\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002 \u3044\u3084\u3041\u3002\u3002 2020\u5e74\u3082\u4eca\u65e5\u3067\u7d42\u308f\u308a\u3068\u8a00\u3046\u3053\u3068\u3067\u3001\u4eca\u5e74\u3082\u672c\u5f53\u306b\u3042\u3063\u3068\u8a00\u3046\u9593\u3060\u3063\u305f\u306a\u3041\u3002\u3068\u3044\u3063\u305f\u611f\u60f3\u3002 \u4eca\u5e74\u306f\u4f55\u3088\u308a\u3001\u30b3\u30ed\u30ca\u306e\u8a71\u984c\u3067\u6301\u3061\u304d\u308a\u306e\u4e00\u5e74\u3067\u3057\u305f\u306d\u3002 \u3053\u308c\u307e\u3067\u306b\u306a\u3044\u72b6\u6cc1\u306e\u4e2d\u3001\u8272\u3005\u3068\u5909\u5316\u3092\u6c42\u3081\u3089\u308c\u305f\u5e74\u306b\u306a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[134],"tags":[37,55,178,78,114,118],"class_list":["post-10737","post","type-post","status-publish","format-standard","hentry","category-134","tag-iphone-","tag-55","tag-178","tag-78","tag-114","tag-118"],"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/10737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10737"}],"version-history":[{"count":18,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/10737\/revisions"}],"predecessor-version":[{"id":10758,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/10737\/revisions\/10758"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}