Message-ID: <39580067.1307.1429927978531.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1306_1535633.1429927978530" ------=_Part_1306_1535633.1429927978530 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Guillaume Laforge and Paul King presented a session at SpringOne2GX on the various techni= ques for authoring DSLs, and integrating them in your applications.
Guillaume Laforge and John Wilson presented a tutorial on Groovy DSLs at the QCon 2007 conferenc= e in London.
Matt Secoske presented a session on Implementing DSLs in Groovy at the OSCON 2007 conference.
How to create your own dsl on groovy.
Groovy is particularly well suited for writing a DSL: Domain-Specific Language. A DSL is a mini-lan= guage aiming at representing constructs for a given domain. Groovy provides= various features to let you easily embed DSLs in your Groovy code:
Joachim Baumann wrote an article showing how to implement a small DSL for measurement calc= ulation, which uses some of the techniques like adding properties to nu= mbers, or overloading operators. Guillaume Laforge also wrote an article on= representing units using the JScienc= e library.
Andy Glover also plays with internal DSLs in Groovy by producing a behavior testing DSL.
Inspired by an article from Bruce Tate IBMs Alphaworks a couple of samples were written = in groovy.
If you have the need to write your own language completely, consider usi= ng a compiler compiler. There are many to choose from, e.g. Antlr, JavaCC, = SableCC, Coco/R, Cup/JLex/JFl;ex, BYacc/J, Beaver, etc. See wikipedia for an interesting list. Some of these can= even benefit from Groovy. Here is a groovy example for JParsec.