This presentation describes the use and design of textural domain specific language - DSL. It has two basic purposes:
Introduce you to some of the more important design criteria in language design
Introduce you to BNF
This presentation is developed for MDD 2010 course at ITU, Denmark.
Template driven code generation tool, fore real time and safety critical systems.
API message formating and serialisation.
Template driven source code generator for any language : Ada, C, C#, Java, ...
Lexical Analysis, Tokens, Patterns, Lexemes, Example pattern, Stages of a Lexical Analyzer, Regular expressions to the lexical analysis, Implementation of Lexical Analyzer, Lexical analyzer: use as generator.
Template driven code generation tool, fore real time and safety critical systems.
API message formating and serialisation.
Template driven source code generator for any language : Ada, C, C#, Java, ...
Lexical Analysis, Tokens, Patterns, Lexemes, Example pattern, Stages of a Lexical Analyzer, Regular expressions to the lexical analysis, Implementation of Lexical Analyzer, Lexical analyzer: use as generator.
Building scalable and language independent java services using apache thriftTalentica Software
This presentation is about the key challenges of cross language interactions and how they can be overcome. We discuss the Apache Thrift as a solution and understand its principle of Operation with code snippets and examples.
Explanation of what DSLs are with slight shift towards MPS.
Slides from my talk at Deutsche Bank.
There is nothing particulary new in these slides, there are mostly based on Martin Fowler talks and book (http://www.martinfowler.com/dslwip/).
Before 1975 writing a compiler was a very time-consuming process. Then Lesk [1975] and Johnson published papers on lex and YACC. These utilities/components greatly simplify compiler writing. We’ve used flex and bison to compile the code.
This is a very old presentation but if you gloss over the usage of VB6 there is plenty of value. I presented this to the VBUG Annual Conference in 2003.
L0043 - Interfacing to Eclipse Standard ViewsTonny Madsen
Eclipse contains a large number of standard views that can be extended to support new languages or data models. This model focus on the interface to the most common Eclipse views: Problems View, Outline View, and the Properties View.
The graphical sub-system of the Eclipse platform is made up of two components: SWT, the Standard Widget Toolkit ;and JFace, an architecture-independent modeling layer. This module describes how JFace extends SWT with viewers, commands, wizards, dialogs, and field assist.
An overview of the code that makes up the skeleton of a basic RCP application. This includes the basics for advisors and perspectives. This module also describes the basics of how to launch and debug an RCP application.
L0018 - SWT - The Standard Widget ToolkitTonny Madsen
The graphical sub-system of the Eclipse platform is made up of two components: SWT, the Standard Widget Toolkit; and JFace, an architecture independent modeling layer. This module describes how to use SWT in views and editors and how different resources must be managed.
L0016 - The Structure of an Eclipse Plug-inTonny Madsen
This is a detailed description of the different parts that makes up an Eclipse plug-in. The module focuses on the purpose of the different files of a plug-in such as plugin.xml and the OSGi manifest file, MANIFEST.MF. The module also describes how plug-ins are developed in Eclipse with PDE, the Plug-in Development Environment
L0001 - The Terminology of the Eclipse PlatformTonny Madsen
This is a basic walk-through of all the central concepts of the Eclipse platform and how these fit together. The primary goal of this module is to establish a common terminology.
EclipseCon '11 - Using Adapters to Handle Menus and Handlers in Large Scale A...Tonny Madsen
How do you effectively control commands, menus and handlers in a large pluggable application to get a consistent use of the commands across the complete application? This is definitely one of the areas where the Eclipse IDE is not a good sample application. Just notice how all team providers add commands with the same text and function and how multiple identical menu items some times show up...
Here the Adapter framework of Eclipse can be a big help if used properly.
While the Adapter framework arguably is one of the more difficult to understand and use properly, the is also a framework that will solve many of the problems you might face is larger non-trivial applications. Especially when used in conjunction with the menus extension point and handlers. This presentation will show how to use the adapter framework of the Eclipse framework with special emphasis on the menus and handlers.
For PROSA:
Onsdag 26.1. Introduktion til Eclipse
Eclipse er et fremstormende open source-udviklingsmiljø (Eclipse IDE), der oprindeligt er udviklet med henblik på Java.
Kom og mød Tonny Madsen, formand for Eclipse Danmark, foreningen for både professionelle, virksomheder og brugere.
Tonny er til daglig direktør i RCP Company, der har specialiseret sig i udvikling, uddannelse og konsulentydelser inden for Eclipse.
Han vil give jer et overblik over platformen, både teknisk, projektmæssigt, organisering, muligheder, fremtiden etc.
ITU - MDD – Model-to-Model TransformationsTonny Madsen
This presentation describes the use Model-to-Model transformations (M2M). It focus on the why, what and how.
This presentation is developed for MDD 2010 course at ITU, Denmark.
”Medbring din laptop, netbook, mac el.lign. og få i løbet af denne workshop dine første hands-on erfaringer med Eclipse.”
Arrangement for IDA.
In Danish
IDA - Fra forretningside til bundlinie: Eclipse følger dig hele vejen (In Dan...Tonny Madsen
”Har du tænkt på at skifte til et leverandøruafhængigt udviklingsmiljø? Det er gratis, og du får ét udviklingsmiljø, som du kan programmere alt fra Java, C, C++ og PHP til databaser og webserver i. Vi får dig til at se værdien af værktøjet, og se flere forskellige eksempler på brugen af Eclipse i praksis.
Kom og hør formanden for eclipse.dk, Tonny Madsen, Direktør, RCP Kompaniet fortælle om Eclipse.
Eclipse er component-baseret, og du får indsigt i hvordan du sammensætter Eclipse til netop dine behov.”
In Danish
This presentation describes Eclipse Modeling Framework – EMF. It has two basic purposes:
Introduce you to the EMF techniques needed in the rest of the course
Introduce you to the architecture and components of the EMF project
This presentation is developed for MDD 2010 course at ITU, Denmark.
This presentation shows how Eclipse plug-ins are developed. It has two purposes:
Introduce you to the architecture and techniques of a major component based application
Introduce you to basic Eclipse plug-in development – this will hopefully ease the needed programming in the rest of the course
This presentation is developed for MDD 2010 course at ITU, Denmark.
This presentation describes the use of XText.
This presentation assumes a good knowledge of Data Modeling and Grammars as previously presented.
This presentation is developed for MDD 2010 course at ITU, Denmark.
eclipse.dk - Eclipse RCP Under the HoodTonny Madsen
Denne event er en kombination af en tutorial day og en live demonstration af en "full featured" Eclipse RCP applikation hvor udviklingen kommenteres on-the-fly.
Medbring din laptop og prøv selv hvordan man forholdsvis let kan starte en Eclipse RCP applikation. Det er meget vigtigt at du allerede har Eclipse 3.6 installeret på maskinen.Følgende emner vil blive demonstreret / omtalt
Eclipse RCP Arkitektur
Konfiguration (OSGi console, plugin.xml, manifest.mf...)
Packaging
Extension Points
UI / SWT / JFace
Editors / Views
Building and Testing
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
1. L0080 - 2010-11-02
Redistribution and other use of this material requires written permission from The RCP Company.
ITU - MDD – Textural Languages and Grammars
This presentation describes the use and design of textural domain specific
language - DSL. It has two basic purposes:
Introduce you to some of the more important design criteria in language
design
Introduce you to BNF
This presentation is developed for MDD 2010 course at ITU, Denmark.
Some materials are taken from Artur Boronat, University of Leicester with permissions.
2. L0080 - 2010-11-02
2
Textual DSLs versus Graphical DSLs
With both textual and graphical syntax you can
model any meta model
verify constraints in real time
(Eclipse) write ordinary EMF models
Graphical Editors are good to show structural relationships
Graphical Editors are sexy and often appeals to management
Textual Editors are better for „algorithmic“ aspects, or hierarchical models
Textual Editors integrate better with CVS etc. (diff, merge)
Textual Editors often provides better support for quick assist and quick fixes
If you must work with a DSL many hours every day, consider textual DSLs over
graphical DSLs!’
3. L0080 - 2010-11-02
3
What is needed for a successful DSL
You must know
The intended audience
The expressiveness of the language
The extendibility of the language
4. L0080 - 2010-11-02
4
The intended audience
Who will be using the language
Temporary help in a call center
Full-time Clerks
Accountants
Engineers – like yourselves
Any mismatch between the language and the audience is likely to alienate your
audience
Keywords:
concise vs. redundant
intuitive
simple to write and read
(host “heimdal”
(ipif 192.167.54.55)
(disk:type SSD 500GB))
Define host name = “heimdal”
with IP interface
IPv4 address = 192.167.54.55
end IP address
with disk
type = SSD
size = 500GB
end disk
End host
5. L0080 - 2010-11-02
5
The expressiveness of the language
What type of information must be expressed in the language:
Simple static information
Complex network of objects
Algorithms
Must the DSL be Turing complete?
What type of constructs must be supported
Lists
Tables
Recursive data structures
Variables
Macros
Conditions and loops
Functions
Comments
E = MC2
6. L0080 - 2010-11-02
6
The extendibility of the language
Can you be absolute certain that the language will never be extended?
“The last language…”
Backward compatibility
If your grammar is successful, then it will be used – so what should you do
with all the existing “stuff” when you need to extend your grammar with new
functionality
Open versus closed grammars
An open grammar can be extended in the future with new constructs or
statements in a natural manner
A closed grammar can be very difficult to extend while retaining backward
compatibility
heimdal 192.167.54.55 SSD 500
(host “heimdal”
(ipif 192.167.54.55)
(disk type SSD 500GB))
7. L0080 - 2010-11-02
7
Internal versus External DSLs
Textual DSLs are normally divided into two distinct groups:
Internal DSL (or extension language)
Using the syntax and semantics of a host language or system – e.g. Java
or Excel
You can argument that any API is in itself an DSL
External DSL
A completely new language
8. L0080 - 2010-11-02
8
Some Examples
Internal DSL
4GL – attempt in the 1990s to raise the productivity of programmers by adding
more high-level constructs to 3GL languages (such as C, Pascal, etc)
JSP – current attempt to ease the creation of web pages by adding Java as an
embedded scripting language
Some languages that have been designed to be a good host language for DSL:
Tcl
Python
Groovy
Ruby
final IFormCreator detailsSection = myForm.addSection("Details",
table.getBinding().getSingleSelection());
detailsSection.addObjectMessages();
detailsSection.addField("contact.name(w=200)");
detailsSection.addField("logoFileName(w=200)");
detailsSection.addField("loyalty").arg(Constants.ARG_PREFERRED_CONTROL,
RadioGroup.class.getName());
# Assume $remote_server, $my_user_id, $my_password, and $my_command
# were read in earlier in the script.
spawn telnet $remote_server expect "username:"
send "$my_user_idr" expect "password:"
send "$my_passwordr" expect "%"
send "$my_commandr" expect "%"
set results $expect_out(buffer)
send "exitr" expect eof
9. L0080 - 2010-11-02
9
Consists of two layers
a lexical layer
a grammar layer
Lexical syntax: the spelling of
words and punctuation
Grammars: the key formalism for
describing syntax; universal progra
mming language
Example
if (<expr>) <statement>
if <expr> then <statement>
<statement> if <expr>
(if <expr> <statement>)
Formal Syntax of an DSL
if
expression statement
!=
a
constantvariable
if (a != null) b = a.getArg();
“If” “(“ “a” “!=“ “null” “)” “b” “=“ “a” “.” “getArg” “(“ “)” “;”
assignment
a expression
null
… …
10. L0080 - 2010-11-02
10
Tokens/Terminals: units in programming language
Lexical syntax: correspondence between the written representation (spelling) and
the tokens or terminals in a grammar
Keywords:
alphabetic character sequences
unit in a language - if , while
Punctuation
Like ‘(‘, ‘)’, ‘:=‘
Whitespace
Lexical Syntax
if (a != null) b = a.getArg();
“If” “(“ “a” “!=“ “null” “)” “b” “=“ “a” “.” “getArg” “(“ “)” “;”
11. L0080 - 2010-11-02
11
Concrete syntax: describes its written representation, including lexical details
such as the placement of keywords and punctuation marks
Context-free grammar or grammars: notation for specifying concrete syntax
Context-free means that the understanding of the next token may not depend on
the current context
Example from PL/1 of a context dependent grammar:
IF IF THEN THEN ELSE ELSE;
Legal if “IF” is a Boolean variable and “THEN” and “ELSE” are valid
procedures
Most modern languages have a context-free grammar
Notable exceptions are C and C++!!!
Context-Free Grammars
12. L0080 - 2010-11-02
12
Grammar has four parts
A set of tokens or terminals
atomic symbols that can not be sub-divided
A set of nonterminals
Identifiers or variables representing constructs
A set of rules (called productions)
identify the component of construct
<nonterminal >::= terminal | <nonterminal>
A starting nonterminal
represents a main construct
Describing Context-Free Grammars
assignment => ID = expression;
expression => expression + term
| expression - term
| term
term => term * factor
| term / factor
| factor
factor => ( expression )
| ID
| NUMBER
13. L0080 - 2010-11-02
13
The productions are rules for building strings
Parse Trees: show how a string can be built
Notation to write grammar
Backus-Naur Form (BNF)
Extended BNF (EBNF)
Writing Grammars
14. L0080 - 2010-11-02
14
Backus-Naur Form (Backus Normal Form)
Grammar Rules or Productions: define symbols.
Non-terminal Symbols: anything that is defined on the left-side of some
production.
Terminal Symbols: things that are not defined by productions. They can be
literals, symbols, and other lexemes of the language defined by lexical rules.
Identifiers: id::= [A-Za-z_]*
Delimiters: ;
Operators: = + - * / %
assignment_stmt ::= id = expression;
The non-terminal symbol being
defined.
The definition (production)
15. L0080 - 2010-11-02
15
Different notations (same meaning):
assignment_stmt ::= id = expression + term
<assignment-stmt> => <id> = <expr> + <term>
AssignmentStmt → id = expression + term
::=, =>, → mean "consists of" or "defined as"
Alternatives ( " | " ):
Concatenation:
Backus-Naur Form (Backus Normal Form)
expression => expression + term
| expression - term
| term
number => DIGIT number | DIGIT
16. L0080 - 2010-11-02
16
Backus-Naur Form (Backus Normal Form)
Another way to write alternatives:
Null symbol,: ε or @
used to allow a production to match nothing.
Example: a variable is an identifier followed by an optional subscript
Expression => expression + term
=> expression - term
=> term
variable => identifier subscript
subscript => [ expression ] | e
17. L0080 - 2010-11-02
17
Here is a grammar for assignment with arithmetic operations, e.g. y = (2*x +
5)*x - 7;
Arithmetic Grammar
assignment => ID = expression;
expression => expression + term
| expression - term
| term
term => term * factor
| term / factor
| factor
factor => ( expression )
| ID
| NUMBER
18. L0080 - 2010-11-02
18
Example of a Parse Tree
if
expression statement
!=
a
constantvariable
“If” “(“ “a” “!=“ “null” “)” “b” “=“ “a” “.” “getArg” “(“ “)” “;”
assignment
a expression
null
… …
19. L0080 - 2010-11-02
19
Grammar Rules:
expr => expr + expr | expr ∗ expr
| ( expr ) | NUMBER
Expression: 2 + 3 * 4
Two possible parse trees:
expr
expr expr
expr
+
*expr
expr
expr
+
*expr
exprexprNUMBER
(2)
NUMBER
(3)
NUMBER
(4)
NUMBER
(2)
NUMBER
(3)
NUMBER
(4)
Ambiguity
20. L0080 - 2010-11-02
20
The standard metalanguage: Extended BNF
Terminal symbols of the language are quoted
[ and ] include optional symbols
{ and } indicate repetition
( and ) are used to group items
| definition-separator-symbol stands for or. In EBNF we need to quote ( and )
literals as '(' ... ')’
* repetition symbol
= defining symbol
; terminator symbol
EBNF – Extended BNF
21. L0080 - 2010-11-02
21
BNF versus EBNF
BNF:
EBNF:
expression ::= expression + term
| expression - term
| term
term ::= term * factor
| term / factor
| factor
factor ::= ( expression )
| id
| number
expression ::= term { (‘+’|’-’) term }
term ::= factor { (‘*’|’/’) factor }
factor ::= '(' expression ')'
| id | number
22. L0080 - 2010-11-02
22
More Information
“Model-Driven Software Development” by Thomas Stahl and Markus Völter
Chapter 8.1 “DSL Construction”
Good high-level introduction to DSLs
“Domain-Specific Languages: An Annotated Bibliography”
http://homepages.cwi.nl/~arie/papers/dslbib/
Not very interesting except for the very long annotated bibliography!
“BNF and EBNF: What are they and how do they work?” by Lars Marius Garshol -
http://www.garshol.priv.no/download/text/bnf.html
About Backus-Naur Form and parsing
“Internal Domain-Specific Languages”
http://fragmental.tw/research-on-dsls/domain-specific-languages-dsls/internal-dsls/
Outlines use of DSL in Java and Ruby
23. L0080 - 2010-11-02
23
Exercise 1
Design a textual language (grammar) for a travel package.
How would you like to specify a travel package in text?
Do you think, you can teach a travel administrator to use the language?
Is the grammar open – i.e. can it be extended in the future?
For the grammar you can use ID, STRING and NUMBER as terminators where
relevant