dynamic language embedding with homogeneous tool support

127
Dynamic Language Embedding With Homogeneous Tool Support PhD Defense Lukas Renggli Advisor Oscar Nierstrasz 1

Upload: lukas-renggli

Post on 07-Nov-2014

1.739 views

Category:

Technology


2 download

DESCRIPTION

Domain-specific languages (DSLs) are increasingly used as embedded languages within general-purpose host languages. DSLs provide a compact, dedicated syntax for specifying parts of an application related to specialized domains. Unfortunately, such language extensions typically do not integrate well with existing development tools. Editors, compilers and debuggers are either unaware of the extensions, or must be adapted at a non-trivial cost. Furthermore, these embedded languages typically conflict with the grammar of the host language and make it difficult to write hybrid code; few mechanisms exist to control the scope and usage of multiple tightly interconnected embedded languages. In this dissertation we present Helvetia, a novel approach to embed languages into an existing host language by leveraging the underlying representation of the host language used by these tools. We introduce Language Boxes, an approach that offers a simple, modular mechanism to encapsulate (i) compositional changes to the host language, (ii) transformations to address various concerns such as compilation and syntax highlighting, and (iii) scoping rules to control visibility of fine-grained language changes. We describe the design and implementation of Helvetia and Language Boxes, discuss the required infrastructure of a host language enabling language embedding, and validate our approach by case studies that demonstrate different ways to extend or adapt the host language syntax and semantics.

TRANSCRIPT

Page 1: Dynamic Language Embedding With Homogeneous Tool Support

Dynamic Language EmbeddingWith Homogeneous Tool Support

PhD DefenseLukas Renggli

AdvisorOscar Nierstrasz

1

Page 2: Dynamic Language Embedding With Homogeneous Tool Support

2

SELECT  email  FROM  usersWHERE  username  =  'lr'

Page 3: Dynamic Language Embedding With Homogeneous Tool Support

3

SELECT  email  FROM  usersWHERE  username  =  'lr'

Syntax

Page 4: Dynamic Language Embedding With Homogeneous Tool Support

4

SELECT  email  FROM  usersWHERE  username  =  'lr'

Semantics

Page 5: Dynamic Language Embedding With Homogeneous Tool Support

General PurposeHost Language

5

+

SELECT  email  FROM  usersWHERE  username  =  'lr'

Page 6: Dynamic Language Embedding With Homogeneous Tool Support

General PurposeHost Language

6

?

SELECT  email  FROM  usersWHERE  username  =  'lr'

SyntaxSQL SemanticsSQL

SyntaxHost SemanticsHost

ToolsHost

Page 7: Dynamic Language Embedding With Homogeneous Tool Support

7

Page 8: Dynamic Language Embedding With Homogeneous Tool Support

8

Host Language

External Language

Page 9: Dynamic Language Embedding With Homogeneous Tool Support

9

Page 10: Dynamic Language Embedding With Homogeneous Tool Support

10

Host Language

Internal Language

Page 11: Dynamic Language Embedding With Homogeneous Tool Support

11

Page 12: Dynamic Language Embedding With Homogeneous Tool Support

12

Host Language

Embedded Language

Page 13: Dynamic Language Embedding With Homogeneous Tool Support

13

Non-StandardHost Language

Embedded Language

Page 14: Dynamic Language Embedding With Homogeneous Tool Support

14

Page 15: Dynamic Language Embedding With Homogeneous Tool Support

15

!" #"$%&

Page 16: Dynamic Language Embedding With Homogeneous Tool Support

Mar

co Z

anol

i, cc

-by-

sa, 2

.5, w

ww

.wik

iped

ia.d

e

16

Page 17: Dynamic Language Embedding With Homogeneous Tool Support

ConventionalLanguage

17

Page 18: Dynamic Language Embedding With Homogeneous Tool Support

18 Mar

co Z

anol

i, cc

-by-

sa, 2

.5, w

ww

.wik

iped

ia.d

e

