/COL226-Assignments

Assignments completed for the course "Programming Languages". Includes functional programming and logic programming.

Primary LanguageOCaml

Programming Laguages (COL 226) Assignments

Assignments completed while pursuing the course programming languages.

Assignments

  1. Big Integer Package (BigInt)
    More
    • Creating a big-int package, to be used in further assignments.
    • Allows us to carry out various mathematical operations for large integers.
  2. A simple definitional interpreter and stack machine
    More
    • Model the "abstract syntax" of a simple calculator language for big_integer expressions, and give it "semantic meaning", and give it "semantic meaning"
    • Implement the calculator as a simple stack-based machine, using opcodes into which the abstract syntax of an expression is compiled.
  3. Building a scanner using OCaml-Lex
    More
    • Specify the tokens for a simple arithmetic and boolean calculation language.
    • Generate a scanner for the defined tokens.
  4. Parsing for a simple expression evaluator
    More
    • Design a grammar for a simple expression language, taking care to enforce precedence rules (e.g., BODMAS).
    • Generate an abstract syntax tree from the parsed data. Then, use it for further evaluation.
  5. Implement a type checker for our evaluator
    More
    • Extend our language to support types. Set operational limits wiht respect to types.
    • Set up a type checker at compile time which checks for correctness of types of variables associates with operations.
  6. Creating implementation machines for evaluator (thus completing the language)
    More
    • Implement SECD and Krivine machines for compiling and evaluating programs with Call by value or Call by name mechanism.
    • Add new constructs such as recursion, while-loops e.t.c.
  7. Implementations of the (static/lexical) scoping discipline in Algol-like languages
    More
    • Design the procedure-call implementation as in PASCAL on a stack.
    • Implement static and dynamic links with display registers for associated access and call.