The project of the Computer Language Processing (CLP) course given at EPFL. It implements a compiler, an interpreter and a virtual machine for the Amy Language which is a subset of Scala with limited functionality.
- Amy Language specifications can be found in the file
amy-spec.pdf
Our extension was related to the execution of the compiler, thus we did not add a new feature to the language itself. Every program in the examples folder should run directly when we enter the run command in the sbt mode.
-
Lexer
-
Parser
-
Name Analyzer
-
Type Checker
-
Code Generation
-
Clone this repository.
-
Install Scala and Node js.
-
Place your Amy program inside the examples folder.
-
Open a command line, navigate here and open sbt by typing
sbt
. -
To generate web assembly code type
run <dependencies> examples/<your program with .scala extension>
inside sbt, then typeexit
to exit sbt. -
Type
node wasmout/<your program with .js extension>
$ sbt
sbt:amyc> run library/Std.scala examples/Fibonacci.sc
[info] Running amyc.Main library/Std.scala
examples/Fibonacci.sc
[ Info ] Grammar is in LL1
-> This program computes the nth fibonacci number
recursively.
-> Enter the value of n:
<- 10
-> The value of nth fibonacci number is: 55
[success] Total time: 7 s, completed 02-Jan-2019 16:37:59