Page 19: Dynamic Language Embedding With Homogeneous Tool Support

Multiple Context Specific Languages

19

Page 20: Dynamic Language Embedding With Homogeneous Tool Support

20 Mar

co Z

anol

i, cc

-by-

sa, 2

.5, w

ww

.wik

iped

ia.d

e

Page 21: Dynamic Language Embedding With Homogeneous Tool Support

Homogeneous Code and Data Abstraction

21

Page 22: Dynamic Language Embedding With Homogeneous Tool Support

§

§§

22 Mar

co Z

anol

i, cc

-by-

sa, 2

.5, w

ww

.wik

iped

ia.d

e

Page 23: Dynamic Language Embedding With Homogeneous Tool Support

§

§

§

HomogeneousTool Support

23

Page 24: Dynamic Language Embedding With Homogeneous Tool Support

Thesis

To support seamless integration of context-dependent languages without breaking the tools, we need

1. a host-language grammar that can be changed by language extensions,

2. a first-class language description used by the development environment, and

3. a transformation mechanism of the embedded language into a common executable representation.

24

Page 25: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

25

Page 26: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

26

Page 27: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

27

Page 28: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

28

Page 29: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

29

Page 30: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

30

Page 31: Dynamic Language Embedding With Homogeneous Tool Support

31

!" #"$%&

Page 32: Dynamic Language Embedding With Homogeneous Tool Support

32

Types of Embedded Languages

Page 33: Dynamic Language Embedding With Homogeneous Tool Support

33

◦ ◦ ◦◦ ◦ ●◦ ● ◦◦ ● ●● ◦ ◦● ◦ ●● ● ◦● ● ●

Syn

tax

Voca

bul

ary

Sem

antic

s

Page 34: Dynamic Language Embedding With Homogeneous Tool Support

34

Host Language ◦ ◦ ◦◦ ◦ ●◦ ● ◦◦ ● ●● ◦ ◦● ◦ ●● ● ◦● ● ●

Syn

tax

Voca

bul

ary

Sem

antic

s

Page 35: Dynamic Language Embedding With Homogeneous Tool Support

35

Host Language ◦ ◦ ◦◦ ◦ ●

Internal Language ◦ ● ◦◦ ● ●● ◦ ◦● ◦ ●● ● ◦● ● ●

Syn

tax

Voca

bul

ary

Sem

antic

s

Page 36: Dynamic Language Embedding With Homogeneous Tool Support

36

Host Language ◦ ◦ ◦◦ ◦ ●

Internal Language ◦ ● ◦Pidgin ◦ ● ●

● ◦ ◦● ◦ ●● ● ◦● ● ●

Syn

tax

Voca

bul

ary

Sem

antic

s

Page 37: Dynamic Language Embedding With Homogeneous Tool Support

37

Host Language ◦ ◦ ◦◦ ◦ ●

Internal Language ◦ ● ◦Pidgin ◦ ● ●

● ◦ ◦● ◦ ●● ● ◦

Creole ● ● ●S

ynta

x

Voca

bul

ary

Sem

antic

s

Page 38: Dynamic Language Embedding With Homogeneous Tool Support

38

Host Language ◦ ◦ ◦Argot ◦ ◦ ●Internal Language ◦ ● ◦Pidgin ◦ ● ●

● ◦ ◦● ◦ ●● ● ◦

Creole ● ● ●S

ynta

x

Voca

bul

ary

Sem

antic

s

Page 39: Dynamic Language Embedding With Homogeneous Tool Support

39

Host Language ◦ ◦ ◦Argot ◦ ◦ ●Internal Language ◦ ● ◦Pidgin ◦ ● ●— ● ◦ ◦— ● ◦ ●— ● ● ◦Creole ● ● ●

Syn

tax

Voca

bul

ary

Sem

antic

s

Page 40: Dynamic Language Embedding With Homogeneous Tool Support

40

Pidgin ◦ ● ●Creole ● ● ●Argot ◦ ◦ ●

