Prog Lang Final Exam Flashcards
1
Q
Lexical Structure of Programming Languages
A
Deals with tokens, the smallest meaningful units in a program (e.g. keywords, literals, symbols).
2
Q
Categories of Tokens
A
- Reserved words
- Literals/constants
- Special symbols
- Identifiers
3
Q
Three Basic Patterns of Characters
A
- Concatenation: Sequence of items
- Repetition: Denoted by *
- Choice/Selection: Denoted by |
4
Q
Tokenization
A
- Breaks down source code into tokens
- Removes unncessary whitespaces and comments
- Detects lexical errors
5
Q
Building Parse Trees/ASTs
A
- Parse trees represent complete grammar structure
- Abstract syntax trees abstract away unncessary details for further processing
6
Q
Checking Syntax
A
Verifies code conforms to grammar rules
7
Q
Error Recovery
A
Attemps to handle syntax errors gracefully to continue parsing
8
Q
Parsing Phase
A
- Building parse trees/ASTs
- Checking syntax
- Error recovery