Giter Site home page Giter Site logo

corejava-interpreter's Introduction

CoreJava-Interpreter

Interpreter for CoreJava[1] written in OCaml

First steps

  1. Install required dependencies using scripts/install_dependencies.sh
  2. Build test.ml using scripts/build_test.sh
  3. Run the test. Eg: " ./test.native ./core-java-files/helloworld.java "

Using oasis

  1. After updating the _oasis config file run oasis setup -setup-update dynamic.
  2. Compile: make -j 4. The executables specified in the oasis file will be in the current directory with the extension .native.
  3. Clean: make clean
  4. Rinse and repeat.

Using ocp-indent

  1. Run scripts/ocp-indent.sh from the root of the repo.

Contributing

The course CS 421: Programming Languages and Compilers[2] from the University of Illinois provides good resources. You can also check the examples of parsing from realworldocaml[3].

Common Problems

Can only use Oasis/make OR build scripts

If make fails because it can't find a .native file, try to remove the src/_build directory and any .native files inside src/ and setup.data, setup.log from root. Also make clean ;).

Executable does not reflect code changes. WTF? :rage4:

Ah, you did not respect the rule above ๐Ÿ‘. Try to clean all the files indicated above.

Also note that if you delete src/_build/ first in Atom editor it will not show the broken links src/*.native and you will still get an error if you try to make. Go and delete the .native files manually.

SANITIZE: a total of x files that should probably not be in your source tree

This is probably due to you running menhrir -v src/parser.mly and the files generated src/parser.ml and src/parser.mli. Manually remove them or run the sanitize script produced in _build/.

References:

  1. http://www.academia.edu/3300125/Core-java_an_expression-oriented_java
  2. https://courses.engr.illinois.edu/cs421/sp2012/lectures/
  3. https://github.com/realworldocaml/examples/tree/master/code/parsing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.