The Spoofax Language Workbench
Eelco Visser Lennart Kats
The Spoofax Language Workbench Lennart Kats Eelco Visser Software - - PowerPoint PPT Presentation
The Spoofax Language Workbench Lennart Kats Eelco Visser Software Engineering implement Problem Software validate High-level languages reduce problem/solution gap Problem HLL Machine Domain Domain-Specific Languages Problem DSL HLL
Eelco Visser Lennart Kats
Problem Software
implement validate
Problem Domain HLL Machine
Problem Domain HLL Machine DSL
DSLs further reduce gap between problem domain and implementation
Syntax definition
★
concrete syntax
★
abstract syntax
Static semantics
★
error checking
★
name resolution
★
type analysis
Model-to-model transformation
★
express constructs in core language
Code generation
★
translate core language models to implementation
parser generators meta- programming languages meta- programming libraries template engines
syntactic editor services
semantic editor services
Syntax definition Static semantics Model-to-model transformation Code generation Syntactic Editor Services Semantic Editor Services }
Language workbenches [Fowler ’05] how can we make these things cheaply?
Language Workbench: integrated environment for language definition
Holy Grail of Software Language Definition
Automatically derive efficient,
scalable, incremental compiler + usable IDE from high-level,
in Eclipse workspace>
A syntax definition
specifies a transformation from text to trees
t r a n s f
m
t r a n s f
m
t r a n s f
m
=
t r a n s f
m
t r a n s f
m
transform
t r a n s f
m
transform
t r a n s f
m
transform
t r a n s f
m
transform
transform
transform transform
t r a n s f
m
Need for single, unified language specification:
Rewrite rules Strategies
Error Marking with Rewrite Rules
Error Marking with Rewrite Rules
transform t r a n s f
m
Error Marking with Rewrite Rules
Origin tracking
Analysis with Rewrite Rules
Code Generation with Rewrite Rules