Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7BB38200C08 for ; Thu, 26 Jan 2017 12:38:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7A627160B4C; Thu, 26 Jan 2017 11:38:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 750CF160B40 for ; Thu, 26 Jan 2017 12:38:56 +0100 (CET) Received: (qmail 54481 invoked by uid 500); 26 Jan 2017 11:38:55 -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 54471 invoked by uid 99); 26 Jan 2017 11:38:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2017 11:38:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id C7FA1C0B3C for ; Thu, 26 Jan 2017 11:38:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 5.573 X-Spam-Level: ***** X-Spam-Status: No, score=5.573 tagged_above=-999 required=6.31 tests=[FORGED_HOTMAIL_RCVD2=1.187, HTML_MESSAGE=2, KAM_UNSUB1=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id RhLWLg2Wn0ep for ; Thu, 26 Jan 2017 11:38:51 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 63A815F1F4 for ; Thu, 26 Jan 2017 11:38:50 +0000 (UTC) Received: from static.162.255.23.22.macminivault.com (unknown [162.255.23.22]) by mbob.nabble.com (Postfix) with ESMTP id 200D23B4B8D8 for ; Thu, 26 Jan 2017 03:20:18 -0800 (PST) Date: Thu, 26 Jan 2017 04:38:41 -0700 (MST) From: Daniel Sun To: dev@groovy.incubator.apache.org Message-ID: In-Reply-To: <131F8F2A-CC25-4359-957B-64E4E6B5B047@selskabet.org> References: <1426822655.1501632.1485425144062.JavaMail.zimbra@u-pem.fr> <6c44fa88-1ad2-5244-6add-111bde612cab@gmx.org> <131F8F2A-CC25-4359-957B-64E4E6B5B047@selskabet.org> Subject: =?UTF-8?Q?=E7=AD=94=E5=A4=8D:_About_the_"implies"_operator(GROOVY-2576)?= MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_43179_948635117.1485430721493" archived-at: Thu, 26 Jan 2017 11:38:57 -0000 ------=_Part_43179_948635117.1485430721493 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Jesper, As to the custom operator, I have an experimental branch to play with= it(https://github.com/danielsun1106/groovy-parser/tree/customOperator) = =F0=9F=98=89 If I=E2=80=99ve caught Jochen=E2=80=99s words, he wants a general app= roach to extend a grammar(not only operator). As far as I know, no approach= can deal with it. Thanks for your suggestion =F0=9F=98=8A Cheers, Daniel.Sun =E5=8F=91=E4=BB=B6=E4=BA=BA: Jesper Steen M=C3=B8ller [via Groovy] =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2017=E5=B9=B41=E6=9C=8826=E6=97=A5 19= :24 =E6=94=B6=E4=BB=B6=E4=BA=BA: Daniel Sun =E4=B8=BB=E9=A2=98: Re: About the "implies" operator(GROOVY-2576) Hi Jochen and Daniel Not entirely correct: There are some ways to extend a grammar with new oppe= rators, as demonstrated in http://stackoverflow.com/questions/29894457/dyna= mic-operator-tokens-in-antlr4 However, this still needs to happen before lexing and parsing, so you can't= "fix" it with an AST transformer. -Jesper On 26 Jan 2017, at 12.20, Daniel Sun <[hidden email]> wrote: Hi Jochen, We can enable or disable some rules in the antlr4 grammar, but no rule= s can be defined and enabled on the fly=E2=80=A6 as you know, the parser is= generated by antlr4. Cheers, Daniel.Sun =E5=8F=91=E4=BB=B6=E4=BA=BA: [hidden email] =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2017=E5=B9=B41=E6=9C=8826=E6=97=A5 19= :07 =E6=94=B6=E4=BB=B6=E4=BA=BA: [hidden email] =E4=B8=BB=E9=A2=98: Re: =E7=AD=94=E5=A4=8D: About the "implies" operator(GR= OOVY-2576) On 26.01.2017 11:13, Andres Almiray wrote: > Here's another idea: > > What if this new operator and other syntax changes were to be introduced > as parser/compiler plugins? compiler itself, sure we can do something here... but for the parser? Daniel, is it possible? I would be surprised if it is, but you never know ;= ) > This way the core syntax stays the same yet it may open the possibility > for certain groups to enhance the Groovy syntax according to their needs > without affecting everyone else. > > Don't how how feasible this is given that it requires changes to both > parser and compiler APIs. I have my doubts, since the parser is generated from a grammar bye Jochen ________________________________ If you reply to this email, your message will be added to the discussion be= low: http://groovy.329449.n5.nabble.com/About-the-implies-operator-GROOVY-2576-t= p5738035p5738119.html To unsubscribe from About the "implies" operator(GROOVY-2576), click here. NAML ________________________________ View this message in context: =E7=AD=94=E5=A4=8D: =E7=AD=94=E5=A4=8D: About= the "implies" operator(GROOVY-2576) Sent from the Groovy Dev mailing list archive at Nabble.com. ________________________________ If you reply to this email, your message will be added to the discussion be= low: http://groovy.329449.n5.nabble.com/About-the-implies-operator-GROOVY-2576-t= p5738035p5738122.html To unsubscribe from About the "implies" operator(GROOVY-2576), click here. NAML -- View this message in context: http://groovy.329449.n5.nabble.com/About-the-= implies-operator-GROOVY-2576-tp5738035p5738123.html Sent from the Groovy Dev mailing list archive at Nabble.com. ------=_Part_43179_948635117.1485430721493 Content-Type: text/html; charset=UTF8 Content-Transfer-Encoding: quoted-printable

Hi Jesper,

 

      = As to the custom operator, I have an experimental branch to play with it(https://github.com/dan= ielsun1106/groovy-parser/tree/customOperator)    😉

 

      = If I=E2=80=99ve caught Jochen=E2=80=99s words, he wants a general approach = to extend a grammar(not only operator). As far as I know, no approach can d= eal with it.

 

      = Thanks for your suggestion 😊

 

Cheers,

Daniel.Sun

=E5=8F=91=E4=BB= =B6=E4=BA=BA: [hidden e= mail]
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2017=E5=B9=B41= =E6=9C=8826=E6=97=A5 19:24=
=E6=94=B6=E4=BB=B6=E4=BA=BA: [hidden email]
=E4=B8=BB=E9=A2=98: Re: About the "implies" operator(GROOVY-2576)

 

Hi Jochen and Daniel

Not entirely correct: There are some ways to extend a gramm= ar with new opperators, as demonstrated in http://stackoverflow.com/= questions/29894457/dynamic-operator-tokens-in-antlr4
However, this still needs to happen before lexing and parsi= ng, so you can't "fix" it with an AST transformer.

-Jesper


On 26 Jan 2017, at 12.20, Daniel Sun <[hidden email]> wrote:

Hi Jochen,

&nbs= p;

   &n= bsp; We can enable or disable some rules in the antlr4 grammar, but no rule= s can be defined and enabled on the fly=E2=80=A6 as you know, the parser is= generated by antlr4.

&nbs= p;

Cheers,

Daniel.Sun

 

=E5= =8F=91=E4=BB=B6=E4=BA=BA: <a href=3D"x-msg://28/us= er/SendEmail.jtp?type=3Dnode&amp;node=3D5738120&amp;i=3D0" tar= get=3D"_top" rel=3D"nofollow" link=3D"external&quo= t; class=3D"">[hidden email]
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2017=E5= =B9=B41=E6=9C=8826=E6=97=A5 19:07
=E6=94=B6=E4=BB=B6=E4=BA=BA: <a href=3D"x-msg= ://28/user/SendEmail.jtp?type=3Dnode&amp;node=3D5738120&amp;i=3D1&q= uot; target=3D"_top" rel=3D"nofollow" link=3D"exte= rnal" class=3D"">[hidden email]
=E4=B8=BB=E9=A2=98: Re: =E7=AD=94=E5=A4=8D: About the "= implies" operator(GROOVY-2576)

 



On 26.01.2017 11:13, Andres Almiray wrote:
> Here's another idea:
>
> What if this new operator and other syntax changes were to be introduc= ed
> as parser/compiler plugins?

compiler itself, sure we can do something here... but for the parser?
Daniel, is it possible? I would be surprised if it is, but you never know ;= )

> This way the core syntax stays the same yet it may open the possibilit= y
> for certain groups to enhance the Groovy syntax according to their nee= ds
> without affecting everyone else.
>
> Don't how how feasible this is given that it requires changes to both =
> parser and compiler APIs.

I have my doubts, since the parser is generated from a grammar

bye Jochen



If you reply to this email, your= message will be added to the discussion below:
http://groovy.329449.n5.nabble.com/About-the-implies-o= perator-GROOVY-2576-tp5738035p5738119.html
To unsubscribe from About the "implies" operator(GROOVY-2576), click here.
NAML


View this message in context: =E7=AD=94=E5=A4=8D: =E7=AD=94=E5=A4=8D: About the "implies" opera= tor(GROOVY-2576)
Sent from the Groovy Dev mailing list archive at Nabble.com.




If you reply to this email, your message wi= ll be added to the discussion below:
http://groovy.329449.n5.nabble.com/About-the-implies-operator-GRO= OVY-2576-tp5738035p5738122.html
To unsubscribe from About the "implies" operator(GROOVY-2576), click here.
NAML
=09 =09 =09

View this message in context: =E7=AD=94= =E5=A4=8D: About the "implies" operator(GROOVY-2576)
Sent from the Groovy Dev mailing list archive at Nabble.com.
------=_Part_43179_948635117.1485430721493--