docs: Initiate building documentation with mkdocs

Also lay out the structure of the documentation and supply a decent
  introduction. Also (unsuccessfully) attempt to get the first example of
  a Stratego transformation from the manual implemented and documented.
This commit is contained in:
Glen Whitney 2021-01-12 08:41:01 -08:00
parent 412bd679f1
commit 56b8b921dc
16 changed files with 251 additions and 6 deletions

View file

@ -1,17 +1,33 @@
module Spoofax-Propositional-Language
/** md:
Title: Concrete Syntax
## Concrete Syntax
The current Spoofax/Eclipse IDE is oriented around individual language
projects. Therefore in order to work with ASTs of the SPL
[abstract syntax](../README.md#abstract-syntax) that we just saw, it's easiest to
define a concrete syntax for SPL, with the following SDF3 definition:
*[SPL]: Spoofax Propositional Language
```sdf3
**/
imports
Common
context-free start-symbols
Prop
context-free sorts
Prop String
context-free start-symbols
Prop
/** md (include the following code in the documentation) */
context-free syntax
Prop.True = <1>
@ -32,4 +48,27 @@ context-free priorities
> Prop.And
> Prop.Or
> Prop.Impl
> Prop.Eq
> Prop.Eq
/* [stop to avoid the open-comment in the extracted markdown] **/
/** md [conclusion of the documentation]
```
Thus, the first two example AST expressions
`A: {! examples/sec4.1_A.aterm !}` and
`B: {! examples/sec4.1_B.aterm !}`
from {! ../docrefs/sec4.1.md !} can be generated by the following much more
compact SPL expressions:
`A: {! examples/sec4.1_A.spl !}` and
`B: {! examples/sec4.1_B.spl !}`. (If you are following along in the repository,
you can visit the file `syntax/examples/sec4.1_A.spl` (or ...`_B.spl`) and from the
Spoofax menu select "Syntax > Show parsed AST" to see the AST generation
in action.)
This concrete syntax actually makes it easier to construct the example
expressions used throughout the tutorial manual as examples for Stratego
processing.
**/

View file

@ -0,0 +1 @@
(1 -> 0) & 0

View file

@ -0,0 +1 @@
p & 0

View file

@ -0,0 +1 @@
(1 -> 0 & 1) & 1

View file

@ -0,0 +1 @@
(1 -> p & q) & p