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 66E6610726 for ; Fri, 11 Mar 2016 17:21:43 +0000 (UTC) Received: (qmail 71090 invoked by uid 500); 11 Mar 2016 17:21:43 -0000 Delivered-To: apmail-groovy-dev-archive@groovy.apache.org Received: (qmail 71056 invoked by uid 500); 11 Mar 2016 17:21:43 -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 71037 invoked by uid 99); 11 Mar 2016 17:21:42 -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 17:21:42 +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 8B765180528 for ; Fri, 11 Mar 2016 17:21:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.18 X-Spam-Level: * X-Spam-Status: No, score=1.18 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, MIME_QP_LONG_LINE=0.001, 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=googlemail.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 moh10D_hcA4m for ; Fri, 11 Mar 2016 17:21:40 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 3D4525FB0D for ; Fri, 11 Mar 2016 17:21:40 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id l68so26207997wml.1 for ; Fri, 11 Mar 2016 09:21:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:content-transfer-encoding:mime-version:subject:message-id:date :references:in-reply-to:to; bh=SdLo4gJEkNqQRJ/d2gQi51tjb/EZ4AgXCUJGTCWqWKM=; b=I9d0euiYcEkYRdTAVu/T2EyzC/mxUNpHFSEgMDs1j0PQmyek5IdPS4uUo1Ifr555Wk Ksr7k6QRXkJ7EXPitmAfu5lUiXYAmLGG+DSuiCZcOYuak3zpUPotT3sHh1+wa9bNc3Zl fnJWCI2ONCfW++AVjO19H7a8aFrUY3AlAnNFN7irZsoePuGeutCI9/+R3GvkdfIm7kUH RTI3GNYPWkVv/VNpA3LWMLm+Dyfk1C8NZ7YxuCITbb8hN+LOOdXTuvOx8MWsJqLKnwqn tIE858zhxX/yTiXQUWeqiV2uWBlA0lzwDnHTGnzYHocmWhgVDUb67cP9xqu9CdtzR6WY Omtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:references:in-reply-to:to; bh=SdLo4gJEkNqQRJ/d2gQi51tjb/EZ4AgXCUJGTCWqWKM=; b=GcambFqz2zYdvVlDeQ6fRJqV8pQExYhZ28rVvsOATFY6/5xAqO0y+2lxlwm96dfjK+ GsEwNMc8xGdfYCp9juTtWPSEwIPMv9OkjMehL+HF101kZGyIBhgMTE46wzUyuB8inc7O 5qfj6OQ53PLMOBFncNYWN6+ybCfP5D+GYPeQ8kRI0WMvojXZUF80Zd/Pc0rcqu0mwkEG zphD+C3bsoTU+/PefNJWtKvK3dLIrBHeISnJUv7HD/TfP+yK5P3tx8ItP70vRQZGbZnM AC37CyjKWE0opGoSmBb+Eg94WkFEVhs0gKL/PUQTcIj9lf8adLOu8FcspuSJHP096LUC VI8A== X-Gm-Message-State: AD7BkJJT5vwoRsUZUnTXF89UyFZYBKWU2pOVHEwrZ2NDTWkXUvDdDQqHoz24LWLZ4nA3Fg== X-Received: by 10.194.238.34 with SMTP id vh2mr12473336wjc.157.1457716899755; Fri, 11 Mar 2016 09:21:39 -0800 (PST) Received: from [192.168.1.14] (ARennes-552-1-55-39.w92-135.abo.wanadoo.fr. [92.135.86.39]) by smtp.gmail.com with ESMTPSA id w125sm3191266wmw.18.2016.03.11.09.21.38 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Mar 2016 09:21:38 -0800 (PST) From: Jim Northrop Content-Type: multipart/alternative; boundary=Apple-Mail-7197446A-0DEE-4F11-9943-E99FBD1D745D Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Subject: Re: More Antlr4-based Groovy parser status update Message-Id: Date: Fri, 11 Mar 2016 18:21:37 +0100 References: <29FC6596-94BC-4BE2-A9A9-2FA48680CC08@selskabet.org> In-Reply-To: To: "dev@groovy.apache.org" X-Mailer: iPad Mail (12H321) --Apple-Mail-7197446A-0DEE-4F11-9943-E99FBD1D745D Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable +1 =F0=9F=91=8F Sent from my iPad > On 11 Mar 2016, at 11:11, Guillaume Laforge wrote: >=20 > By the way, I had a question (unrelated to the below thread, but related t= o the grammar) :-) >=20 > Do you keep the comment information? > It's something we've always said we should support, and it would tremendou= sly help making a less hackish groovydoc tool. > Having AST nodes for JavaDoc comments would really be great. >=20 > Guillaume >=20 >> On Sun, Feb 28, 2016 at 12:55 PM, Jesper Steen M=C3=B8ller wrote: >> Hi Groovy-Dev >>=20 >> Here=E2=80=99s another update on the progress on the Antlr4 parser, as ma= intained on https://github.com/jespersm/groovy.git (in the antlr4 branch). >> To play with it, try: >>=20 >> $ git clone -b antlr4 https://jespersm@github.com/jespersm/groovy.git >> $ cd groovy >> $ gradle -PuseAntlr4=3Dtrue console >>=20 >> 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 behavi= our) >> Compilation units not ending with semicolon or newline >> Slashy strings could span lines, confusing division statements and commen= ts >> I can now explore the new grammar and AST building using the Console, whi= ch is fun, but it=E2=80=99s very easy to find unsupported constructs. Mappin= g out the full Groovy grammar from the documentation alone is quite a task. J= ust 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 for identifiers >> Support identifiers as property names and map literal entry names >>=20 >> 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 for A= ST generation: Whether to switch from tree-walking the parse tree (so whole t= ree must be kept in memory), to the listener-based approach, where the AST i= s built mostly bottom-up, ensuring smaller memory footprint. >>=20 >> 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 there a= test to baseline against? >> I=E2=80=99ve discovered a small issue with unary syntax. Currently, neste= d unary expressions are not supported without parenthesis: Try e.g. - -1 or += -1. Is this intentional, or just an artifact of the precedence-refactored J= ava grammar? >>=20 >> -Jesper >=20 >=20 >=20 > --=20 > Guillaume Laforge > Apache Groovy committer & PMC Vice-President > Product Ninja & Advocate at Restlet >=20 > Blog: http://glaforge.appspot.com/ > Social: @glaforge / Google+ --Apple-Mail-7197446A-0DEE-4F11-9943-E99FBD1D745D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
+1 =F0=9F=91=8F

