MANOOL
MANOOL is Not an Object-Oriented Language!”

Standard Library — Specification

Updated:

Metanotation

A combination of the following metalanguages and metalinguistic formalisms is used in the standard library specification:

The standard library specification contains some introductory explanations in plain English followed by entries, each one describing a MANOOL feature or a group of related features. An entry begins with either a tree grammar or an invocation pattern; a semantic description is then provided.

Tree grammars

A tree grammar resembles a traditional formal grammar, but instead of describing a set of strings it describes a set of terms (i.e, trees). That is, in place of string concatenation, term formation is used in the process of derivation. Tree grammars are always qualified as regular because they also resemble traditional regular grammars due to similar fundamental properties they have (which is anyway irrelevant for our purposes).

The following is an example of a tree regular grammar (describing if special forms):

<if form>  ->  {if <cond> then <body> else <alt body>[0] <alt body>[1] ... <alt body>[n-1]}
<cond>     ->  <form>
<body>     ->  <form>
<alt body> ->  <form>
<alt body>[0] <alt body>[1] ... <alt body>[n-1]

means repetition 1 — n times of items matching <alt body>, whereas

<alt body>[0] ... <alt body>[n-1]

would mean repetition just 0 — n times.

Expressions with syntactic placeholders

An example of an expression template with syntactic placeholders (used in the semantic specification for an if special form):

{if <cond> then {do <body>[0]; ...; <body>[n-1]} else Nil}
<body>[0] ... <body>[n-1]

means repetition of all matches according to the corresponding tree grammar.

Invocation patterns

Examples of invocation patterns:

Expression templates with argument placeholders

Example of an expression template with argument placeholders x and y (from the specification of Rem for Integer):

{unless 0 <> y signal Undefined else x - x / y * y}

Contents

Updated: