Meta Languages Railroad Diagrams Student Version
-
Upload
kelly-bauer -
Category
Technology
-
view
1.131 -
download
1
description
Transcript of Meta Languages Railroad Diagrams Student Version
![Page 1: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/1.jpg)
Kelly Bauer
META LANGUAGES
![Page 2: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/2.jpg)
WHY?
Describes the syntax of a computer language
Rules that govern the arrangement of elements in a language
eg. The ran catORThe cat ran
![Page 3: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/3.jpg)
WHY NOT JUST LEARN THE LANGUAGE?
Programming languages are very complex. You cant possibly know every way to do everything that you want.
The likelihood is that you won’t program in the language you learn.
Allows language specifications be understood by programmers and allows more learnability between languages
![Page 4: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/4.jpg)
2 BASIC FORMS
Railroad diagram (aka syntax structure diagrams)
BNF/EBNF
![Page 5: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/5.jpg)
RAILROAD DIAGRAMS
![Page 6: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/6.jpg)
ELEMENTS
Allowable Paths
![Page 7: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/7.jpg)
PRE DEFINED LANGAUGE ELEMENTS
Eg, letter, sentence, program, variable name
Variable
![Page 8: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/8.jpg)
FIXED ELEMENTS
Reserved words, eg, Dim, -+, 0, 1
Dim
As
![Page 9: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/9.jpg)
THE ELEMENTS CAN BE COMBINED TO GIVE OPTIONS
Eg, A Boolean Constant
T
F
![Page 10: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/10.jpg)
OR TO REPEAT ELEMENTS
Eg, A word
Letter
![Page 11: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/11.jpg)
AND THESE CAN THEN BE COMBINED Eg, a number that can be either
positive or negative
_
Digit
![Page 12: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/12.jpg)
TEXTBOOK
Pg 168 Defines the Winston language in railroad diagrams
Is the following legitimate conditions
Abcd = +99
![Page 13: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/13.jpg)
ABCD = +99
Abcd is a legitimate identifier, because it starts with an uppercase followed by a number of lower case
+99 is a legitimate constant because it is a negative followed by a number of digits
The statement follows the correct order of
Identifier condition constantDavis, Sam (2008) Software Design and Development: The Preliminary Course, Parramatta Education Centre, Sydney
![Page 14: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/14.jpg)
Complete 2nd activity on pg 168
TEXT ACTIVITY
![Page 15: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/15.jpg)
AN EXAMPLE
![Page 16: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/16.jpg)
IN VISUAL BASIC
Construct a railroad diagram to describe a best practice, legal variable declaration.
Should follow the following structure: Dim Public or Private Variable Name As
Data Type
![Page 17: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/17.jpg)
DATA TYPE
In Visual Basic, this can be Boolean, Byte, Char, Date, Time, Decimal, Double, Int, Long, Object, Short, Single
![Page 18: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/18.jpg)
VARIABLES IN VB
Must begin with an uppercase letter Can be lower or upper case or digits
after first letter
![Page 19: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/19.jpg)
1
2
3
4
5
6
7
8
9
0
![Page 20: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/20.jpg)
CONSTRUCT A RAILROAD DIAGRAM OF A LEGAL IF STATEMENT FOR VISUAL BASIC
HW
![Page 21: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/21.jpg)
SYLLABUS SECTIONS?
![Page 22: Meta Languages Railroad Diagrams Student Version](https://reader033.fdocuments.us/reader033/viewer/2022061206/5481befbb479590f0d8b45e9/html5/thumbnails/22.jpg)
IMAGES FROM
http://www.trs-80.com/trs80-mag-books.htm http://homepages.cwi.nl/~dik/english/codes/punched.html http://www.borislavdopudja.net/en/writings/cheating_google/