Maseno university beginner

Compiler construction — 8-topic bundle

Comprehensive AI-generated study curriculum with 1 detailed note module.

5 views 1 notes

Course Syllabus

  1. Introduction to Grammars and Parse Trees
  2. Ambiguity and Operator Precedence
  3. Grammar Transformations: Left Recursion Removal
  4. Grammar Transformations: Left Factoring
  5. Introduction to Parsing Strategies
  6. Predictive Parsing and Recursive Descent
  7. FIRST and FOLLOW Sets
  8. Table-Driven LL(1) Parsing

Study Notes

Introduction to Grammars and Parse Trees

Free model

A CFG has four main components:
1. Non-terminal symbols (V): These are abstract concepts that can be broken down further, like Statement, Expression, or IfElseBlock.
2. Terminal symbols (T): These are the basic building blocks of the language—the actual words, numbers, or symbols that appear in your code, like if, else, while, ID (for identifier), NUM (for number), +, *, ;, {, }.
3. Production rules (P): These are the core of the grammar. They show how non-terminals can be replaced by sequences of other non-terminals and terminals. They usually look like A -> B C meaning "A can be replaced by B followed by C."
4. Start symbol (S): A special non-terminal that represents the highest-level structure in the language (e.g., Program).

Read full note →