Hi Dimitris,
How about a modification to the third approach where instead of using a new keyword “pattern” we reuse the import but add an alias to the imported pattern:
—————————— import “file.epl” as “P”
rule AB2C transform ab : P!AB to c : C { ...}
——————————
it could identify that is an EPL through the extension and therefore accept the alias.
Send epsilon-dev mailing list submissions to epsilon-dev@xxxxxxxxxxxTo subscribe or unsubscribe via the World Wide Web, visit https://www.eclipse.org/mailman/listinfo/epsilon-devor, via email, send a message with subject or body 'help' to epsilon-dev-request@xxxxxxxxxxxYou can reach the person managing the list at epsilon-dev-owner@xxxxxxxxxxxWhen replying, please edit your Subject line so it is more specificthan "Re: Contents of epsilon-dev digest..."Today's Topics: 1. Support for patterns in Epsilon languages (Dimitris Kolovos)----------------------------------------------------------------------Message: 1Date: Thu, 6 Dec 2018 22:09:06 +0000From: Dimitris Kolovos <dimitris.kolovos@xxxxxxxxxx>To: Epsilon Project developer discussions <epsilon-dev@xxxxxxxxxxx>Subject: [epsilon-dev] Support for patterns in Epsilon languagesMessage-ID: <CAEs3cJgR_AKwveWXEJf2UhpdVUMCpOH5rD71L6XY7R=++BTnaQ@xxxxxxxxxxxxxx>Content-Type: text/plain; charset="UTF-8"Hi everyone,I've been thinking about how to provide better support for (EPL)patterns within other Epsilon languages for a while now. Currently, ife.g. an ETL transformation needs to make use of patterns, we need toencode the latter in an EPL program and then use ANT to run the EPLprogram, export pattern matches as a "model" and then use that modelin ETL. I'm considering three alternatives.The first one is to adapt the syntax of ETL, EGX etc. to directlyaccommodate patterns so that we can have rules like the following:rule AB2C transform a : A from: A.all b : B from: a.b to c : C { ... }The second option is to move support for patterns to EolModule so thatall Epsilon programs can also contain patterns, in which case thetransformation would be written as follows:pattern AB a: A from: A.all b: B from: a.b { ... }rule AB2C transform ab : P!AB to c : C { ...}The third option is to introduce a new keyword to all Epsilonlanguages through which we can invoke EPL e.g.patterns "AB.epl";rule AB2C transform ab : P!AB to c : C { ...}The main advantage of the first approach is that the syntax will bemore natural since it supports "unnamed" patterns while the mainargument for the second approach is that it should be much morestraightforward to implement. However both of these would potentiallybreak backwards compatibility as they add all the keywords of EPL toexisting languages. The third approach only needs one keyword("patterns"), but it feels a bit clunky.Any thoughts?Cheers,Dimitris-- Dimitris KolovosProfessor of Software EngineeringDepartment of Computer ScienceUniversity of Yorkhttp://www.cs.york.ac.uk/~dkolovosEMAIL DISCLAIMER http://www.york.ac.uk/docs/disclaimer/email.htm------------------------------_______________________________________________epsilon-dev mailing listepsilon-dev@xxxxxxxxxxxTo change your delivery options, retrieve your password, or unsubscribe from this list, visithttps://www.eclipse.org/mailman/listinfo/epsilon-devEnd of epsilon-dev Digest, Vol 46, Issue 2******************************************
|