groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Schumacher" <PascalSchumac...@gmx.net>
Subject Aw: Re: More Antlr4-based Groovy parser status update
Date Mon, 29 Feb 2016 08:17:32 GMT
<html><head></head><body><div style="font-family: Verdana;font-size:
12.0px;"><div>
<div>Hi Jesper,</div>

<div>&nbsp;</div>

<div>sorry, but I do not know if there are reasons why the current grammar does not
allow &quot;--1&quot;?</div>

<div>&nbsp;</div>

<div>@Paul, Guillaume... I guess you can shed some light on this?</div>

<div>&nbsp;</div>

<div>-Pascal</div>

<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px
solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b>&nbsp;Montag, 29. Februar
2016 um 08:55 Uhr<br/>
<b>Von:</b>&nbsp;&quot;Jesper Steen M&oslash;ller&quot; &lt;jesper@selskabet.org&gt;<br/>
<b>An:</b>&nbsp;dev@groovy.apache.org<br/>
<b>Betreff:</b>&nbsp;Re: More Antlr4-based Groovy parser status update</div>

<div name="quoted-content">
<div>Hi Pascal,
<div>&nbsp;</div>

<div>Thank you, I&rsquo;d missed that one.</div>

<div>&nbsp;</div>

<div>Any thought on the validity of &ldquo;- -1&rdquo;?</div>

<div>&nbsp;</div>

<div>-Jesper</div>

<div>&nbsp;
<div>
<blockquote>
<div>On 28. feb. 2016, at 18.23, Pascal Schumacher &lt;<a href="pascalschumacher@gmx.net"
target="_parent">pascalschumacher@gmx.net</a>&gt; wrote:</div>
&nbsp;

<div>
<div>
<div class="moz-cite-prefix">Hi Jesper,<br/>
<br/>
thanks for the update. :) Nice to hear you are progressing.<br/>
<br/>
Concerning the ASTBuilder to Java conversion, there is a pull request with this at the old
repo <a class="moz-txt-link-freetext" href="https://github.com/groovy/groovy-core/pull/513"
target="_blank">https://github.com/groovy/groovy-core/pull/513</a><br/>
<br/>
Cheers,<br/>
Pascal<br/>
<br/>
Am 28.02.2016 um 12:55 schrieb Jesper Steen M&oslash;ller:</div>

<blockquote>Hi Groovy-Dev
<div>&nbsp;</div>

<div>Here&rsquo;s another update on the progress on the Antlr4 parser, as maintained
on&nbsp;<b><a href="https://github.com/jespersm/groovy.git" target="_blank">https://github.com/jespersm/groovy.git</a></b>
(in the <b>antlr4</b> branch).</div>

<div>To play with it, try:</div>

<div>&nbsp;</div>

<blockquote style="margin: 0 0 0 40.0px;border: none;padding: 0.0px;">
<div>&#36; git clone -b antlr4 <a href="https://jespersm@github.com/jespersm/groovy.git"
target="_blank">https://jespersm@github.com/jespersm/groovy.git</a></div>

<div>&#36; cd groovy</div>

<div>&#36; gradle -PuseAntlr4=true console</div>
</blockquote>

<div>&nbsp;</div>

<div>I&rsquo;ve fixed a number of issues:</div>

<div>
<ul>
	<li>Support method pointer operator</li>
	<li>Attributes/method/property names as strings/gstrings</li>
	<li>Real support for unary plus and minus (mimics old parser&rsquo;s behaviour)</li>
	<li>Compilation units not ending with semicolon or newline</li>
	<li>Slashy strings could span lines, confusing division statements and comments</li>
</ul>
</div>

<div>I can now explore the new grammar and AST building using the Console, which is
fun, but it&rsquo;s very easy to find unsupported constructs. Mapping out the full Groovy
grammar from the documentation alone is quite a task. Just today, I discovered lacking support
for &lsquo;assert&rsquo; and for &rsquo;super&rsquo;-calls. The smaller issues
currently are:</div>

<div>
<ul class="MailOutline">
	<li>assert</li>
	<li>super()</li>
	<li>Full Unicode letter support &nbsp;for identifiers</li>
	<li>Support identifiers as property names and map literal entry names</li>
</ul>
</div>

<div>&nbsp;</div>

<div>The bigger issue is with converting the ASTBuilder to pure Java, a task I havn&rsquo;t
started yet. Actually, this poses a different question for AST generation: Whether to switch
from tree-walking the parse tree (so whole tree must be kept in memory), to the listener-based
approach, where the AST is built mostly bottom-up, ensuring smaller memory footprint.</div>

<div>&nbsp;</div>

<div>So you can help me with a couple of answers:</div>

<div>
<ul class="MailOutline">
	<li>Memory: Is this an issue I should be focusing on &mdash; and is there a test
to baseline against?</li>
	<li>I&rsquo;ve discovered a small issue with unary syntax. Currently, nested unary
expressions are not supported without parenthesis: Try e.g. - -1 or + -1. Is this intentional,
or just an artifact of the precedence-refactored Java grammar?</li>
</ul>
</div>

<div>&nbsp;</div>

<div>-Jesper</div>

<div>&nbsp;</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>

Mime
View raw message