next up previous contents index
Next: Precedence Up: Parser Specification Previous: Syntax class

Syntax declaration

The grammar of a language is specified in the syntax declaration. Its syntax is listed as follows:

Syntax_Decl ::=syntax Id {
    [ Precedence_Decl ¼ Precedence_Decl ]
    [ Expect_Decl ]
    [ Production_Rule ¼ Production_Rule ]
}

The name of a syntax declaration should match that of a syntax class. A syntax declaration is divided into three parts: (i) the operator precedence section, (ii) the expect: n section, and (iii) the grammar section.



Allen Leung
Mon Apr 7 14:33:55 EDT 1997