Skip to content

Instantly share code, notes, and snippets.

@cr2007
Created May 3, 2023 05:28
Show Gist options
  • Save cr2007/56cc1cdb843f0e9389a30394321d64b5 to your computer and use it in GitHub Desktop.
Save cr2007/56cc1cdb843f0e9389a30394321d64b5 to your computer and use it in GitHub Desktop.

F29LP Wrap-Up

Table of Contents


Part 1

Assume that it is easier

Write more text, draw diagrams on automaton
Need to be strong in theory

100% Regex is there

Regex

  • Formal Languages
    • Tokens
    • Sentences
  • Regular Grammar
    • Regular Expressions

Definition of token sentences, Regex

Formal Grammars

  • Production Rules
  • Grammars
  • Terminology
    • Object Language (strings of terminals)
    • Meta-language (all strings of terminals or nonterminal)
  • Chomskky classification of grammar
  • Type 2 (context-free) language
  • Type 3 (regular) grammar
  • Leftmost derivation
  • Rightmost derivation

Grammars & Parsing

  • Ambiguous grammars
  • Unambiguous grammars
  • Eliminate ambiguity
  • Left-recursive ambiguity
  • Right-recursive ambiguity
  • Convert left-recursive to right-recursive
  • Top-down parsing (left-most derivation)
  • Nondeterminisism
  • Eliminate nondeterminism by left-factoring

Finite Automata

  • DFA
  • Definition
  • Transition diagrams
  • Extended transition function

Non-Deterministic Finite Automata

  • NFA
  • Def
  • Transition diagrams
  • Extended transition function
  • Converting an NFA to a DFA

Part 2

Interpreters

  • What is a Compilter?
  • What is an Interpreter?
  • Interpreter VS Compiler
  • Write a simple interpreter (can be pseudo-code or semi-OCaml)

Lexical Analysis

  • The process of the Lexer Generator
  • Write a simple Lex File (write on a piece of paper)
  • The process of making a .cmo file

Syntactic Analysis

  • Recursive Descent Parser
  • Abstract grammar to Abstract Syntax to Concrete Syntax
  • LL(1) Grammars
    • Why can it not be LL(1)?

Code Generation

  • Read and Understand MIPS
  • Explain the process of Code generation
  • Optimisation
    • Explain the process of optimisation
    • Elaborate the process using pseudo-code

HINT: If you are not confident in the 3rd question,

If someone answers all 4 questions, all 4 are marked and the highest will be chosen

The exam is designed to complete 3 questions

Answer the question which you are confident in getting the most marks.

Prioritise your question based on how confident you are in the questions.

3 good questions are better than 4 meh questions.

If you find yourself with less time, attempt the last question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment