Following the Grammar by Gary T. Leavens Abstract This document explains what it means to ``follow the grammar'' when writing recursive programs, for several kinds of different grammars. It is intended to be used in classes that teach functional programming using Oz, especially those used for teaching principles of programming languages. In such courses traversal over an abstract syntax tree defined by a grammar are fundamental, since they are the technique used to write compilers and interpreters. Keywords: Recursion, programming recursive procedures, recursion pattern, inductive definition, BNF grammar, Kleene star, follow the grammar, functional programming, list recursion, programming languages, concrete syntax, abstract syntax, helping procedures, parsing procedures, Oz. 2001 CR Categories: D.1.1 [Programming Techniques] Applicative (Functional) Programming --- design, theory; D.2.4 [Software Engineering] Coding Tools and Techniques --- design, theory; D.3.1 [Programming Languages] Formal Definitions and Theory --- syntax; D.3.3 [Programming Languages] Language Constructs and Features --- recursion; This document is distributed under the terms of the Creative Commons Attribution License, version 2.0, see http://creativecommons.org/licenses/by/2.0/ .