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

Bakus naur form

on

  • 403 views

 

Statistics

Views

Total Views
403
Views on SlideShare
387
Embed Views
16

Actions

Likes
0
Downloads
2
Comments
0

2 Embeds 16

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

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Bakus naur form Bakus naur form Presentation Transcript

  • 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 …• 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
  • Question 1
  • Question 2
  • American example
  • 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 ……
  • Syntax Diagrams
  • Syntax diagram elements Create a Syntax diagram for a Windows filename