Return-Path: X-Original-To: apmail-groovy-dev-archive@minotaur.apache.org Delivered-To: apmail-groovy-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3D72B18729 for ; Fri, 11 Mar 2016 11:32:32 +0000 (UTC) Received: (qmail 5833 invoked by uid 500); 11 Mar 2016 11:32:32 -0000 Delivered-To: apmail-groovy-dev-archive@groovy.apache.org Received: (qmail 5799 invoked by uid 500); 11 Mar 2016 11:32:32 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 5789 invoked by uid 99); 11 Mar 2016 11:32:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2016 11:32:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 41B23180522 for ; Fri, 11 Mar 2016 11:32:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id sMugz1mZbx0m for ; Fri, 11 Mar 2016 11:32:29 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id EFF1E5F2C4 for ; Fri, 11 Mar 2016 11:32:28 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id n186so14539068wmn.1 for ; Fri, 11 Mar 2016 03:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=Dz6OHTPeWSX7Z9jGuyZOjRc4tEcoO5DRs191wT9n6Ew=; b=Y7RSERN1Q35oPMafch/zFPcrDd/E3WfdCqwEl7HL4a/C44JRmDpHpMGtAu4gZB4utx JjVlgonihCVLo6HGp0S3cOEwxotZKHiSKVUJwhcZWwjR/haCZH/3mQBrKM2wMAfa3SqG OWiLNg9YFUsCyoDy/Z/inS7LJANdWeif1bUSb7UsYcbXn3y2xHX8rdR9BjpAn2FUnJGe rOahTWRL7pYLSysJf4rX/PI+oqt/Mxjc01skxQauV3gMuPR05wzppz/XOvo6N2GeSF63 bZLZ8p+aa578eoDzghFG6psmhWybV4CjMtM+ZehBWp3xcXvjbtIT7ZHVN47R8DIaCr+k NotQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=Dz6OHTPeWSX7Z9jGuyZOjRc4tEcoO5DRs191wT9n6Ew=; b=O6gKz//NaAiyLlVYaeX2MTSSnmPBXUl8WNSoElbhC5CJiGbhR8d8aKc81jaLbhqQMj /JZy9OreyNdi9M6a78Bh56BkaCzj0t6zyso+xoBzyUpVilWw6VgHLZqfuliO7OkCz2Zj +e5IeGT3bGJFek/s8rdfMNbvE7HMYcHhZ0Wi75cfu+QjchoURN0R0vBlz7f0Hfsj1OpP AZbQafzlNWtjxJWPHob2Gksfr5VaS8lXrRZ+GwPcff5R56nJhPN6fwozf5gBDNzM0Zu8 rSaOyVzHjHI+GCAg1Sr4asY9mnotrV0CZ4FLOZYmy9xBiybe9DS2jRRxUrGuU+OII+D7 bcmg== X-Gm-Message-State: AD7BkJJ74EsQHPcaONwba9f3YDWXmO+EPtnEY30fbgTFtYoDJZb+wqHN9kYPP5WNVwWtWqycrfovbq8/Fdyc1g== MIME-Version: 1.0 X-Received: by 10.28.182.136 with SMTP id g130mr2375044wmf.10.1457695948441; Fri, 11 Mar 2016 03:32:28 -0800 (PST) Received: by 10.194.236.66 with HTTP; Fri, 11 Mar 2016 03:32:28 -0800 (PST) In-Reply-To: References: <29FC6596-94BC-4BE2-A9A9-2FA48680CC08@selskabet.org> Date: Fri, 11 Mar 2016 12:32:28 +0100 Message-ID: Subject: Re: More Antlr4-based Groovy parser status update From: Guillaume Laforge To: dev@groovy.apache.org Content-Type: multipart/alternative; boundary=001a114b14e032974b052dc4498e --001a114b14e032974b052dc4498e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yup, that would be great as metadata! On Fri, Mar 11, 2016 at 11:26 AM, Jesper Steen M=C3=B8ller wrote: > Hi Guillaume > > This is not covered by the current code, but it can be added. I guess thi= s > could be set as =E2=80=9Cmetadata=E2=80=9D on types, package, properties,= methods, and > fields? > > -Jesper > > On 11. mar. 2016, at 11.11, Guillaume Laforge wrote: > > By the way, I had a question (unrelated to the below thread, but related > to the grammar) :-) > > Do you keep the comment information? > It's something we've always said we should support, and it would > tremendously help making a less hackish groovydoc tool. > Having AST nodes for JavaDoc comments would really be great. > > Guillaume > > On Sun, Feb 28, 2016 at 12:55 PM, Jesper Steen M=C3=B8ller < > jesper@selskabet.org> wrote: > >> Hi Groovy-Dev >> >> Here=E2=80=99s another update on the progress on the Antlr4 parser, as m= aintained >> on *https://github.com/jespersm/groovy.git >> * (in the *antlr4* branch). >> To play with it, try: >> >> $ git clone -b antlr4 https://jespersm@github.com/jespersm/groovy.git >> $ cd groovy >> $ gradle -PuseAntlr4=3Dtrue console >> >> >> I=E2=80=99ve fixed a number of issues: >> >> - Support method pointer operator >> - Attributes/method/property names as strings/gstrings >> - Real support for unary plus and minus (mimics old parser=E2=80=99s >> behaviour) >> - Compilation units not ending with semicolon or newline >> - Slashy strings could span lines, confusing division statements and >> comments >> >> I can now explore the new grammar and AST building using the Console, >> which is fun, but it=E2=80=99s 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 =E2=80=98assert=E2=80=99 an= d for >> =E2=80=99super=E2=80=99-calls. The smaller issues currently are: >> >> - assert >> - super() >> - Full Unicode letter support for identifiers >> - Support identifiers as property names and map literal entry names >> >> >> The bigger issue is with converting the ASTBuilder to pure Java, a task = I >> havn=E2=80=99t started yet. Actually, this poses a different question fo= r 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. >> >> So you can help me with a couple of answers: >> >> - Memory: Is this an issue I should be focusing on =E2=80=94 and is t= here a >> test to baseline against? >> - I=E2=80=99ve 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-refact= ored >> Java grammar? >> >> >> -Jesper >> >> > > > -- > Guillaume Laforge > Apache Groovy committer & PMC Vice-President > Product Ninja & Advocate at Restlet > > Blog: http://glaforge.appspot.com/ > Social: @glaforge / Google+ > > > > --=20 Guillaume Laforge Apache Groovy committer & PMC Vice-President Product Ninja & Advocate at Restlet Blog: http://glaforge.appspot.com/ Social: @glaforge / Google+ --001a114b14e032974b052dc4498e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yup, that would be great as metadata!

