Hi Jesper, As to the custom operator, I have an experimental branch to play with it(https://github.com/danielsun1106/groovy-parser/tree/customOperator) 😉
If I’ve caught Jochen’s words, he wants a general approach to extend a grammar(not only operator). As far as I know, no approach can deal with it. Thanks for your suggestion 😊 Cheers, Daniel.Sun 发件人: Jesper Steen Møller [via Groovy]<mailto:ml-node+s329449n5738122...@n5.nabble.com> 发送时间: 2017年1月26日 19:24 收件人: Daniel Sun<mailto:realblue...@hotmail.com> 主题: Re: About the "implies" operator(GROOVY-2576) Hi Jochen and Daniel Not entirely correct: There are some ways to extend a grammar 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 parsing, so you can't "fix" it with an AST transformer. -Jesper On 26 Jan 2017, at 12.20, Daniel Sun <[hidden email]</user/SendEmail.jtp?type=node&node=5738122&i=0>> wrote: Hi Jochen, We can enable or disable some rules in the antlr4 grammar, but no rules can be defined and enabled on the fly… as you know, the parser is generated by antlr4. Cheers, Daniel.Sun 发件人: <a href="x-msg://28/user/SendEmail.jtp?type=node&node=5738120&i=0" target="_top" rel="nofollow" link="external" class="">[hidden email] 发送时间: 2017年1月26日 19:07 收件人: <a href="x-msg://28/user/SendEmail.jtp?type=node&node=5738120&i=1" target="_top" rel="nofollow" link="external" class="">[hidden email] 主题: Re: 答复: 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 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 below: http://groovy.329449.n5.nabble.com/About-the-implies-operator-GROOVY-2576-tp5738035p5738119.html To unsubscribe from About the "implies" operator(GROOVY-2576), click here. NAML<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> ________________________________ View this message in context: 答复: 答复: About the "implies" operator(GROOVY-2576)<http://groovy.329449.n5.nabble.com/About-the-implies-operator-GROOVY-2576-tp5738035p5738120.html> Sent from the Groovy Dev mailing list archive<http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html> at Nabble.com<http://Nabble.com>. ________________________________ If you reply to this email, your message will be added to the discussion below: http://groovy.329449.n5.nabble.com/About-the-implies-operator-GROOVY-2576-tp5738035p5738122.html To unsubscribe from About the "implies" operator(GROOVY-2576), click here<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5738035&code=cmVhbGJsdWVzdW5AaG90bWFpbC5jb218NTczODAzNXwxMTQ2MjE4MjI1>. NAML<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.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.