✏️ Exercises: designing a concrete syntax

1. Exercice 1: component architecture DSL

We continue the design of the component architecture DSL, started in ✏️ Exercises: designing an abstract syntax. In the following questions we assume we already have an abstract syntax design for this DSL.

1.1. Question 1

After dialoguing with (imaginary) domain experts that will use this DSL, we learn they have the following preferences regarding a textual concrete syntax of the DSL:

  • they prefer lowercase keywords,

  • they prefer keywords over operators (),

  • they prefer whole words (requires, provides) over abreviations (req, prov),

  • they are familiar with braces {} as delimiters,

  • they have experience with programming languages such as C, C++, Java.

Propose a mockup concrete syntax representation of the AST you made in ✏️ Exercises: designing an abstract syntax for this DSL.

1.2. Question 2

In the mockup proposed in the previous question, give the token type (keywords, operators, delimiters, separators, identifiers, comments, literals) of each appearing token.

1.3. Question 3

Using the proposed mockup, create one annotated mockup for each concept of the abstract syntax, where you highlight the textual representation of each property/association of the concept.

2. Exercice 2: robot programming DSL

We continue the design of the robot programming DSL, started in ✏️ Exercises: designing an abstract syntax. In the following questions we assume we already have an abstract syntax design for this DSL.

2.1. Question 1

After dialoguing with (imaginary) domain experts that will use this DSL, we learn they have the following preferences regarding a textual concrete syntax of the DSL:

  • they like concise notations (for example using operators),

  • they prefer abbreviations over whole words, when relevant,

  • they are not familiar with programming languages.

Propose a mockup concrete syntax representation of the AST you made in ✏️ Exercises: designing an abstract syntax for this DSL.

2.2. Question 2

In the mockup proposed in the previous question, give the token type (keywords, operators, delimiters, separators, identifiers, comments, literals) of each appearing token.

2.3. Question 3

Using the proposed mockup, create one annotated mockup for each concept of the abstract syntax, where you highlight the textual representation of each property/association of the concept.