Kelly Bauer<br />Meta Languages<br />
Why?	<br />Describes the syntax of a computer language<br />Rules that govern the arrangement of elements in a language<br...
Why not just learn the language?<br />Programming languages are very complex. You cant possibly know every way to do every...
Why not just learn the language?<br />Programming languages are very complex. You cant possibly know every way to do every...
2 Basic Forms		<br />Railroad diagram (aka syntax structure diagrams)<br />BNF/EBNF<br />
Railroad diagrams<br />
Elements<br />Allowable Paths<br />
Pre defined langauge elements	<br />Eg, letter, sentence, program, variable name<br />Variable<br />
Fixed Elements	<br />Reserved words, eg, Dim, -+, 0, 1<br />Dim<br />As<br />
The elements can be combined to give options<br />Eg,  A Boolean Constant<br />T<br />F<br />
Or to repeat elements<br />Eg,  A word<br />Letter<br />
And these can then be combined<br />Eg, a number that can be either positive or negative<br />Digit<br />_<br />
Textbook	<br />Pg 168 Defines the Winston language in railroad diagrams<br />Is the following legitimate conditions<br />A...
Abcd  =  +99<br />Abcd is a legitimate identifier, because it starts with an uppercase followed by a number of lower case<...
Abcd  =  +99<br />Abcd is a legitimate identifier, because it starts with an uppercase followed by a number of lower case<...
Complete 2nd activity on pg 168<br />TEXT ACTIVITY<br />
an example<br />
In Visual Basic	<br />Construct a railroad diagram to describe a best practice, legal variable declaration. <br />Should f...
Public<br />Dim<br />Variable<br />As<br />Data Type<br />Private<br />From this, what needs to be further defined?<br />
Data type	<br />In Visual Basic, this can be Boolean, Byte, Char, Date, Time, Decimal, Double, Int, Long, Object, Short, S...
Single<br />Short<br />Boolean<br />Byte<br />Char<br />Date<br />Time<br />Decimal<br />Double<br />Int<br />Long<br />
Variables in VB<br />Must begin with an uppercase letter<br />Can be lower or upper case or digits after first letter<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 />
Images from	<br />http://www.trs-80.com/trs80-mag-books.htm<br />http://homepages.cwi.nl/~dik/english/codes/punched.html<b...
Upcoming SlideShare
Loading in …5
×

Meta Languages Railroad Diagrams

2,194 views
2,040 views

Published on

Meta Languages. Railroad Diagrams for Prelim Software Design and Development

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,194
On SlideShare
0
From Embeds
0
Number of Embeds
26
Actions
Shares
0
Downloads
45
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

×