On Fri, Mar 11, 2016 at 11:26 AM= , Jesper Steen M=C3=B8ller <jesper@selskabet.org> wrote:<= br>
= Hi Guillaume

This is not covered by the current co= de, but it can be added. I guess this could be set as =E2=80=9Cmetadata=E2= =80=9D on types, package, properties, methods, and fields?

-Jesper

On 11. mar. 2016, at 11.11, Guillaume Laforge <glaforge@gmail.com> wrote:
By the way, I had a question (unrelated to the = below thread, but related to the grammar) :-)

Do you kee= p the comment information?
It's something we've always sa= id we should support, and it would tremendously help making a less hackish = groovydoc tool.
Having AST nodes for JavaDoc comments would reall= y be great.

Guillaume

On Sun, Feb 28, 2016 at 12:55 PM, = Jesper Steen M=C3=B8ller <jesper@selskabet.org> wrote:
Hi Groo= vy-Dev

Here=E2=80=99s another update on the progress on = the Antlr4 parser, as maintained on=C2=A0https://github.com/jespersm/groovy.gi= t (in the antlr4 branch).
To play with it, try:

$ cd groovy
$ gradle -PuseAntlr4=3Dtrue c= onsole

I=E2=80=99ve fixed a number of= issues:
  • Support method pointer operator
  • Attribut= es/method/property names as strings/gstrings
  • Real support for unary= plus and minus (mimics old parser=E2=80=99s behaviour)
  • Compilation= units not ending with semicolon or newline
  • Slashy strings could sp= an lines, confusing division statements and comments
I = can now explore the new grammar and AST building using the Console, which i= s fun, but it=E2=80=99s very easy to find unsupported constructs. Mapping o= ut the full Groovy grammar from the documentation alone is quite a task. Ju= st today, I discovered lacking support for =E2=80=98assert=E2=80=99 and for= =E2=80=99super=E2=80=99-calls. The smaller issues currently are:
  • assert
  • super()
  • Full Unicode letter support =C2=A0f= or identifiers
  • Support identifiers as property names and map litera= l entry names

The bigger issue is with c= onverting the ASTBuilder to pure Java, a task I havn=E2=80=99t started yet.= Actually, this poses a different question for AST generation: Whether to s= witch from tree-walking the parse tree (so whole tree must be kept in memor= y), to the listener-based approach, where the AST is built mostly bottom-up= , ensuring smaller memory footprint.

So you can he= lp me with a couple of answers:
  • Memory: Is this an issue = I should be focusing on =E2=80=94 and is there a test to baseline against?<= /li>
  • I=E2=80=99ve 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-ref= actored Java grammar?
-Jesper




--
=
Gu= illaume Laforge
Apache Groovy committer & PMC Vice-President
Product Ninja & Advocate at Restlet





--
Guillaume Laforge
Apache Groovy committer & PMC Vice-Pre= sident
Product Ninja & Advocate at Restlet

--001a114b14e032974b052dc4498e--