2 Notation🔗ℹ

Shplait syntax is based on shrubbery syntax, which is described at Shrubbery Notation. Superficially, Shplait resembles Rhombus Prototype, which also uses shrubbery notation, but Shplait is statically typed, much smaller, and has a different set of constructs overall.

Shrubbery notation defines the syntax of identifiers and numbers, and it defines how token sequences are grouped by parentheses, brackets, braces, quotes, and indentation. We define Shplait using patterns over Shrubbery forms.

In the pattern form a syntactic form, ... indicates zero or more repetitions of the preceding form. The preceding form can be an individual term, a group, or an alternative. (Words like term, group, and alternative are defined as part of the specification of shrubbery notation.)

id

 

op

 

expr

 

defn

 

body

 

type

 

typed_id

 = 

id

 | 

id :: type

These names are used in syntax descriptions, sometimes with a prefix to indicate a role within an enclosing form: