Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.11 KB

README.md

File metadata and controls

31 lines (25 loc) · 1.11 KB

CamlJS

An OCaml to JS transpiler, complete with an LR(1) parser generator.

Requirements

This project was built with OCaml version 4.06.1 and OUnit 2.0.8. You must be running on a UNIX OS and have executables named node and ocaml located in your PATH to run the E2E tests.

Building and Running the Transpiler

Running make will generate an executable named camljs. This might take a while on your first time as the grammar needs to be converted to autogenerated source files. To compile a file, run:

./camljs [input source file] [output js file path]

Running Tests

Running make test will run the unit test suite.

Running End to End Tests

Running make e2e-test will run the end to end test suite.

Generating Docs

Running make docs will generate the documentation in the folders doc.private and doc.public.

Making the LR(1) Parser Generator

For converting your own grammars to parse trees, update grammar.json and run make grammar. This will run the converter script and generate the necessary source files in parser/.