JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Software Design and Development
Software Design and Development
Week 4
Week 5
Week 6
Week 7
Week 8
More
Share
Explore
Week 5
Evidence of Learning - 023b Metalanguages
EBNF and Railroad Syntax Reference
EBNF and Railroad Syntax Reference
Language Syntax
For simplicity let us assume a digit as
0....9
and a letter as
(a...z , A...Z , 0...9),
provide an
EBNF
and
Railroad
definition for the following JavaScript structures.
digit
letter
A
number
and a
string
-
W3 here
Identifier
-
W3 here
an
array
(hint: an array name is an identifier)-
W3 here
Metalanguage
Metalanguage
Name
EBNF
Railroad
Name
EBNF
Railroad
1
Digit
digit = 0|1|2|3|4|5|6|7|8|9
2
Letter
letter = a|b|c|d|...|x|y|z|A|B|C|...|X|Y|Z|0|1|2|3|...|8|9
3
Number
number = (<digit>{<digit>})
4
String
string = (<letter><letter>{<letter>})
5
Identifier
identifier = (<letter>{<letter>|<digit>})
6
Array
array = <identifier>"["<number>{<number>}"]"
There are no rows in this table
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.