Next Previous Up Top Contents Index

13.2 Grammar rules

13.2.1 Example

If a grammar contains the production:

expression -> expression operator expression

with a semantic representation of a list of the individual semantic values, the Lisp grammar would contain the rule:

((expression expression operator expression)  (list $1 $2 $3))

Error productions of the form:

((nt :error)  (some error behavior))

are explained in the section below.

The first rule of the grammar should be of the form:

((nt nt1)  $1)

where the non-terminal nt has no other productions andnt1 serves as the main "top-level" non-terminal.


LispWorks User Guide - 14 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker