Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Meta Languages Bnf Ebnf Student Version

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

  • Login to see the comments

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 />

×