Meta Languages BNF/EBNF<br />Kelly Bauer<br />
2 Basic Forms of metalanguage<br />Railroad diagram (aka syntax structure diagrams)<br />BNF/EBNF<br />
Construct a railroad diagram of a legal if statement for Visual Basic<br />HW<br />
Railroad Diagrams<br />
BNF/EBNF<br />Were created to make it easier to represent syntax<br />
Backus–Naur Form<br />BNF is a text based metalanguage that is read right to left. This way, syntax can be represented by ...
Extended Backus–Naur Form (EBNF)<br />Invented to avoid the disadvantages of BNF. <br />Easier to read, and less issues wi...
Is defined as<br />BNF<br />EBNF<br />::=<br />Boolean::=T|F<br />=<br />Boolean=T|F<br />
Non-terminal Elements<br />BNF<br />EBNF<br />&lt;   &gt;<br />&lt;Digit&gt;::-0|1|2|<br />&lt;Letter&gt;::-a|b|c<br />&lt...
Terminal Elements (eg, reserved words)<br />BNF<br />EBNF<br />Written as is<br />Dim<br />If<br />0<br />1<br />k<br />Wr...
Selection<br />BNF<br />EBNF<br />Defined as  |<br />Boolen::-T|F<br />Defined as |<br />Boolen=T|F<br />
Optional Elements<br />BNF<br />EBNF<br />No Optional Elements, so each option must be repeated<br />Integer::- - {&lt;dig...
Repetition<br />BNF<br />EBNF<br />No repetition<br />Repetition through recursion<br />Recursion is repetition achieved t...
an example<br />
In EBNF<br />Public<br />Dim<br />Variable<br />As<br />Data Type<br />Private<br />
Single<br />Short<br />Boolean<br />Byte<br />Char<br />Date<br />Time<br />Decimal<br />Double<br />Int<br />Long<br />
Upper Case<br />LowerCase<br />UpperCase<br />Digit<br />
0<br />9<br />8<br />7<br />6<br />5<br />4<br />3<br />2<br />1<br />
In Visual Basic	<br />Construct an EBNF diagram to describe a best practice, legal if statement. <br />Should follow the f...
Syllabus Sections?<br />
Upcoming SlideShare
Loading in …5
×

Meta Languages Bnf Ebnf Student Version

2,848 views

Published on

Student version of EBNF BNF diagram presentation for BOS HSC Preliminary Software Design and Development

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,848
On SlideShare
0
From Embeds
0
Number of Embeds
23
Actions
Shares
0
Downloads
52
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Meta Languages Bnf Ebnf Student Version

  1. 1. Meta Languages BNF/EBNF<br />Kelly Bauer<br />
  2. 2. 2 Basic Forms of metalanguage<br />Railroad diagram (aka syntax structure diagrams)<br />BNF/EBNF<br />
  3. 3. Construct a railroad diagram of a legal if statement for Visual Basic<br />HW<br />
  4. 4. Railroad Diagrams<br />
  5. 5. BNF/EBNF<br />Were created to make it easier to represent syntax<br />
  6. 6. Backus–Naur Form<br />BNF is a text based metalanguage that is read right to left. This way, syntax can be represented by text, rather than diagrams<br />
  7. 7. Extended Backus–Naur Form (EBNF)<br />Invented to avoid the disadvantages of BNF. <br />Easier to read, and less issues with things like repetition and optional elements<br />
  8. 8. Is defined as<br />BNF<br />EBNF<br />::=<br />Boolean::=T|F<br />=<br />Boolean=T|F<br />
  9. 9. Non-terminal Elements<br />BNF<br />EBNF<br />&lt; &gt;<br />&lt;Digit&gt;::-0|1|2|<br />&lt;Letter&gt;::-a|b|c<br />&lt; &gt;<br />&lt;Digit&gt;=0|1|2|<br />&lt;Letter&gt;=a|b|c<br />
  10. 10. Terminal Elements (eg, reserved words)<br />BNF<br />EBNF<br />Written as is<br />Dim<br />If<br />0<br />1<br />k<br />Written as is<br />Dim<br />If<br />0<br />1<br />k<br />
  11. 11. Selection<br />BNF<br />EBNF<br />Defined as |<br />Boolen::-T|F<br />Defined as |<br />Boolen=T|F<br />
  12. 12. Optional Elements<br />BNF<br />EBNF<br />No Optional Elements, so each option must be repeated<br />Integer::- - {&lt;digit&gt;} |{&lt;digit&gt;}<br />[ ]<br />Integer=[-] {&lt;digit&gt;}<br />
  13. 13. Repetition<br />BNF<br />EBNF<br />No repetition<br />Repetition through recursion<br />Recursion is repetition achieved through a process calling itself<br />Text page 170<br />Indicated by { } <br />Word={Letter}<br />Repeated zero or more times<br />If it needs to be repeated one or more times, it is written as<br />Word=Letter{Letter}<br />
  14. 14. an example<br />
  15. 15. In EBNF<br />Public<br />Dim<br />Variable<br />As<br />Data Type<br />Private<br />
  16. 16. Single<br />Short<br />Boolean<br />Byte<br />Char<br />Date<br />Time<br />Decimal<br />Double<br />Int<br />Long<br />
  17. 17. Upper Case<br />LowerCase<br />UpperCase<br />Digit<br />
  18. 18. 0<br />9<br />8<br />7<br />6<br />5<br />4<br />3<br />2<br />1<br />
  19. 19. In Visual Basic <br />Construct an EBNF diagram to describe a best practice, legal if statement. <br />Should follow the following structure: <br />If condition Then statements Else elsestatements<br />
  20. 20. Syllabus Sections?<br />

×