As part of the Brunel University Compiling Techniques Course that ran from 1969 until 1985, we used a 16mm computer animated film called Syntactic Dominoes:.

The film was also made available to other UK universities.

The original idea came from Tom Cheatham at Computer Associates in 1968:

Syntactic Dominoes can be viewed as a game, not unlike the childrens game of dominoes, in which one has "syntactic" dominoes corresponding to the various syntax rules of the grammar as well as the symbols of the source text and the "goal" (or root of the analysis tree). The construction of the analysis tree can now be viewed as a game; the construction of the analysis tree corresponds to choosing and placing syntactic dominoes so as, in the end, to have all edges abutted. The various methods of syntactic analysis (i.e. various ways of constructing the analysis tree) can be viewed as strategies of play of the game.

We then develop "top-down", "left-corner-bottom-up" and "direct reductions" strategies of play; these strategies arc very easily comprehended and, when comprehended, ensure that the student really understands the basic mechanisms required for the three kinds of analysis. Following this we formalize the dominoes and the strategies as AMBIT/G data objects and programs; this has the very distinct advantage that the two-dimensional aspect (the representation of trees and so on) Is indirectly modelled.

ARPA Project 1228: RESEARCH IN MACHINE-INDEPENDENT SOFTWARE PROGRAMMING

A set of dominoes are created that correspond to the grammar rules for the language to be parsed.

At the top is the goal dominoe and at the bottom are a set of dominoes that represent the input to be parsed.

The game consists of adding dominoes to the board that match either the bottom of the goal or the top of the inputs. The pieces are elastic so that they can be made larger or smaller to fit. The aim is to complete the game with all the pieces being fully connected top and bottom. The film shows three different parsing strategies: top-down, bottom-up, and reduction analysis.

The film was aimed at getting the general principles understood before the individual parsing algorithms were described. See Chapter 7, Compiling Techniques.

SYNTACTIC DOMINOES by Mary Stapley & F.R.A.Hopgood L T O N I O P S Y N D I O A C T C L A C H I R T T M I N U C D C O N . O E S TOP DOWN ANALYSIS 1. Dominoes are added to a free bottom edge. 2. The free bottom edges are filled from left to right. A v c A E E E + T E T T T * P T P P v P c A E E E + T E T T P P v + T T * P T P P c * P v v BOTTOM UP ANALYSIS 1. Dominoes are added to a free top edge. 2. The aim is to fill in the leftmost free bottom edge. A v + c * v A E E E + T E T T T * P T P P v P c REDUCTION ANALYSIS 1. Only dominoes which have their bottom edges completely matched may be added. 2. The dominoes are added from left to right. A v c v * + A E E E + T E T T T * P T P P v P c How do we choose a dominoe at each stage? So far we have guessed correctly each time! T E H N E D

The original film is available on the Chilton website: