Regex and BNF Flashcards
1
Q
What is BNF
A
the formal notation used to describe the syntax rules of a language
2
Q
Why do we need to use bnf
A
- some expressions cant be expressed with regEx or FSMs
- this class of languages called context free languages are more expressive than regular langs
3
Q
::=
A
equals to
4
Q
<>
A
surrounds category names
5
Q
what are terminal symbols
what are non terminal symbols
A
- terminal elements can be broken down
- non terminal cant be broken down
6
Q
what is parsing
A
checking an input string against the set of BNF rules to see if its valid
7
Q
parts of a syntax diagram and what are they used for
A
elipse - represents a terminal symbol
rectangle - a non terminal symbol
arrow under rectangle - non terminal element that may be used more than once
8
Q
what is syntax
A
strict rules a program must follow regarding their structure
9
Q
what does bnf consist of
A
- set of terminal symbols
- set of non terminal symbols
- set of production rules
10
Q
what type of language is BNF
A
meta language
11
Q
A