CS 3304: Comparative Languages
Syntax
[
Course Documents
] : [
Syntax
]
Previous
Contents
Next
Keyword Index
BNF Rules
A rule has a left-hand side (LHS) and a right-hand side (RHS), and consists of
terminal
and
nonterminal
symbols
A
grammar
is a finite nonempty set of rules
An
abstraction
(or nonterminal symbol) can have more than one RHS:
<stmt> -> <single_stmt> | begin <stmt_list> end
Syntactic lists are described using recursion:
<ident_list> -> ident | ident, <ident_list>