Chapter 4 Flashcards

1
Q

When analyzing a program for syntactical correctness, what are the two major steps?

A
  • Lexical analysis
  • Syntactical analysis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why are these two steps usually separated?

A
  • Reduce complexity
  • Increase efficiency
  • Allow for reuse (functions)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two major approaches to syntax analysis?

A
  • Top-down parsing
  • Bottom-up parsing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the most common top-down parsing method? What is the short-coming of this approach?

A

Recursive descent. Limitation of leftmost recursion (A → A | B).

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

What is the most common bottom-up parsing algorithm?

A

The LR (left-to-right, rightmost derivation) algorithm.

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