The slides of the talk given by M. Barash at JetBrains MPS Community Meetup 2018 in Munich, Germany. More information: https://confluence.jetbrains.com/display/MPS/JetBrains+MPS+Community+Meetup%3A+Agenda
8. Projectional editing & modeling
semantic model
syntactic
projection
placeholder
“smooth” editing
model
projection edited projection
projection
model
editor transforms text “sin” to projection of sine
“^” is transformed to projection of exponentiation
placeholder
Equation Editor
9. Microsoft Word vs. JetBrains MPS
select a placeholder
select desired concept from a menu
type something that would identify some concept
select something to augment it
either by typing
or by selecting
from menu
copy-paste copy entire subtrees
trigger for concept
alias
10. Parsing vs. projectional editing
int class = template + 5; template= + ;classint 5
<expression>= ;<name>int
<variable declaration>
= ;<name>int
<variable declaration>
<expression>
<left> + <right>
textual
projectional
concept
trigger for concept
trigger
editor always has access to AST
current concept
containing concept
<name>int
name: string
any string can be used here
changes will be propagated
throughout the source code
concepts can also be
chosen from a menu user’s intention
11. Projectional editing
textual form of code only meant for the programmer
projectional editing
allows languages to evolve
but it is unambiguous
languages can be combined with each other
set of node types that can be added to ASTnew DSL
nodes are selected explicitly no ambiguities in AST
textual syntax can look ambiguous
How to motivate it?
no parsing needed
non-textual notations
22. MPS: Editor aspect
button to negate
the current value
returns a JButton with event
handler that negates value
reading and writing data from an AST node requires
to handle node access explicitly
cells explained “on paper” first
24. MPS: Structure aspect
language concepts IfStatement
abstract syntax
of the language
Entity
structure of language
vs. structure of its
implementation
25. MPS: Structure aspect
language concepts
technical concepts
IfStatement
NodeRendering
abstract syntax
of the language
Entity
VarReference
used to define diagram
editor for concept Node
structure of language
vs. structure of its
implementation
28. Learning objectives
program model! =
language its syntax! ≠
programming in MPS developing an API* ≈
abstract vs. concrete syntax
MPS multiple concrete syntaxes can be defined
language can evolve! a motivation for projectional editing
source code text! ≠
textual graphicaltabular mathematicalnotations
right level of abstractions
clearly separated