CSI5112-Presentation-ElenaMihaiKuntalx

eyelashesnectarineSoftware and s/w Development

Nov 3, 2013 (4 years and 10 days ago)

87 views

Presented by:

Elena C.
Ciobanu

-

4187873

Mihai

V.
Ciobanu

-

4559971

Kuntal

Ghosh

-

6492501


Goals of DSL


Scope of tool support for the DSL


DSL definition overview


DSL creation technology selected


Editor design and sample usage


Foreseen impact of language evolution


Potential for analysis and/or code generation


Conclusions


A programming language with minimal
features and functionality for a particular area
of interest or domain.



Our DSL


Generate and create data charts (pie, bar etc.)


Very easy to use


No prior programming knowledge needed


Easy to learn and remember


DSLs can be implemented either by


Interpretation
or code
generation


A specific parser to process it



We have taken the first approach



Internal DSLs


Active Record Query Interface in Ruby on Rails


E
xample


client =
Client.find
(10)



External
DSLs
.


CSS







Xtext


Grammar
definition using regular expressions


Xtend


Mapping from
Xtext

to Java


Eclipse


Running environment




Keywords

Optional

chart

No

type

No

data

No

size

No

legend

Yes

rowkey

Yes

columnkey

Yes

axislabels

Yes

color

Yes


Regular Expressions


“In
computing, a regular expression provides a
concise and flexible means to "match" (specify and
recognize) strings of text, such as particular
characters, words, or patterns of characters
.”
(Wikipedia)


Syntax Examples


* (zero to many):

a*

“”


aaa
” “
aaaaaa
” “
ab



? (zero or one):

b?


bb



b



ab

“”


+ (one to many):

a+


“”


aaa
” “
aaaaaa
” “
ab



Xtend


Mapping from DSL grammar to Java code



Mapping


Template based


Java code entered in template is not parsed


Xtend

code maps
Xtext

to Java





JFreeCharts


Swing


Awt


Jcommon



Advantages


Extensible


Pre
-
built libraries



Java code evolution


Xtend

template adjustments



Grammar evolution


Xtext

file adjustments



Chart DSL


easy to use


e
xtendable


Eclipse IDE advantages


Auto
-
completion