Am 10.01.2018 um 15:35 schrieb Mohan Radhakrishnan:
Hi,
I didn't know Groovy DSL's could be almost like plain english as
shown in
http://docs.groovy-lang.org/docs/latest/html/documentation/core-domain-specific-languages.html
<http://docs.groovy-lang.org/docs/latest/html/documentation/core-domain-specific-languages.html>
Is that the latest recommendation ? My use case is this.
I would like to create a small library to create XPath
axes(https://www.w3schools.com/xml/xpath_axes.asp
<https://www.w3schools.com/xml/xpath_axes.asp>) using a DSL.
Something like this.
>
id of ancestor of descendant of Node
This is just to create a more flexible way of using XPath expressions. I
don't plan to completely implement all expressions. Just a few.
DSLs are always depending on who is going to use them. If they know
Xpath a bit, then GPath:
http://groovy-lang.org/processing-xml.html#_gpath would be my
recommendation. Your suggestion for example is different than the often
used top-down approach and is instead bottom-up. This can lead to a
problem if your target audience is not used to that. On the other hand
this can be exactly right... It really depends. Who is going to use it.
bye Jochen