#!/bin/bash

set -e

# Generate scanner and parser:
ocamlyacc -b trivialml_parser trivialml.mly
ocamllex -o trivialml_lexer.ml trivialml.mll

# Compile sources:
ocamlc -c domains.ml
ocamlc -c environment.ml
ocamlc -c trivialml_parser.ml
ocamlc -c trivialml_lexer.ml
ocamlc -c interpreter.ml
ocamlc -c main.ml

# This creates a.out
ocamlc domains.cmo environment.cmo trivialml_parser.cmo trivialml_lexer.cmo interpreter.cmo main.cmo
