1<br />Beyond Annotations:A Proposal for Extensible Java(XJ)<br />Tony Clark, Thames Valley University<br />Paul Sammut, H...
2<br />Domain Specific Languages<br />Aims: to provide a tailored language; to support mixed languages; language evolution...
3<br />DSLs: Technology Problems<br />Communication: distributing new languages.<br />Integration: IDEs; Analysis Tools.<b...
4<br />DSLs: An OO Proposal<br />Syntax Classes<br />Modular: class-based language constructs.<br />Conservative: extends ...
5<br />Syntax Classes: DSL Architecture<br />package p.q;<br />import language java.syntax.grammar;<br />class mylang impl...
 nesting.
 conservative.
 standard.</li></li></ul><li>6<br />Example DSL Constructs<br />public Vector<Integer> add1(Vector<Integer> nums) {<br /> ...
7<br />Syntax Classes: Technologies<br />Grammars: basic library; synthesizes abstract syntax; various languages possible....
Upcoming SlideShare
Loading in...5
×

Scam 08

682

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
682
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Scam 08

  1. 1. 1<br />Beyond Annotations:A Proposal for Extensible Java(XJ)<br />Tony Clark, Thames Valley University<br />Paul Sammut, HSBC<br />James Willans, Ceteva<br />tony.clark@tvu.ac.uk<br />www.ceteva.com/home/tony.html<br />
  2. 2. 2<br />Domain Specific Languages<br />Aims: to provide a tailored language; to support mixed languages; language evolution.<br />Pros: declarative; maintenance; reuse; verification<br />Cons: specialist skills; no standard technology; lack of integration.<br />Technologies: macros; pre-processing; roll-your-own; chained calls.<br />
  3. 3. 3<br />DSLs: Technology Problems<br />Communication: distributing new languages.<br />Integration: IDEs; Analysis Tools.<br />Modularity: clear definition of syntax and semantics.<br />DSL Types: Internal and External.<br />Syntax (concrete and abstract): standard extension mechanisms.<br />
  4. 4. 4<br />DSLs: An OO Proposal<br />Syntax Classes<br />Modular: class-based language constructs.<br />Conservative: extends base language.<br />Fully Integrated: static; dynamic; IDE.<br />Standardized: syntax extension; AST manipulation; static processing; execution. <br />
  5. 5. 5<br />Syntax Classes: DSL Architecture<br />package p.q;<br />import language java.syntax.grammar;<br />class mylang implements java.syntax.AST {<br /> ... <br /> @grammar {<br /> // language definition<br /> }<br />}<br />import language p.q.mylang;<br />class C {<br /> void m(...) {<br /> ... <br /> @mylang {<br /> // Syntax and semantics defined<br /> // by class mylang.<br /> }<br /> }<br />}<br /><ul><li> modular.
  6. 6. nesting.
  7. 7. conservative.
  8. 8. standard.</li></li></ul><li>6<br />Example DSL Constructs<br />public Vector<Integer> add1(Vector<Integer> nums) {<br /> return<br /> @Cmp(x + 1) {<br /> int x <- nums<br /> };<br />}<br />@Reader CallReader {<br /> map(SVCL,ServiceCall)<br /> 4-18:CustomerName<br /> 19-23:CustomerID<br /> 24-27:CallTypeCode<br /> 28-35:DataOfCallString<br /> end<br /> map(USGE,Usage)<br /> 4-8:CustomerID<br /> 9-22:CustomerName<br /> 30-30:Cycle<br /> 31-36:ReadDate<br /> end<br /> do ServiceCall Usage <br />}<br />@EntityBean Order persistAs "ORDER_TABLE" {<br /> private int id persistAs "ORDER_ID" (get,set);<br /> private int address persistAs "SHIPPING_ADDRESS" (get,set);<br />}<br />
  9. 9. 7<br />Syntax Classes: Technologies<br />Grammars: basic library; synthesizes abstract syntax; various languages possible.<br />AST interface: factories; types; eval; compile;… <br />Quasi-quotes: working with concrete/abstract syntax: [| <o>.m(<a>,1) |]<br />Language: import; @; grammar; [| … |].<br />
  10. 10. 8<br />Review<br />Implemented in XMF: commercial tool; open-source (www.ceteva.com) <br />Superlanguages book: (www.ceteva.com/docs/Superlanguages.pdf) <br />DSLs require standard technology.<br />Open up Java to define new languages.<br />Issues: language interaction; IDE support; analysis tool requirements.<br />
  11. 11. 9<br />Statement<br />New languages and constructs can/should implement a standard interface to facilitate program analysis.<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×