Skip to content

Latest commit

 

History

History
executable file
·
45 lines (23 loc) · 2.05 KB

README.md

File metadata and controls

executable file
·
45 lines (23 loc) · 2.05 KB

Programming Languages Assignments

These assignments are of the course COL226- Programming Languages offered in 2nd sem 2020-21 in IIT Delhi. All the assignments are implemented in SML/NJ97.

Assignment 1:

Data Format Conversion is one of the most common problems in Computer Science. There are numerous online tools which convert CSV(Comma Seperated Files) to TSV (Tab Seperated) Files.

Similarly command lines tools like ”unix2dos” and”dos2unix” are used to convert files between different newline conventions.

In this assignment, SML/NJ97 is used to convert text files from one format to another format. For example, CSV to TSV and vice versa.

For how to run the code and other details, click here.

Assignment 2:

In this assignment, lexer and parser of a Boolean Algebra toy language is implemented. ML-Lex is used to implement the lexer and ML-Yacc is used to implement the parser.

Boolean operations like NOT, AND, OR, XOR and IMPLIES are supported.

For how to run the code and other details, click here.

Assignment 3:

In this assignment, evaluator and type-checker of a toy language is implemented. This toy language support the following features-

  • Boolean Operations like AND, OR, XOR, NOT, EQUALS etc.
  • Integer Arithmetic Operations like PLUS, MINUS, TIMES, GREATERTHAN, LESSTHAN etc.
  • IF-THEN-ELSE statements are also present.
  • Named Functions using the keyword fun.
  • Nameless Functions using the keyword fn.

Recursion is also supported in named functions and higher order functions can also be evaluated as well as type-checked.

Evaluation is based on Call-by-value strategy. Type-checking is implemented using type variables and type environment.

For how to run the code and other details, click here.

Author: