+ All Categories
Home > Documents > aceh.b-cdn.net Course Notes... · Web viewEBNF. BNF. digit =...

aceh.b-cdn.net Course Notes... · Web viewEBNF. BNF. digit =...

Date post: 26-Jan-2021
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
4
Railroad EBNF BNF <digit> ::= 0|1|2|3|4|5|6|7|8|9 <letter> ::= A | B | C | D | E | F <integer> ::= <digit> | <digit> <integer> <word> ::= <letter> | <letter><word> digit = “0”|”1”|”2”|”3”|”4”|”5”|”6”|”7”|”8”|”9” letter = “A”|”B|”C”|”D”|”E”|”F” integer = digit{digit} word = letter{letter} address = word integer Hayden Nicholls Symbo l Meaning ::= Is Defined As < > Non-Terminal Symbol (e.g. <letter>) | or Terminal Symbol (e.g. a (only)) Symbol Meaning = Is Defined As Non-Terminal Symbol | Or “ ” Terminal Symbol (e.g. “a” (only) [ ] Optional { } and/or , Optional Repetition ( ) Grouping
Transcript

Hayden Nicholls

Symbol

Meaning

::=

Is Defined As

< >

Non-Terminal Symbol (e.g. )

|

or

Terminal Symbol (e.g. a (only))

Symbol

Meaning

=

Is Defined As

Non-Terminal Symbol

|

Or

“ ”

Terminal Symbol (e.g. “a” (only)

[ ]

Optional

{ }

and/or , Optional Repetition

( )

Grouping

EBNF

BNF

digit = “0”|”1”|”2”|”3”|”4”|”5”|”6”|”7”|”8”|”9”letter = “A”|”B|”C”|”D”|”E”|”F”integer = digit{digit}

word = letter{letter}address = word integer

::= 0|1|2|3|4|5|6|7|8|9 ::= A | B | C | D | E | F ::= |

::= | ::=

Railroad Diagram

Data Type

Description

Examples

Integer

Whole number

-50, 0, 23

Floating Point Integer

Used to Store Fractions and Very Large Numbers

-1.23 * 10⁻⁶⁸, 2.3 * 10⁴⁵

Boolean

On/Off, True/False

True, False

String

Stores Text Data, Combination of Character

“abc123”, “Once Upon a Time”

Desk Check Example

A Desk Check records the state and output of each variable in each count of a program

1

2

3

4

5

Frog

Cow

Dog

Cat

Bird

Data Type/Category

Entry

Name

Hayden Nicholls

City

Sydney

Postcode

3405

Country

Australia

Data Item

Data Type

Description

Example

Speed

Integer

Determines the speed of X, Y movement

6

Left Key Pressed

Boolean

Determines if the Left Key is pressed

True

Player Name

String

The printed name of the character

“CoolGuy98”

Activation Date

Date

The date the game was first installed

23/8/2013

BEGIN LAMP

IF (lamp doesn’t work)

IF (lamp not plugged in)

THEN plug in lamp

ELSIF (bulb burned out)

THEN (replace bulb)

ELSIF (still not working)

THEN repair

END LAMP

Algorithms

Flowchart

Pseudocode

Data Dictionary for RPG Game

Sequential files can only be read from start to finish, they are continuous stream of data (e.g. tracks on a cassette tape, text file for a jpeg). Sequential data storing.

Data is related but not necessarily the same type, such as in a database

Record ‘Individual Profile’

Animals (1) = ‘Frog’Animals (4) = ‘Cat’

Animals (2) = ‘Cow’Animals (5) = ‘Bird’

Animals (3) = ‘Dog’

One Dimensional Array ‘Animals’

A Context Diagram is the most basic Data Flow Diagram

Data Flow Diagram

Flow Chart

Structure Charts


Recommended