# 1 Introduction

This report defines how Oz program text, which is a sequence of characters, is transformed into an Oz Core program. This transformation is performed in three steps.

Lexical Syntax

  First, a given program text is transformed into a sequence of words. Each word represents a sequence of tokens. We call this process tokenizing.

Context-free Syntax

  The resulting sequence of tokens is transformed into a parse tree. We call this process parsing, and the resulting parse tree program.

Core Programs

  The program is translated to a Core program, eliminating a number of abbreviations and nesting.

At each step, errors may occur. A text represents an Oz program if it can be tokenized and parsed into a program which can be translated without error into a Core program.

Meta Notation

In a document like this one, it is helpful to make use of notational conventions in order to provide for concise and precise descriptions.

## 1.1 Fonts

We make use of fonts to distinguish the different kinds of symbols occurring in this document:

Meaning | Examples
--- | ---
terminal or nonterminal symbol | <variable>, <statement>
keyword | `local`, `skip`

## 1.2 Regular Expressions and Context-Free Grammars

Regular expressions and context free grammars describe sets of words. We use the following notation to describe one such set in terms of others (in increasing order of precedence):

Notation | Meaning
--- | ---
| singleton containing the empty word
() | grouping of regular expressions
[ ] | union of with the set of words
{ } | set of words containing all concatenations of zero or more elements of
{ }+ | set of words containing all concatenations of one or more elements of
| set of words containing all concatenations of an element of with an element of
| | union of and
- | difference of and