6. Customization
Model
generate
customize Code
Lecture 10
7. Advanced Topics
Economics
★ costs and benefits of developing (with) DSLs
Evolution
★ maintenance of models and languages
Portability
★ supporting multiple platforms
Internal DSLs
★ library as a language
Language composition
★ combining multiple DSLs
Lectures 12-14
14. parse
Editor
AST
feedback
core
Integrated
Development
Environment
Code
15. Architectural Requirements for IDEs
Editor services are based on AST
★ services analyze structure, not text of source
Error recovery
★ continue services in presence of syntactic errors
Incremental processing
★ effort of applying analysis, transformation, generation should be
proportional to change in source
Separate compilation (analysis, transformation)
★ keep track of dependencies
16. Holy Grail of Software Language Definition
Automatically derive efficient,
scalable, incremental compiler +
usable IDE from high-level,
declarative language
definition
17. Language Definition Tools
Parser generators
★ automatically generate parsers from grammars
★ LEX/YAC, Bison, ANTLR, ...
Meta-programming tools
★ DSLs for programming with programs as data
★ TXL, ASF+SDF, Stratego, JastAdd, RascalMPL, ...
IDE generators/frameworks
★ tools for construction of IDE plugins
★ IMP, TMF
★ Synthesizer Generator, Centaur, Lrc
18. Language Workbenches
Integrated development environment for
★ language definition
★ application of language
Textual languages
★ ASF+SDF MetaEnvironment, XText, MontiCore, EMFText,
Spoofax
Structure editors
★ MPS
Visual languages
★ MetaEdit+, DSL Tools, ...
20. The Spoofax/IMP Language Workbench
Syntax definition: SDF
★ declarative, modular syntax definition
Transformation, analysis, generation: Stratego
★ rewrite rules, strategies, dynamic rules
Editor services
★ domain-specific languages for configuration
Based on IMP framework by IBM Research
29. Lexical Syntax: Identifiers & Literals
follow restriction: symbol may not reserved words
be followed by character from this class:
BlogEntry is one ID
54. Syntax
Definition
Pretty-Print
Parse Table Signature
Table
Parse Transform Pretty-Print
@Entity
entity User {
class User {
name :: String
String _user;
pw :: Secret
public User
}
getUser() {
def output(u :
syntax definition is basis of language definition
return _user;
User) {
}
55. Schedule
Lab this week
★ Design 1: deadline is April 1
★ Design 2: what DSL will you design?
Cases
★ Case 2: web abstractions
★ Deadline Case 2: April 8
Next
★ Lecture 7: editor services & basic code generation