Skip to content

Commit

Permalink
Prepare 4.0.0 release (#16)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
ivg authored May 4, 2021
1 parent c5b8ab5 commit 712bd82
Show file tree
Hide file tree
Showing 20 changed files with 1,258 additions and 743 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Tests

on:
- pull_request

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
ocaml-version:
- 4.11.0
- 4.10.1
- 4.09.1
- 4.08.1

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use OCaml ${{ matrix.ocaml-version }}
uses: avsm/setup-ocaml@v1
with:
ocaml-version: ${{ matrix.ocaml-version }}

- run: opam pin add FrontC.dev . --yes --with-test
32 changes: 32 additions & 0 deletions FrontC.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "4.0.0"
synopsis: "Parses C programs to an abstract syntax tree"
description:
"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."
maintainer: ["Ivan Gotovchits <[email protected]>"]
authors: ["Hugues Cassé <[email protected]> et al"]
license: "LGPL-2.0-only"
tags: ["FrontC" "C" "parser" "XML"]
homepage: "https://github.com/BinaryAnalysisPlatform/FrontC"
bug-reports: "https://github.com/BinaryAnalysisPlatform/FrontC/issues"
depends: [
"dune" {>= "2.7" & >= "2.7" & build}
"menhir"
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/BinaryAnalysisPlatform/FrontC.git"
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: build install test doc uninstall clean
build:
dune build

install:
dune install

test:
dune test

doc:
dune build @doc

uninstall:
dune uninstall

clean:
dune clean
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Front V4.0
FrontC v4.0
----------

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:
Expand All @@ -9,3 +9,58 @@ FrontC is C language front-end. It provides the program in "C Abstract Form", a
- and so on.

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).

ctoxml
======

The `ctoxml` package provides a

calipso
=======

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`

FrontC v3.0 (stable)
-----------

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.



Building and Installing
-----------------------

The easiest option is to install using [opam][2], e.g.,

```
opam install FrontC # or calipso, or ctoxml
```

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.,

```
opam pin FrontC --dev-repo
```

You can also just clone this repo and do
```
make && make install # translates to `dune build && dune install`
```

If you change anything do not forget to run tests with `make test`.


Documentation
-------------

You can easily get the documentation using odig,

```
odig doc FrontC
```



[1]: https://github.com/BinaryAnalysisPlatform/FrontC/tree/stable
[2]: https://opam.ocaml.org
[3]: https://opam.ocaml.org/packages/
32 changes: 32 additions & 0 deletions calipso.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "4.0.0"
synopsis: "Rewrites C programs to remove non-structured control-flow"
description:
"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"
maintainer: ["Ivan Gotovchits <[email protected]>"]
authors: ["Hugues Cassé <[email protected]> et al"]
license: "LGPL-2.0-only"
tags: ["FrontC" "C" "analysis"]
homepage: "https://github.com/BinaryAnalysisPlatform/FrontC"
bug-reports: "https://github.com/BinaryAnalysisPlatform/FrontC/issues"
depends: [
"dune" {>= "2.7"}
"FrontC" {>= "4.0.0"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/BinaryAnalysisPlatform/FrontC.git"
21 changes: 18 additions & 3 deletions calipso/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
(executable
(name calipso)
(public_name calipso)
(libraries FrontC))
(package calipso)
(name calipso)
(public_name calipso)
(libraries FrontC calipso)
(modules calipso))

(executable
(package calipso)
(name stat)
(public_name calipso_stat)
(libraries FrontC calipso)
(modules stat))

(library
(name calipso)
(wrapped false)
(modules algo gen label reduce)
(libraries FrontC))
Loading

0 comments on commit 712bd82

Please sign in to comment.