Skip to content

Commit 6989100

Browse files
committed
the start of the package
0 parents  commit 6989100

File tree

10 files changed

+104
-0
lines changed

10 files changed

+104
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_build
2+
*.install
3+
*.merlin
4+
_opam
5+

LICENSE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License
2+
3+
Copyright (c) 2016--2020 Jane Street Group, LLC <[email protected]>
4+
Copyright (c) 2020 Carnegie Mellon University
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)
2+
3+
default:
4+
dune build
5+
6+
install:
7+
dune install $(INSTALL_ARGS)
8+
9+
uninstall:
10+
dune uninstall $(INSTALL_ARGS)
11+
12+
reinstall: uninstall install
13+
14+
clean:
15+
dune clean
16+
17+
.PHONY: default install uninstall reinstall clean

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# The set of ppx rewriters for BAP
2+
3+
Provides a BAP-specific ppx rewriter that includes only the blessed set of rewriters that are needed to build and use bap projects. In the future, we may even add our own more specialized rewriters. This package is used by BAP and by BAP plugins via the `bapbuild` tool.
4+
5+
# Adding a new rewriter
6+
7+
The way how ppx rewriters work, unfortuntely, precludes us from adding a new rewriter to a downstream package, e.g., by adding a new dependency directly to the build configuration of a plugin that needs an extra rewriter. Therefore, if a new rewriter is need it has to go through the blessing process and get included into this package. This might change in the future, if we will switch to the dune build system that has a mechanism to build a preprocessor from the specified set of rewriters during the build (essentially this package). Until this, the pull requests are welcome. Just go to the [src/dune](src/dune) file and add the needed rewriter into the `library` stanza.
8+
9+
# Legacy
10+
11+
This project is a mere copy of the `ppx_jane`/`ppx_base` projects with the set of rewriters amended to our needs. E.g., we exclude the js_style rewriter that is not compatible with the code generated by ocamlfind or piqi. We also excluded some other rewriters that we are not using, to speed up the build process and make our code base more reliable.

bin/dune

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(executables (names main) (libraries ppx_bap ppxlib) (link_flags -linkall)
2+
(preprocess no_preprocessing))
3+
4+
(install (section bin) (files (main.exe as ppx-bap)))

bin/main.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let () = Ppxlib.Driver.standalone ()

dune

Whitespace-only changes.

dune-project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(lang dune 1.10)

ppx_bap.opam

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
opam-version: "2.0"
2+
maintainer: "[email protected]"
3+
authors: ["Carnegie Mellon University BAP Team"]
4+
homepage: "https://github.com/BinaryAnalysisPlatform/ppx_bap"
5+
bug-reports: "https://github.com/BinaryAnalysisPlatform/ppx_bap/issues"
6+
dev-repo: "git+https://github.com/BinaryAnalysisPlatform/ppx_bap.git"
7+
license: "MIT"
8+
build: [
9+
["dune" "build" "-p" name "-j" jobs]
10+
]
11+
depends: [
12+
"ocaml" {>= "4.07.0"}
13+
"base_quickcheck"
14+
"ppx_assert"
15+
"ppx_bench"
16+
"ppx_bin_prot"
17+
"ppx_cold"
18+
"ppx_compare"
19+
"ppx_enumerate"
20+
"ppx_fields_conv"
21+
"ppx_hash"
22+
"ppx_here"
23+
"ppx_optcomp"
24+
"ppx_sexp_conv"
25+
"ppx_sexp_value"
26+
"ppx_variants_conv"
27+
"dune" {>= "2.0.0"}
28+
"ppxlib" {>= "0.15.0"}
29+
]
30+
synopsis: "The set of ppx rewriters for BAP"
31+
description: "
32+
ppx_bap is the set of blessed ppx rewriters used in BAP projects.
33+
It fills the same role as ppx_base or ppx_jane (from which it is derived),
34+
but doesn't impose any style requirements and has only the minimal necessary
35+
set of rewriters."

src/dune

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(library
2+
(name ppx_bap)
3+
(public_name ppx_bap)
4+
(kind ppx_rewriter)
5+
(libraries ppxlib ppx_sexp_conv ppx_sexp_value ppx_compare ppx_enumerate
6+
ppx_hash ppx_assert ppx_bench ppx_bin_prot ppx_fields_conv
7+
ppx_here ppx_variants_conv ppx_optcomp)
8+
(preprocess no_preprocessing))

0 commit comments

Comments
 (0)