[Overview] [Previous] [Next]
BNF Notation
- Importance
- standard way to define programming language syntax
- good background for later part of course
- Stands for either "Backus Normal Form" or "Backus-Naur Form"
- Includes two sets:
- terminals are symbols in the language being defined,
e.g. while, for, =, [.
- nonterminals are used to talk about the language,
and are enclosed in angle brackets,
e.g. <assignment statement>, <declaration>.
- There are only two metasymbols
- ::= means "is defined as"
- | means "or"
- BNF uses recursion heavily
Copyright © 1996 by David Matuszek
Last modified Feb 2, 1996