Sent from my iP= ad

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 keep the comment information?
It's something we've al= ways said we should support, and it would tremendously help making a less ha= ckish groovydoc tool.
Having AST nodes for JavaDoc comments would r= eally 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 maintained on https://github.com/jespersm/groovy.git= (in the antlr4 branch).
To play with it, try:

=
$ cd groovy
$ gradle -PuseAntlr4=3Dtrue console

I=E2=80=99ve fixed a number of issues:
  • Support method pointer operator
  • Attributes/method/pr= operty names as strings/gstrings
  • Real support for unary plus and min= us (mimics old parser=E2=80=99s behaviour)
  • Compilation units not end= ing with semicolon or newline
  • Slashy strings could span lines, confu= sing division statements and comments
I can now explore t= he 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 g= rammar from the documentation alone is quite a task. Just today, I discovere= d lacking support for =E2=80=98assert=E2=80=99 and for =E2=80=99super=E2=80=99= -calls. The smaller issues currently are:
  • assert
  • s= uper()
  • Full Unicode letter support  for identifiers
  • Sup= port identifiers as property names and map literal entry names

The bigger issue is with converting the ASTBuilder to p= ure Java, a task I havn=E2=80=99t started yet. Actually, this poses a differ= ent question for AST generation: Whether to switch from tree-walking the par= se tree (so whole tree must be kept in memory), to the listener-based approa= ch, where the AST is built mostly bottom-up, ensuring smaller memory footpri= nt.

So you can help me with a couple of answers:
  • Memory: Is this an issue I should be focusing on =E2=80=94 a= nd is there a test to baseline against?
  • I=E2=80=99ve discovered a sm= all issue with unary syntax. Currently, nested unary expressions are not sup= ported without parenthesis: Try e.g. - -1 or + -1. Is this intentional, or j= ust an artifact of the precedence-refactored Java grammar?

-Jesper




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

=
= --Apple-Mail-7197446A-0DEE-4F11-9943-E99FBD1D745D--