DSA Studio
Search
Home
Sign in
Compiler Foundations Checkpoint
Pipeline stages, tokens, grammar, and AST basics.
1. Which stage turns characters into tokens?
Lexing
Parsing
Code generation
Optimization
2. A grammar primarily describes:
Valid structure of programs
How fast the compiler runs
How to emit machine code
The exact runtime values
3. An AST differs from a parse tree because it:
Keeps only the meaningful structure
Stores every punctuation token
Is always flat
Is only used for errors
4. Name one stage that typically comes after parsing.
5. Why track line and column in tokens?
To report useful errors
To speed up parsing
To compress the AST
To avoid whitespace handling
6. IR stands for:
Intermediate Representation
Instruction Register
Input Recorder
Inline Resolver
Submit quiz
Auto-advance on pass