- The test environment was Ubuntu 22.04.1 LTS on WSL2 and macOS Moneterey 12.5
- The following ubuntu packages were installed:
- opam 2.1.2
- llvm-runtime 1:14.0-55~exp2
- The follwing opam packages were installed:
- ocaml 4.13.1
- ocamlbuild 0.14.2
- llvm 14.0.6
-
Clone the repo
git clone https://github.com/IzzyFG/Signal_Language.git
-
Install the required packages
#Ubuntu $ add-apt-repository ppa:avsm/ppa $ apt update $ apt install opam llvm-runtime 1:14.0-55~exp2
-
Initialize opam in your home directory
$ opam init $ eval $(opam env) $ opam switch create 4.14.0 $ eval $(opam env) $ opam install llvm.14.0.6 ocamlbuild.0.14.2
-
Then go into the Compiler directory
cd Signal_Language/src
-
Build the Signal compiler
make all
-
Run our entrypoint script
sh signal.sh testcode/example # sh signal.sh filename
-
Clean generated files
make clean
sh test_suite.sh
ast.ml
: abstract syntax tree (AST) definitionscanner.mll
: scannersignalparse.mly
: parsersast.ml
: definition of the semantically-checked ASTsemant.ml
: semantic checkingirgen.ml
: LLVM IR code generator
README.md
: file containing important details regarding the Signal languageMakefile
: file to build the executable and to clean byproduct filessignal.sh
: entrypoint script that compiles signal code and runs ittestcode
: folder containing testcode- `test_suite.sh1: file to run all tests at once
test1.ml
: the file to test the scanner and parsertest2.ml
: the file to test the semantic checkersignal.ml
: top-level file to test and run microc compilerexample.sgl
: a sample signal source codeexample_fail.sgl
: a sample signal source code that should fail and throw an errorexample.out
: a sample compiled code of example.sgl & example_fail.sgl
- function declerations
- functions with or without parameters
- variable declerations
- variable assignments
- print statements for multiple variable types
- for loops
- while loops
- if-else statements
- list (arrays)