Save
Computer Science Paper 1
Backus Naur(BNF)
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Samuel Olaleye
Visit profile
Cards (25)
What is an integer?
A
whole number
View source
What does BNF stand for?
Backus-Naur Form
View source
What is the purpose of BNF?
To define the syntax of a
language
View source
What does syntax refer to in programming?
The
definition
of allowed
patterns
in a
language
View source
What is an example of a defined format for 'char'?
One character in
length
View source
What characters are allowed in the 'char' format?
z, A-Z, 0-9, @
£
$
View source
What does the notation ': : =' mean in BNF?
Means is
defined
by /
consists
of
View source
What does '< >' signify in BNF?
It indicates a
syntactic
item
View source
What does '|' represent in BNF?
It means
OR
View source
What does '{ }' denote in BNF?
It means
optional
View source
What does ',' signify in BNF?
It means
AND
View source
What is the purpose of defining 'char2' in BNF?
To create a new
data type
View source
What does the meta level refer to in BNF?
Decomposing elements into
smallest
parts
View source
How is a number defined in BNF?
As
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
View source
How is a letter defined in BNF?
As a |
b
|
c
| d | e |
f
|
g
| h | i |
j
|
k
| l |
m
|
n
| o | p | q | r | s | t | u | v | w | x | y | z
View source
What are the components of the BNF definition for 'char2'?
<char2> : : = <
number
> <number>
<number> <
letter
>
<letter> <number>
<letter> <letter>
View source
Why is BNF important in programming?
It standardizes
language
syntax definitions
View source
Name two scenarios where BNF might be used.
Defining
programming languages
and
data formats
View source
How does BNF make programming easier?
By providing clear
syntax
rules
View source
What does the notation <WORD> : : = <LETTER> <LETTER> represent?
Definition of a word with
2
letters
View source
How can you define a word using BNF notation?
<WORD> : : = <LETTER> | <LETTER> <LETTER> | <LETTER> <LETTER> <LETTER>
View source
How would you define a sentence using BNF incorporating the definition of a word?
<SENTENCE> : : = <WORD> | <WORD> ‘,’ {<WORD>}
View source
What is a syntax diagram?
A visual representation of
BNF
Shows how symbols are
connected
Helps in understanding
language
structure
View source
How are the symbols for LETTER defined in the syntax diagram?
<LETTER> : : =
A | B | C | D
View source
What is the role of circles in the syntax diagram?
To represent
undefined
symbols like
LETTER
View source