60 likes | 194 Views
Bakus-Naur Form. What is it?. A formal, mathematical way to describe a language It describes the grammar of a language, so that there is no disagreement or ambiguity as to what is allowed How ….?. Production Rules. Symbol := alternative1 | alternative 2 …
E N D
What is it? • A formal, mathematical way to describe a language • It describes the grammar of a language, so that there is no disagreement or ambiguity as to what is allowed • How ….?
Production Rules • Symbol := alternative1 | alternative 2 … • alternative1 := subsymbol1 | terminal • Terminals are the end of the line, they terminate the production process. • The language described is the set of all the strings you can produce by following the production rules
Example BNF Grammar <S> := ‘-’ <FN> | <FN> <FN> := <DL> | <DL> ‘.’ <DL> <DL> := <D> | <D> <DL> <D> := ‘0’|’1’|’2’|’3’|’4’|’5’ |’6’|’7’|’8’|’9’ S=Start Symbol, FN = Fractional Number, DL = Digit list, D=digit