Skip to content

Commit 712bd82

Browse files
authored
Prepare 4.0.0 release (#16)
* repacks frontc into three independent packages The printc command is no longer installed. The `ctoxml` and `calipso` packages are distributed in separate packages. * adds tests and more docs * adds missing files * adds github actions test * runs the test only on pull requests * copies the test artifacts to the test.t folder to make windows happy, apparently links do not work on windows :) * adds the missing menhir dependency * removes deprecated names as they do not woron on macOS and Windows The difference is in the register of letters, e.g., `Frontc` vs `FrontC`, but it doesn't really affect the module names so there was no need to introduce them at all.
1 parent c5b8ab5 commit 712bd82

File tree

20 files changed

+1258
-743
lines changed

20 files changed

+1258
-743
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests
2+
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
build:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os:
12+
- macos-latest
13+
- ubuntu-latest
14+
- windows-latest
15+
ocaml-version:
16+
- 4.11.0
17+
- 4.10.1
18+
- 4.09.1
19+
- 4.08.1
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Use OCaml ${{ matrix.ocaml-version }}
28+
uses: avsm/setup-ocaml@v1
29+
with:
30+
ocaml-version: ${{ matrix.ocaml-version }}
31+
32+
- run: opam pin add FrontC.dev . --yes --with-test

FrontC.opam

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file is generated by dune, edit dune-project instead
2+
opam-version: "2.0"
3+
version: "4.0.0"
4+
synopsis: "Parses C programs to an abstract syntax tree"
5+
description:
6+
"FrontC provides a C parser and an OCaml definition of an abstract syntax treee for the C language. It also includes AST pretty-printers in plain and XML formats."
7+
maintainer: ["Ivan Gotovchits <ivg@ieee.org>"]
8+
authors: ["Hugues Cassé <casse@irit.fr> et al"]
9+
license: "LGPL-2.0-only"
10+
tags: ["FrontC" "C" "parser" "XML"]
11+
homepage: "https://github.com/BinaryAnalysisPlatform/FrontC"
12+
bug-reports: "https://github.com/BinaryAnalysisPlatform/FrontC/issues"
13+
depends: [
14+
"dune" {>= "2.7" & >= "2.7" & build}
15+
"menhir"
16+
"odoc" {with-doc}
17+
]
18+
build: [
19+
["dune" "subst"] {dev}
20+
[
21+
"dune"
22+
"build"
23+
"-p"
24+
name
25+
"-j"
26+
jobs
27+
"@install"
28+
"@runtest" {with-test}
29+
"@doc" {with-doc}
30+
]
31+
]
32+
dev-repo: "git+https://github.com/BinaryAnalysisPlatform/FrontC.git"

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.PHONY: build install test doc uninstall clean
2+
build:
3+
dune build
4+
5+
install:
6+
dune install
7+
8+
test:
9+
dune test
10+
11+
doc:
12+
dune build @doc
13+
14+
uninstall:
15+
dune uninstall
16+
17+
clean:
18+
dune clean

README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Front V4.0
1+
FrontC v4.0
22
----------
33

44
FrontC is C language front-end. It provides the program in "C Abstract Form", a tree representation of the original C source. It may be used for many source works including:
@@ -9,3 +9,58 @@ FrontC is C language front-end. It provides the program in "C Abstract Form", a
99
- and so on.
1010

1111
It provides also an XML back-end making easier to transform the C program using XML tools like XSLT (it was my first goal when I perform this task).
12+
13+
ctoxml
14+
======
15+
16+
The `ctoxml` package provides a
17+
18+
calipso
19+
=======
20+
21+
The `calipso` package provides a program analysis tool that removes non-structural control-flow from C programs. See https://dblp.org/rec/journals/tsi/CasseFRS02 for more details. The tool provides two binaries, `calipso` and `calipso_stat`
22+
23+
FrontC v3.0 (stable)
24+
-----------
25+
26+
The [stable][1] branch supports only ANSI C (C89) with partial support for some GNU extensions. This branch is using ocamlyacc as a parser generator and doesn't accept new features, only occasional bug fixes.
27+
28+
29+
30+
Building and Installing
31+
-----------------------
32+
33+
The easiest option is to install using [opam][2], e.g.,
34+
35+
```
36+
opam install FrontC # or calipso, or ctoxml
37+
```
38+
39+
The command above will install the latest version of the package from the ocaml.org [opam-repositor][3]. To get the current development (not yet released to ocaml.org) version of a package, you can use the `opam pin command`, e.g.,
40+
41+
```
42+
opam pin FrontC --dev-repo
43+
```
44+
45+
You can also just clone this repo and do
46+
```
47+
make && make install # translates to `dune build && dune install`
48+
```
49+
50+
If you change anything do not forget to run tests with `make test`.
51+
52+
53+
Documentation
54+
-------------
55+
56+
You can easily get the documentation using odig,
57+
58+
```
59+
odig doc FrontC
60+
```
61+
62+
63+
64+
[1]: https://github.com/BinaryAnalysisPlatform/FrontC/tree/stable
65+
[2]: https://opam.ocaml.org
66+
[3]: https://opam.ocaml.org/packages/

calipso.opam

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file is generated by dune, edit dune-project instead
2+
opam-version: "2.0"
3+
version: "4.0.0"
4+
synopsis: "Rewrites C programs to remove non-structured control-flow"
5+
description:
6+
"Calipso analyzes programs in order to replace all nonstructured instructions (i.e., break, return, switch...) by branches and, then, remove all branches. See https://dblp.org/rec/journals/tsi/CasseFRS02 for more details"
7+
maintainer: ["Ivan Gotovchits <ivg@ieee.org>"]
8+
authors: ["Hugues Cassé <casse@irit.fr> et al"]
9+
license: "LGPL-2.0-only"
10+
tags: ["FrontC" "C" "analysis"]
11+
homepage: "https://github.com/BinaryAnalysisPlatform/FrontC"
12+
bug-reports: "https://github.com/BinaryAnalysisPlatform/FrontC/issues"
13+
depends: [
14+
"dune" {>= "2.7"}
15+
"FrontC" {>= "4.0.0"}
16+
"odoc" {with-doc}
17+
]
18+
build: [
19+
["dune" "subst"] {dev}
20+
[
21+
"dune"
22+
"build"
23+
"-p"
24+
name
25+
"-j"
26+
jobs
27+
"@install"
28+
"@runtest" {with-test}
29+
"@doc" {with-doc}
30+
]
31+
]
32+
dev-repo: "git+https://github.com/BinaryAnalysisPlatform/FrontC.git"

calipso/dune

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
(executable
2-
(name calipso)
3-
(public_name calipso)
4-
(libraries FrontC))
2+
(package calipso)
3+
(name calipso)
4+
(public_name calipso)
5+
(libraries FrontC calipso)
6+
(modules calipso))
7+
8+
(executable
9+
(package calipso)
10+
(name stat)
11+
(public_name calipso_stat)
12+
(libraries FrontC calipso)
13+
(modules stat))
14+
15+
(library
16+
(name calipso)
17+
(wrapped false)
18+
(modules algo gen label reduce)
19+
(libraries FrontC))

0 commit comments

Comments
 (0)