This project was developed as final project for the exam in Functional Languages 2021-2022 held by Prof. Alvise Spanò in Univeristy of Padova (Italy).
The TinyML folder contains the implementation of an interpreter for an ML style functional language, written in F# (Visual Studio).
The project is not entirely coded by me, but a skeleton was provided by the professor.
The project can be divided in those main parts:
-
Lexer parses the source code (a long string of text) in tokens.
Accepted tokens are defined inLexer.fsl
. -
Parser receives the output of the Lexer as input and produces an abstract syntax tree.
Valid language expressions are defined inParser.fsy
.
The actual code for the parser is automatically generated by Yacc. -
Type checking checks the correctness of program types.
All the needed types has to be specified by the programmer in the source code as type annotations. -
Type inference infer program types and also checks for types correctness.
-
Evaluator evaluates the program.