Bakus naur form
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
464
On Slideshare
448
From Embeds
16
Number of Embeds
2

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 16

http://education.weebly.com 10
http://www.bradfieldweb.com 6

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Bakus-Naur Form
  • 2. 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 ….?
  • 3. 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
  • 4. 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
  • 5. Question 1
  • 6. Question 2
  • 7. American example
  • 8. Challenge• Create BNF for a UK postcode<postcode> := <onetwolets><onetwodig><optionlet>sp<onetwodig><twolets><onetwolets> := <twolets> | <letter><twolets> := <letter><letter><onetwodig> := <digit> | <digit><digit><optionlet> : | <letter><letter> := a|b|c|d|e|f …….<number> := 0|1|2 ……
  • 9. Syntax Diagrams
  • 10. Syntax diagram elements Create a Syntax diagram for a Windows filename