Context-free languages Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is Backus-Naur form?

A

A context-free grammar used by developers of programming languages to specify the syntax rules of a language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are production rules?

A

A range of symbols and expressions combined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are <> used for in BNF?

A

Denote a non-terminal symbol
A non-terminal symbol appearing on the right side of a production rule means there’ll be another rule after to define the contents of the chevrons

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is | | used for in BNF?

A

Showing terminal symbols, these values cannot be broken down and defined further. They are the building blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What symbol must be included in BNF statements at some point?

A

Terminal symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Can recursion be used in BNF?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does a parse tree do?

A

Breaks something down into it’s component parts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are parse trees often used to do?

A

Check whether a string satisfies a production rule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the diagrammatic approach to BNF called?

A

A syntax diagram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

State the rules of reading a syntax diagram

A

Read left to right
Follow the arrows
You can’t go back unless a loop arrow is included

How well did you know this?
1
Not at all
2
3
4
5
Perfectly