{"id":750,"date":"2009-06-12T06:34:17","date_gmt":"2009-06-12T05:34:17","guid":{"rendered":"http:\/\/fiber-space.de\/wordpress\/?p=750"},"modified":"2009-06-12T06:34:17","modified_gmt":"2009-06-12T05:34:17","slug":"is-parsing-perl-really-impossible","status":"publish","type":"post","link":"http:\/\/fiber-space.de\/wordpress\/2009\/06\/12\/is-parsing-perl-really-impossible\/","title":{"rendered":"Is parsing Perl really impossible?"},"content":{"rendered":"<p>I just read this <a href=\"http:\/\/www.perlmonks.org\/?node_id=663393\">article<\/a> about the apparent inability to parse Perl 5.<\/p>\n<p>There is an underlying assumption that a parser has to resolve all ambiguities and derive a single parse tree from an expression ( giving a unique interpretation ). But instead of demanding the value of an expression in order to parse it the parser might derive multiple parse trees and insert them as child nodes into a new parse tree representing a conditional expression. So the parser can just inflate the parse tree structure and do its job.<\/p>\n<p>Whether or not the conditional expression can be computed at runtime doesn&#8217;t have to bother the compiler developer. It is just another function call and no more dubious then an arbitrary function call in a conditional expression<\/p>\n<pre lang=\"C\">if(foo())\r\n    printf(\"foo() is true\\n\");\r\nelse\r\n    printf(\"foo() is false\\n\");<\/pre>\n<p>So it makes sense to fix requirements to a parser before giving proofs of their impossibility.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just read this article about the apparent inability to parse Perl 5. There is an underlying assumption that a parser has to resolve all ambiguities and derive a single parse tree from an expression ( giving a unique interpretation &hellip; <a href=\"http:\/\/fiber-space.de\/wordpress\/2009\/06\/12\/is-parsing-perl-really-impossible\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,23],"tags":[],"_links":{"self":[{"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/posts\/750"}],"collection":[{"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/comments?post=750"}],"version-history":[{"count":11,"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/posts\/750\/revisions"}],"predecessor-version":[{"id":761,"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/posts\/750\/revisions\/761"}],"wp:attachment":[{"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/media?parent=750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/categories?post=750"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fiber-space.de\/wordpress\/wp-json\/wp\/v2\/tags?post=750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}