{"id":2259,"date":"2019-09-19T08:18:14","date_gmt":"2019-09-19T12:18:14","guid":{"rendered":"http:\/\/codinggorilla.com\/?p=2259"},"modified":"2020-01-11T05:39:21","modified_gmt":"2020-01-11T10:39:21","slug":"updates-to-antlrvsix","status":"publish","type":"post","link":"http:\/\/165.227.223.229\/index.php\/2019\/09\/19\/updates-to-antlrvsix\/","title":{"rendered":"Updates to AntlrVSIX"},"content":{"rendered":"\n<p>I&#8217;ve been busy extending AntlrVSIX to include new features and correct bugs. Some of the things added with the 40 or so changes since the beginning of September are:<\/p>\n\n\n\n<ul><li>Persistent option settings;<\/li><li>Tagging of Java symbols using a symbol table;<\/li><li>Improved reformatter for languages;<\/li><li>Improved symbol click-on highlighter;<\/li><li>Improved co-existence with other extensions.<\/li><\/ul>\n\n\n\n<p><!--more--><\/p>\n\n\n\n<p>What is more important is that I&#8217;ve been settling on how to write attribute evaluation for the parse tree using Antlr&#8217;s Listener pattern, using a symbol table on the Java parse tree. If done in an unstructured, undisciplined, and ill informed manner, the code could become quite disastrous.<\/p>\n\n\n\n<p>For example, I looked for &#8220;listeners in parse tree traversal&#8221; and Google Search found in the top answers <a href=\"https:\/\/saumitra.me\/blog\/antlr4-visitor-vs-listener-pattern\/\">Saumitra&#8217;s blog<\/a>,  <a href=\"https:\/\/jakubdziworski.github.io\/java\/2016\/04\/01\/antlr_visitor_vs_listener.html\">Jakub Dziworski&#8217;s blog<\/a>, <a href=\"https:\/\/ocw.mit.edu\/ans7870\/6\/6.005\/s16\/classes\/18-parser-generators\/\">MIT OpenCouseWare page on Antlr<\/a>, <a aria-label=\"these lecture notes (opens in a new tab)\" href=\"http:\/\/blog.ptsecurity.com\/2016\/07\/tree-structures-processing-and-unified.html\">Positive Technoligies page on Antlr<\/a>, but there is no discussion of how this framework would be used in attribute evaluation, which is discussed nicely in <a rel=\"noreferrer noopener\" aria-label=\"these lecture notes (opens in a new tab)\" href=\"https:\/\/web.cs.ucdavis.edu\/~pandey\/Teaching\/ECS142\/Lects\/sem.pdf\" target=\"_blank\">these lecture notes<\/a>. As I&#8217;m not that disciplined to write a system to declare the formal semantic equations and an evaluator of those equations, I&#8217;ve settled to make sure to try to set attributes for a node within the node&#8217;s listener (either &#8220;enter&#8221; or &#8220;exit&#8221;). Otherwise, I wouldn&#8217;t know which listener is setting what attribute for a node. This is &#8220;basic&#8221; compiler stuff, but &#8220;basic&#8221; information gets lost when people start using these tools.<\/p>\n\n\n\n<p>All this is important, and will be eventually applied to the <a rel=\"noreferrer noopener\" aria-label=\"Piggy transformation system (opens in a new tab)\" href=\"https:\/\/github.com\/kaby76\/Piggy\" target=\"_blank\">Piggy transformation system<\/a>.<\/p>\n\n\n\n<p>More folks seem to be using it, maybe because there is a link from the <a href=\"https:\/\/www.antlr.org\/tools.html\">Antlr.org developer page<\/a> to the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=KenDomino.AntlrVSIX\">extension<\/a>.<\/p>\n\n\n\n<p>&#8211;Ken<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been busy extending AntlrVSIX to include new features and correct bugs. Some of the things added with the 40 or so changes since the beginning of September are: Persistent option settings; Tagging of Java symbols using a symbol table; Improved reformatter for languages; Improved symbol click-on highlighter; Improved co-existence with other extensions.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/2259"}],"collection":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/comments?post=2259"}],"version-history":[{"count":0,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/2259\/revisions"}],"wp:attachment":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/media?parent=2259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/categories?post=2259"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/tags?post=2259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}