Skip to content

Commit db5fd85

Browse files
authored
updates versions and switches to new setup-ocaml action (#44)
* updates versions and switches to new setup-ocaml action * bumps the package versions * uses the new option to specify the compiler version
1 parent bc6a60f commit db5fd85

File tree

10 files changed

+60
-77
lines changed

10 files changed

+60
-77
lines changed

Diff for: .github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
uses: actions/checkout@v2
2626

2727
- name: Use OCaml ${{ matrix.ocaml-version }}
28-
uses: avsm/setup-ocaml@v1
28+
uses: ocaml/setup-ocaml@v2
2929
with:
30-
ocaml-version: ${{ matrix.ocaml-version }}
30+
ocaml-compiler: ${{ matrix.ocaml-version }}
3131

3232
- run: opam pin add FrontC . --no-action
3333
- run: opam install FrontC --deps-only

Diff for: FrontC.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
version: "4.0.0"
3+
version: "4.1.0"
44
synopsis: "Parses C programs to an abstract syntax tree"
55
description:
66
"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."

Diff for: calipso.opam

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
version: "4.0.0"
3+
version: "4.1.0"
44
synopsis: "Rewrites C programs to remove non-structured control-flow"
55
description:
66
"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"
@@ -12,7 +12,7 @@ homepage: "https://github.com/BinaryAnalysisPlatform/FrontC"
1212
bug-reports: "https://github.com/BinaryAnalysisPlatform/FrontC/issues"
1313
depends: [
1414
"dune" {>= "2.7"}
15-
"FrontC" {>= "4.0.0"}
15+
"FrontC" {>= "4.1.0"}
1616
"odoc" {with-doc}
1717
]
1818
build: [

Diff for: calipso/calipso.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ exception ParsingError
22

33

44
(* Useful Data *)
5-
let version = "Calipso V4.0 Hugues Cassé."
5+
let version = "Calipso v4.1 Hugues Cassé."
66
let help = version ^ "\n" ^ "calipso [-hmPtsVv] [-r[bcfgkrs]] [-s[lrw]] [-p preprocessor] <file list> [-o <output file>]"
77
exception InternalError
88

Diff for: calipso/stat.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ let display_stats _ =
6464

6565

6666
(* Useful Data *)
67-
let version = "stat V4.0 Hugues Cassé et al."
67+
let version = "stat v4.1 Hugues Cassé et al."
6868
let help = version ^ "\n" ^ "stat [-hPtVv] [-r[bcfgkrs]] [-p preprocessor] <file list>"
6969
exception InternalError
7070

Diff for: ctoxml.opam

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is generated by dune, edit dune-project instead
22
opam-version: "2.0"
3-
version: "4.0.0"
3+
version: "4.1.0"
44
synopsis: "Parses a C program into Cabs AST and dumps as an XML document"
55
maintainer: ["Ivan Gotovchits <[email protected]>"]
66
authors: ["Hugues Cassé <[email protected]> et al"]
@@ -10,7 +10,7 @@ homepage: "https://github.com/BinaryAnalysisPlatform/FrontC"
1010
bug-reports: "https://github.com/BinaryAnalysisPlatform/FrontC/issues"
1111
depends: [
1212
"dune" {>= "2.7"}
13-
"FrontC" {>= "4.0.0"}
13+
"FrontC" {>= "4.1.0"}
1414
"odoc" {with-doc}
1515
]
1616
build: [

Diff for: ctoxml/ctoxml_bin.ml

+44-46
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(*
1+
(*
22
* $Id$
33
* Copyright (c) 2003, Hugues Cassé <[email protected]>
44
*
@@ -10,10 +10,10 @@ open Frontc
1010

1111
(* Options *)
1212
let banner =
13-
"ctoxml V1.0 (02/14/04)\n" ^
14-
"Copyright (c) 2004, Hugues Cassé <[email protected]>\n\n" ^
15-
"SYNTAX:\tctoxml [options] files...\n" ^
16-
"\tctoxml [options] --\n"
13+
"ctoxml v4.1\n" ^
14+
"Copyright (c) 2004-2021, Hugues Cassé <[email protected]> et al\n\n" ^
15+
"SYNTAX:\tctoxml [options] files...\n" ^
16+
"\tctoxml [options] --\n"
1717
let args: parsing_arg list ref = ref []
1818
let files: string list ref = ref []
1919
let out_file = ref ""
@@ -22,55 +22,53 @@ let from_stdin = ref false
2222

2323
(* Options scanning *)
2424
let opts = [
25-
("-o", Arg.Set_string out_file,
26-
"Output to the given file.");
27-
("-pp", Arg.Unit (fun _ -> args := USE_CPP :: !args),
28-
"Preprocess the input files.");
29-
("-nogcc", Arg.Unit (fun _ -> args := (GCC_SUPPORT false) :: !args),
30-
"Do not use the GCC extensions.");
31-
("-proc", Arg.String (fun cpp -> args := (PREPROC cpp) :: !args),
32-
"Use the given preprocessor");
33-
("-i", Arg.String (fun file -> args := (INCLUDE file) :: !args),
34-
"Include the given file.");
35-
("-I", Arg.String (fun dir -> args := (INCLUDE_DIR dir) :: !args),
36-
"Include retrieval directory");
37-
("-D", Arg.String (fun def -> args := (DEF def) :: !args),
38-
"Pass this definition to the preprocessor.");
39-
("-U", Arg.String (fun undef -> args := (UNDEF undef) :: !args),
40-
"Pass this undefinition to the preprocessor.");
41-
("--", Arg.Set from_stdin,
42-
"Takes input from standard input.");
25+
("-o", Arg.Set_string out_file,
26+
"Output to the given file.");
27+
("-pp", Arg.Unit (fun _ -> args := USE_CPP :: !args),
28+
"Preprocess the input files.");
29+
("-nogcc", Arg.Unit (fun _ -> args := (GCC_SUPPORT false) :: !args),
30+
"Do not use the GCC extensions.");
31+
("-proc", Arg.String (fun cpp -> args := (PREPROC cpp) :: !args),
32+
"Use the given preprocessor");
33+
("-i", Arg.String (fun file -> args := (INCLUDE file) :: !args),
34+
"Include the given file.");
35+
("-I", Arg.String (fun dir -> args := (INCLUDE_DIR dir) :: !args),
36+
"Include retrieval directory");
37+
("-D", Arg.String (fun def -> args := (DEF def) :: !args),
38+
"Pass this definition to the preprocessor.");
39+
("-U", Arg.String (fun undef -> args := (UNDEF undef) :: !args),
40+
"Pass this undefinition to the preprocessor.");
41+
("--", Arg.Set from_stdin,
42+
"Takes input from standard input.");
4343
]
4444

4545

4646
(* Main Program *)
4747
let _ =
4848

49-
(* Parse arguments *)
50-
Arg.parse opts (fun file -> files := file :: !files) banner;
49+
(* Parse arguments *)
50+
Arg.parse opts (fun file -> files := file :: !files) banner;
5151

52-
(* Get the output *)
53-
let (output, close) =
54-
if !out_file = "" then (stdout,false)
55-
else ((open_out !out_file), true) in
56-
52+
(* Get the output *)
53+
let (output, close) =
54+
if !out_file = "" then (stdout,false)
55+
else ((open_out !out_file), true) in
5756

58-
(* Process the input *)
59-
let process opts =
60-
match Frontc.parse opts with
61-
PARSING_ERROR -> ()
62-
| PARSING_OK file ->
63-
let doc = Frontc.convert_to_xml file in
64-
Cxml.output_doc output doc in
6557

66-
(* Process the inputs *)
67-
let _ =
68-
if !from_stdin || !files = []
69-
then process !args
70-
else
71-
List.iter (fun file -> process ((FROM_FILE file) :: !args)) !files in
58+
(* Process the input *)
59+
let process opts =
60+
match Frontc.parse opts with
61+
PARSING_ERROR -> ()
62+
| PARSING_OK file ->
63+
let doc = Frontc.convert_to_xml file in
64+
Cxml.output_doc output doc in
7265

73-
(* Close the output if needed *)
74-
if close then close_out output
66+
(* Process the inputs *)
67+
let _ =
68+
if !from_stdin || !files = []
69+
then process !args
70+
else
71+
List.iter (fun file -> process ((FROM_FILE file) :: !args)) !files in
7572

76-
73+
(* Close the output if needed *)
74+
if close then close_out output

Diff for: dune-project

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(lang dune 2.7)
22
(using menhir 2.0)
33
(cram enable)
4-
(version 4.0.0)
4+
(version 4.1.0)
55
(name FrontC)
66

77
(license LGPL-2.0-only)
@@ -28,13 +28,13 @@
2828
nonstructured instructions (i.e., break, return, switch...) \
2929
by branches and, then, remove all branches. \
3030
See https://dblp.org/rec/journals/tsi/CasseFRS02 for more details" )
31-
(depends (FrontC (>= 4.0.0)))
31+
(depends (FrontC (>= 4.1.0)))
3232
(tags (FrontC C analysis)))
3333

3434
(package
3535
(name ctoxml)
3636
(synopsis "Parses a C program into Cabs AST and dumps as an XML document")
37-
(depends (FrontC (>= 4.0.0)))
37+
(depends (FrontC (>= 4.1.0)))
3838
(tags (FrontC C parser XML)))
3939

4040
(generate_opam_files true)

Diff for: frontc/clexer.mll

+2-17
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,8 @@
22
**
33
** Project: FrontC
44
** File: frontc.mll
5-
** Version: 1.0e
6-
** Date: 9.1.99
7-
** Author: Hugues Cassé
8-
**
9-
** 1.0 3.22.99 Hugues Cassé First version.
10-
** a 4.19.99 Hugues Cassé Now accept floating notation `<int part>.'.
11-
** b 4.26.99 Hugues Cassé Correctly handle the # <lineno> <file> ...
12-
** directive. Previous bug was taking last
13-
** integer of the line as line number.
14-
** c 6.4.99 Hugues Cassé Added context handling to manage local variables
15-
** and type definition with the same name.
16-
** d 8.26.99 Hugues Cassé Now, manage escape sequences in string and
17-
** characters.
18-
** e 9.1.99 Hugues Cassé Fix, '\0' now recognized.
19-
** f 10.8.99 Hugues Cassé Understand "__const" GCC.
20-
** 1.1 04.150.05 Hugues Cassé Added support for __XXX__ GNU attributes.
21-
** Added "restrict" keyword.
5+
** Version: 4.1
6+
** Author: Hugues Cassé et al
227
*)
238
{
249
open Ctokens

Diff for: printc/printc_bin.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ open Frontc
1010

1111
(* Options *)
1212
let banner =
13-
"printc V4.0\n" ^
14-
"Copyright (c) 2007, Hugues Cassé <[email protected]> et al.\n\n" ^
13+
"printc v4.1\n" ^
14+
"Copyright (c) 2007-2021, Hugues Cassé <[email protected]> et al.\n\n" ^
1515
"SYNTAX:\tprintc [options] files...\n" ^
1616
"\tprintc [options] --\n"
1717
let args: parsing_arg list ref = ref []

0 commit comments

Comments
 (0)