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 <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 <realblue...@hotmail.com> 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 > > > > 发件人: [hidden email] <x-msg://28/user/SendEmail.jtp?type=node&node=5738120&i=0> > 发送时间: 2017年1月26日 19:07 > 收件人: [hidden email] <x-msg://28/user/SendEmail.jtp?type=node&node=5738120&i=1> > 主题: 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 > > <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 > <applewebdata://77214BBB-C69F-41EE-8751-D8A0B2937D8D>. > 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.