Syn

tax

Voca

bul

ary

Sem

antic

s

Page 41: Dynamic Language Embedding With Homogeneous Tool Support

41

Page 42: Dynamic Language Embedding With Homogeneous Tool Support

42

Page 43: Dynamic Language Embedding With Homogeneous Tool Support

43

Page 44: Dynamic Language Embedding With Homogeneous Tool Support

44

Page 45: Dynamic Language Embedding With Homogeneous Tool Support

45

Page 46: Dynamic Language Embedding With Homogeneous Tool Support

46

Package Name

x = 1

y = 1 (2, 1)

(2, 2)(1, 2)

x = 2

y = 2

Page 47: Dynamic Language Embedding With Homogeneous Tool Support

Package Name

x = 1

y = 1 (2, 1)

(2, 2)(1, 2)

x = 2

y = 2

47

aBuilder  row  grow.aBuilder  row  fill.

aBuilder  column  grow.aBuilder  column  fill.

aBuilder  x:  1  y:  1  add:  (LabelShape  new   text:  [  :each  |  each  name  ];   borderColor:  #black;   borderWidth:  1;   yourself).aBuilder  x:  1  y:  2  w:  2  h:  1  add:  (RectangleShape  new   borderColor:  #black;   borderWidth:  1;   width:  200;   height:  100;   yourself)

Page 48: Dynamic Language Embedding With Homogeneous Tool Support

Package Name

x = 1

y = 1 (2, 1)

(2, 2)(1, 2)

x = 2

y = 2

48

row  =  grow.row  =  fill.

column  =  grow.column  =  fill.

(1  ,  1)  =  label     text:  [  :each  |  each  name  ];     borderColor:  #black;     borderWidth:  1.

(1  ,  2)  -­‐  (2  ,  1)  =  rectangle     borderColor:  #black;     borderWidth:  1;     width:  200;     height:  100.

Page 49: Dynamic Language Embedding With Homogeneous Tool Support

49

Page 50: Dynamic Language Embedding With Homogeneous Tool Support

shape  {   cols:  #grow,  #fill;   rows:  #grow,  #fill;}label  {   position:  1  ,  1;     text:  [  :each  |  each  name  ];   borderColor:  #black;   borderWidth:  1;}rectangle  {     position:  1  ,  2;   colspan:  2;   borderColor:  #black;   borderWidth:  1;   width:  200;   height:  100;}

Package Name

x = 1

y = 1 (2, 1)

(2, 2)(1, 2)

x = 2

y = 2

50

Page 51: Dynamic Language Embedding With Homogeneous Tool Support

51

Page 52: Dynamic Language Embedding With Homogeneous Tool Support

52

Conventional Language

Page 53: Dynamic Language Embedding With Homogeneous Tool Support

53

Conventional Language

Context Specific

Page 54: Dynamic Language Embedding With Homogeneous Tool Support

54

Conventional Language

Context Specific

HomogeneousCode & Data

Page 55: Dynamic Language Embedding With Homogeneous Tool Support

55

Conventional Language

Context Specific

HomogeneousCode & Data

HomogeneousTool Support

Page 56: Dynamic Language Embedding With Homogeneous Tool Support

56

Conventional Language

Context Specific

HomogeneousCode & Data

HomogeneousTool Support

Page 57: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

57

Renggli et al.ECOOP 2010

Page 58: Dynamic Language Embedding With Homogeneous Tool Support

58 Mar

co Z

anol

i, cc

-by-

sa, 2

.5, w

ww

.wik

iped

ia.d

e

Page 59: Dynamic Language Embedding With Homogeneous Tool Support

59 Mar

co Z

anol

i, cc

-by-

sa, 2

.5, w

ww

.wik

iped

ia.d

e

Page 60: Dynamic Language Embedding With Homogeneous Tool Support

Editor

Compiler

Debugger

Syntax

Language 1

60

Page 61: Dynamic Language Embedding With Homogeneous Tool Support

Editor

Compiler

Debugger

Syntax

Language 1

61

Language 2

Page 62: Dynamic Language Embedding With Homogeneous Tool Support

Editor

Compiler

Debugger

Syntax

Language 1

62

Language 2

Page 63: Dynamic Language Embedding With Homogeneous Tool Support

Editor

Compiler

Debugger

Syntax

Language 1

63

Language 2

Page 64: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

64

Page 65: Dynamic Language Embedding With Homogeneous Tool Support

65

SELECT  *  FROM  users

Page 66: Dynamic Language Embedding With Homogeneous Tool Support

66

|  r  |

r  :=  

^  User  fromRow:  r

.SELECT  *  FROM  users

Page 67: Dynamic Language Embedding With Homogeneous Tool Support

LanguageScope

LanguageConcern

LanguageChange

LanguageBox

67

Page 68: Dynamic Language Embedding With Homogeneous Tool Support

Language Scope

Active?

68

Page 69: Dynamic Language Embedding With Homogeneous Tool Support

Language Scope

69

Page 70: Dynamic Language Embedding With Homogeneous Tool Support

‣ System

‣ Packages

‣ Classes

‣ Methods

Language Scope

70

Page 71: Dynamic Language Embedding With Homogeneous Tool Support

Language Concern

Semantics

71

Page 72: Dynamic Language Embedding With Homogeneous Tool Support

Language Concern

Transformation

72

Page 73: Dynamic Language Embedding With Homogeneous Tool Support

Language Concern

73

Context Menus

Navigation Search

Code Expansion

Code Completion

Error Correction

Custom Inspector

Refactorings

Code Folding

Highlighting

Page 74: Dynamic Language Embedding With Homogeneous Tool Support

Language Change

74

Syntax

Page 75: Dynamic Language Embedding With Homogeneous Tool Support

Language Change

75

Host Language

Page 76: Dynamic Language Embedding With Homogeneous Tool Support

Language Change

76

Host Language

+ SQL Language

Page 77: Dynamic Language Embedding With Homogeneous Tool Support

Language Change

77

Host Language

+ SQL Language

+ ...

Page 78: Dynamic Language Embedding With Homogeneous Tool Support

Host Language

+ SQL Language

+ ...

= Custom Host Language

Language Change

78

Page 79: Dynamic Language Embedding With Homogeneous Tool Support

79

Page 80: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

80

Renggli et al.SLE 2009

Page 81: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s81

Language and Tool Extensions

Page 82: Dynamic Language Embedding With Homogeneous Tool Support

LanguageChange

LanguageConcern

LanguageScope

LanguageBox

82

Page 83: Dynamic Language Embedding With Homogeneous Tool Support

LanguageChange = Host Language δ

83

Page 84: Dynamic Language Embedding With Homogeneous Tool Support

LanguageChange =

Host Language Grammarδ

84

Page 85: Dynamic Language Embedding With Homogeneous Tool Support

LanguageChange =

Grammar Transformation

85

Page 86: Dynamic Language Embedding With Homogeneous Tool Support

scanIdentifier self step. ((currentCharacter between: $A and: $Z) or: [ currentCharacter between: $a and: $z ]) ifTrue: [ [ self recordMatch: #IDENTIFIER. self step. (currentCharacter between: $0 and: $9)or: [ (currentCharacter between: $A and: $Z) or: [ currentCharacter between: $a and: $z ] ] ] whileTrue. ^ self reportLastMatch ]

86

Page 87: Dynamic Language Embedding With Homogeneous Tool Support

#(#[1 0 9 0 25 0 13 0 34 0 17 0 40 0 21 0 41] #[1 0 9 0 25 0 13 0 34 0 93 0 76 0 157 0 112] #[1 2 38 0 21 2 38 0 25 2 38 0 26 0 13 0 34] #[0 1 154 0 16 0 21 0 25 0 26 0 34 0 40 0 41] #[0 1 210 0 76 0 81] #[0 1 214 0 76 0 81] #[1 0 173 0 76 0 177 0 81] #[0 1 134 0 16 0 21 0 25 0 26 0 34 0 40 0 41] #[1 1 46 0 21 1 46 0 25 1 46 0 26 1 69] #[1 1 54 0 21 1 54 0 25 1 54 0 26 1 54 0 34] #[0 2 102 0 21 0 25 0 26 0 34 0 40 0 41 0 76]

#[0 2 50 0 21 0 25 0 26 0 76 0 79] #[1 1 13 0 76 2 85 0 124 1 21 0 125] #[1 2 89 0 17 2 30 0 21 2 30 0 82] #[1 2 93 0 21 2 97 0 82] )

87

Page 88: Dynamic Language Embedding With Homogeneous Tool Support

ScannerlessParser Combinator

88

Page 89: Dynamic Language Embedding With Homogeneous Tool Support

a..z a..z

0..9

ID  ::=  letter  {  letter  |  digit  }  ;

89

Page 90: Dynamic Language Embedding With Homogeneous Tool Support

letter

letter digit

sequence

choice

many

ID  ::=  letter  {  letter  |  digit  }  ;

90

Page 91: Dynamic Language Embedding With Homogeneous Tool Support

GrammarTransformation

91

Page 92: Dynamic Language Embedding With Homogeneous Tool Support

letter

letter digit

sequence

choice

many

letter    !    letter  |  "_"

92

Page 93: Dynamic Language Embedding With Homogeneous Tool Support

letter

digit

sequence

choice

manychoice

_

letter

choice

_

letter    !    letter  |  "_"  

93

Page 94: Dynamic Language Embedding With Homogeneous Tool Support

letter digit

sequence

choice

manychoice

_

Optimizations

94

Page 95: Dynamic Language Embedding With Homogeneous Tool Support

GrammarComposition

95

Page 96: Dynamic Language Embedding With Homogeneous Tool Support

Insert  grammar  fragment

before/after  grammar  production

as  a  choice/sequence/replacement.

96

Language Change

Page 97: Dynamic Language Embedding With Homogeneous Tool Support

Insert  SQL  grammar

after  expression  production

as  an  additional  choice

97

Language Change

Page 98: Dynamic Language Embedding With Homogeneous Tool Support

98

Language Change

Variable

Literal

Parens

Expr:

Page 99: Dynamic Language Embedding With Homogeneous Tool Support

99

Language Change

Variable

Literal

Parens

Expr:

SQL

Page 100: Dynamic Language Embedding With Homogeneous Tool Support

Conflicts &Ambiguities

100

Page 101: Dynamic Language Embedding With Homogeneous Tool Support

SELECT  *  FROM  users

101

Page 102: Dynamic Language Embedding With Homogeneous Tool Support

SELECT  *  FROM  users

102

|  r  |

r  :=  

^  User  fromRow:  r

.

Page 103: Dynamic Language Embedding With Homogeneous Tool Support

expr sql|

103

Page 104: Dynamic Language Embedding With Homogeneous Tool Support

SELECT  *  FROM  users<SQL: >

104

Page 105: Dynamic Language Embedding With Homogeneous Tool Support

Parsing Expression Grammars

105

Page 106: Dynamic Language Embedding With Homogeneous Tool Support

expr sql/

ordered

106

Page 107: Dynamic Language Embedding With Homogeneous Tool Support

expr sql/

no conflict

107

Page 108: Dynamic Language Embedding With Homogeneous Tool Support

expr sql/

108

surprise

Page 109: Dynamic Language Embedding With Homogeneous Tool Support

/ exprsql

109

surprise

Page 110: Dynamic Language Embedding With Homogeneous Tool Support

expr sql|

110

unordered

Page 111: Dynamic Language Embedding With Homogeneous Tool Support

expr sql|

111

!sql  expr  /  !expr  sql

Page 112: Dynamic Language Embedding With Homogeneous Tool Support

expr sql$

112

!sql  expr  /  !expr  sql  /  ui

Page 113: Dynamic Language Embedding With Homogeneous Tool Support

expr sql$

113

!sql  expr  /  !expr  sql  /  ui

Page 114: Dynamic Language Embedding With Homogeneous Tool Support

Language and Tool Extensions

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Renggli et al.DYLA 2010

114

Page 115: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

115

Page 116: Dynamic Language Embedding With Homogeneous Tool Support

Assignments and Swapping

Asynchronous Messages

Automaton

Brainfuck Language

Functional Pattern Matching

Grammar Definition

Message Pipes

Mondrian

Object Relationships

Positional Arguments

Program Checking

Quasiquoting

Regular Expression

Roman Numbers

SPath Expression

SQL

Schematic Tables

String Interpolation

Transactional Memory

Tuple Space

116[http://scg.unibe.ch/research/helvetia/examples]

Page 117: Dynamic Language Embedding With Homogeneous Tool Support

Assignments and Swapping

Asynchronous Messages

Automaton

Brainfuck Language

Functional Pattern Matching

Grammar Definition

Message Pipes

✓Mondrian

Object Relationships

Positional Arguments

Program Checking

Quasiquoting

Regular Expression

Roman Numbers

SPath Expression

✓SQL

Schematic Tables

String Interpolation

Transactional Memory

Tuple Space

117[http://scg.unibe.ch/research/helvetia/examples]

Page 118: Dynamic Language Embedding With Homogeneous Tool Support

Assignments and Swapping

Asynchronous Messages

Automaton

Brainfuck Language

Functional Pattern Matching

Grammar Definition

Message Pipes

✓Mondrian

Object Relationships

Positional Arguments

‣ Program Checking

‣ Quasiquoting

Regular Expression

Roman Numbers

SPath Expression

✓SQL

Schematic Tables

String Interpolation

‣ Transactional Memory

Tuple Space

118[http://scg.unibe.ch/research/helvetia/examples]

Page 119: Dynamic Language Embedding With Homogeneous Tool Support

applyhasChangedhasConflict

Change

object

*changes

Process0..1

currentTransaction

do: aBlockretry: aBlockcheckpointabort: anObject

escapeContext

Transaction

previousCopyworkingCopy

ObjectChange

applyBlockconflictTestBlock

CustomChange

*

Transactional Memory

119

Page 120: Dynamic Language Embedding With Homogeneous Tool Support

Meta-Programming Facilities

``(`,(aString) asRegex)

120

Page 121: Dynamic Language Embedding With Homogeneous Tool Support

Domain-SpecificProgram Checking

121

Page 122: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

Renggli et al.

CLSS 2009 Renggli et al.

IWST 2009 Nierstrasz et al.

LNCS 2009 Renggli et al.

TOOLS 2010

122

Page 123: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

123

To support seamless integration of context-dependent languages without breaking the tools, we need

1. a host-language grammar that can be changed by language extensions,

2. a first-class language description used by the development environment, and

3. a transformation mechanism of the embedded language into a common executable representation.

Page 124: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

124

To support seamless integration of context-dependent languages without breaking the tools, we need

1. a host-language grammar that can be changed by language extensions,

2. a first-class language description used by the development environment, and

3. a transformation mechanism of the embedded language into a common executable representation.

Page 125: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

125

To support seamless integration of context-dependent languages without breaking the tools, we need

1. a host-language grammar that can be changed by language extensions,

2. a first-class language description used by the development environment, and

3. a transformation mechanism of the embedded language into a common executable representation.

Page 126: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s

Language and Tool Extensions

126

To support seamless integration of context-dependent languages without breaking the tools, we need

1. a host-language grammar that can be changed by language extensions,

2. a first-class language description used by the development environment, and

3. a transformation mechanism of the embedded language into a common executable representation.

Page 127: Dynamic Language Embedding With Homogeneous Tool Support

Language Boxes

Host Language

Dyn

amic

G

ram

mar

s127

Language and Tool Extensions