Skip to content

Commit 74c6417

Browse files
author
Alex Yu
committedMay 6, 2018
Sign modules, clean Makefile
1 parent 001e3bc commit 74c6417

14 files changed

+21
-37
lines changed
 

‎Makefile

+2-37
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Author(s): Alex
2+
13
# Make sure ocamlbuild can find opam-managed packages: first run
24
#
35
# eval `opam config env`
@@ -27,42 +29,5 @@ clean :
2729
rm -rf libneoc
2830
rm -rf *.cmx *.cmi *.cmo *.cmx *.o *.s *.ll *.out *.exe *.err
2931

30-
# More detailed: build using ocamlc/ocamlopt + ocamlfind to locate LLVM
31-
32-
OBJS = ast.cmx sast.cmx codegen.cmx parser.cmx scanner.cmx semant.cmx str.cmxa neo.cmx
33-
34-
neo : $(OBJS)
35-
ocamlfind ocamlopt -linkpkg -package llvm -package llvm.analysis $(OBJS) -o neo
36-
37-
scanner.ml : scanner.mll
38-
ocamllex scanner.mll
39-
40-
parser.ml parser.mli : parser.mly
41-
ocamlyacc parser.mly
42-
4332
libneoc.o :
4433
$(CC) $(CFLAGS) -c libneoc.c
45-
46-
%.cmo : %.ml
47-
ocamlc -c $<
48-
49-
%.cmi : %.mli
50-
ocamlc -c $<
51-
52-
%.cmx : %.ml
53-
ocamlfind ocamlopt -c -package llvm $<
54-
55-
### Generated by "ocamldep *.ml *.mli" after building scanner.ml and parser.ml
56-
ast.cmo :
57-
ast.cmx :
58-
codegen.cmo : ast.cmo str.cma
59-
codegen.cmx : ast.cmx str.cmxa
60-
neo.cmo : semant.cmo scanner.cmo parser.cmi codegen.cmo ast.cmo
61-
neo.cmx : semant.cmx scanner.cmx parser.cmx codegen.cmx ast.cmx
62-
parser.cmo : ast.cmo parser.cmi
63-
parser.cmx : ast.cmx parser.cmi
64-
scanner.cmo : parser.cmi
65-
scanner.cmx : parser.cmx
66-
semant.cmo : ast.cmo
67-
semant.cmx : ast.cmx
68-
parser.cmi : ast.cmo

‎ast.ml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* Author(s): the Neo team *)
12
(* Abstract Syntax Tree and functions for printing it *)
23

34
type op = Add | Sub | Mult | Div | Equal | Neq | Less | Leq | Greater | Geq

‎codegen.ml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* Author(s): Alex and Dominique *)
12
(* Code generation: translate takes a semantically checked AST and
23
produces LLVM IR
34

‎libneoc.c

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* Author(s): Alex */
2+
/* Neo's internal C library */
3+
14
#include <ctype.h>
25
#include <stdio.h>
36
#include <stdlib.h>

‎libneoc.h

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* Author(s): Alex */
2+
/* Neo's internal C library header */
3+
14
#include <stdbool.h>
25
#include <stddef.h>
36

‎neo.ml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* Author(s): Alex *)
12
(* Top-level of the Neo compiler: scan & parse the input,
23
* check the resulting AST and generate an SAST from it, generate LLVM IR,
34
* and dump the module *)

‎neoc

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# Author(s): Alex
23

34
# Path to the LLVM compiler
45
LLC="llc"

‎optimize.ml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* Author(s): Alex *)
12
(* Optimization pass for the Neo compiler; forms a dependency graph
23
* of the SAST and removes any functions that would not be executed
34
* during the program; see the decription above prune_uses *)

‎parser.mly

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* Author(s): the Neo team */
12
/* Ocamlyacc parser for Neo */
23

34
%{

‎sast.ml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* Author(s): Alex *)
12
(* Semantically-checked Abstract Syntax Tree and functions for printing it *)
23

34
open Ast

‎scanner.mll

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* Author(s): the Neo team *)
12
(* Ocamllex scanner for Neo *)
23

34
{

‎semant.ml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(* Author(s): Alex and Dominique *)
12
(* Semantic checking for the Neo compiler *)
23

34
open Ast

‎stdlib.neo

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* Author(s): Alex, Dominique, and Andres */
2+
/* Neo's standard library */
3+
14
void check(bool cond, string err) {
25
if (!cond) {
36
die(err);

‎testall.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# Author(s): Alex
23

34
# Regression testing script for Neo
45
# Step through a list of files

0 commit comments

Comments
 (0)
Please sign in to comment.