{"id":99,"date":"2009-02-21T16:53:30","date_gmt":"2009-02-21T14:53:30","guid":{"rendered":"http:\/\/www.coolbasic.com\/blog\/?p=99"},"modified":"2009-02-21T16:53:30","modified_gmt":"2009-02-21T14:53:30","slug":"pass2-is-looming-just-behind-the-corner","status":"publish","type":"post","link":"https:\/\/www.coolbasic.com\/blog\/2009\/02\/21\/pass2-is-looming-just-behind-the-corner\/","title":{"rendered":"Pass#2 is looming just behind the corner"},"content":{"rendered":"<p>All those 64 parsers of Pass#1 have now been written and tested. And that&#8217;s a lot of code! Virtually every statement has now had its parser implemented, even though some of those statements will probably be disabled for the first few alpha releases. I&#8217;m kind of relieved as I&#8217;ve now reached a &#8220;check point&#8221; in the development process. Yet there&#8217;s a lot more to come. All in all, I think it&#8217;s safe to say that I&#8217;m closing in the halfway of the entire compiler now that Pass#1 is ready. The compiler made it through the baptism of fire, by properly parsing a few-hundred lines long complete test class source code.<\/p>\n<p>This means that given the source code of a random test program, the compiler has now performed syntax checks for all elements of it, and that there&#8217;s now a complete symbol table for Pass#2 to play with. All metadata has now been gathered&#8230; Pass#2 has all the info it needs in order to complete the transformation into the Intermediate Language. If Pass#1 was essentially the Parser, then you can consider Pass#2 the actual Compiler; Its main job is to process the executable code within procedures &#8211; and to order it in a meaningful way. Pass#2 is a very, VERY complex process, and it has a lot more tasks than Pass#1 had. I have already assembled a list of those tasks, but I&#8217;m not going to share it just yet. I&#8217;d rather divide them into smaller topics and discuss them separately in future blog entries.<\/p>\n<p>There are few preceding steps before Pass#2 can start crunching the procedure code. One of them is Interface merging and the other is the pre-evaluation of constant value expressions. The latter is probably more challenging with all this circular reference thing going on. Other &#8220;difficult&#8221; parts of Pass#2 include Name Resolution, Overload Resolver and the actual Expression Transformer. More about those later. All I wanted to say, was that there&#8217;s much work to be done, and it&#8217;s getting more difficult now. Bleh, I&#8217;m probably going to be spending even more time just thinking things through before implementation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>All those 64 parsers of Pass#1 have now been written and tested. And that&#8217;s a lot of code! Virtually every statement has now had its parser implemented, even though some of those statements will probably be disabled for the first few alpha releases. I&#8217;m kind of relieved as I&#8217;ve now reached a &#8220;check point&#8221; in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[5,8],"_links":{"self":[{"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/posts\/99"}],"collection":[{"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/comments?post=99"}],"version-history":[{"count":0,"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/media?parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/categories?post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coolbasic.com\/blog\/wp-json\/wp\/v2\/tags?post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}