Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Meta Languages Railroad Diagrams

Meta Languages. Railroad Diagrams for Prelim Software Design and Development

  • Sé el primero en comentar

Meta Languages Railroad Diagrams

  1. 1. Kelly Bauer<br />Meta Languages<br />
  2. 2. Why? <br />Describes the syntax of a computer language<br />Rules that govern the arrangement of elements in a language<br />eg. The ran cat<br /> OR<br /> The cat ran<br />
  3. 3. Why not just learn the language?<br />Programming languages are very complex. You cant possibly know every way to do everything that you want. <br />The likelihood is that you won’t program in the language you learn. <br />
  4. 4.
  5. 5.
  6. 6. Why not just learn the language?<br />Programming languages are very complex. You cant possibly know every way to do everything that you want. <br />The likelihood is that you won’t program in the language you learn. <br />Allows language specifications be understood by programmers and allows more learnability between languages<br />
  7. 7. 2 Basic Forms <br />Railroad diagram (aka syntax structure diagrams)<br />BNF/EBNF<br />
  8. 8. Railroad diagrams<br />
  9. 9. Elements<br />Allowable Paths<br />
  10. 10. Pre defined langauge elements <br />Eg, letter, sentence, program, variable name<br />Variable<br />
  11. 11. Fixed Elements <br />Reserved words, eg, Dim, -+, 0, 1<br />Dim<br />As<br />
  12. 12. The elements can be combined to give options<br />Eg, A Boolean Constant<br />T<br />F<br />
  13. 13. Or to repeat elements<br />Eg, A word<br />Letter<br />
  14. 14. And these can then be combined<br />Eg, a number that can be either positive or negative<br />Digit<br />_<br />
  15. 15. Textbook <br />Pg 168 Defines the Winston language in railroad diagrams<br />Is the following legitimate conditions<br />Abcd = +99<br />
  16. 16. Abcd = +99<br />Abcd is a legitimate identifier, because it starts with an uppercase followed by a number of lower case<br />+99 is a legitimate constant because it is a negative followed by a number of digits<br />The statement follows the correct order of <br /> Identifier condition constant<br />Davis, Sam (2008) Software Design and Development: The Preliminary Course, Parramatta Education Centre, Sydney<br />
  17. 17. Abcd = +99<br />Abcd is a legitimate identifier, because it starts with an uppercase followed by a number of lower case<br />+99 is a legitimate constant because it is a negative followed by a number of digits<br />The statement follows the correct order of <br /> Identifier condition constant<br />
  18. 18. Complete 2nd activity on pg 168<br />TEXT ACTIVITY<br />
  19. 19. an example<br />
  20. 20. In Visual Basic <br />Construct a railroad diagram to describe a best practice, legal variable declaration. <br />Should follow the following structure: <br />Dim Public or Private Variable Name As Data Type<br />
  21. 21. Public<br />Dim<br />Variable<br />As<br />Data Type<br />Private<br />From this, what needs to be further defined?<br />
  22. 22. Data type <br />In Visual Basic, this can be Boolean, Byte, Char, Date, Time, Decimal, Double, Int, Long, Object, Short, Single<br />
  23. 23. Single<br />Short<br />Boolean<br />Byte<br />Char<br />Date<br />Time<br />Decimal<br />Double<br />Int<br />Long<br />
  24. 24. Variables in VB<br />Must begin with an uppercase letter<br />Can be lower or upper case or digits after first letter<br />
  25. 25. Upper Case<br />LowerCase<br />UpperCase<br />Digit<br />
  26. 26. 0<br />9<br />8<br />7<br />6<br />5<br />4<br />3<br />2<br />1<br />
  27. 27. Images from <br />http://www.trs-80.com/trs80-mag-books.htm<br />http://homepages.cwi.nl/~dik/english/codes/punched.html<br />http://www.borislavdopudja.net/en/writings/cheating_google/<br />

×