-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
10 changed files
with
60 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
version: "4.0.0" | ||
version: "4.1.0" | ||
synopsis: "Parses a C program into Cabs AST and dumps as an XML document" | ||
maintainer: ["Ivan Gotovchits <[email protected]>"] | ||
authors: ["Hugues Cassé <[email protected]> et al"] | ||
|
@@ -10,7 +10,7 @@ homepage: "https://github.com/BinaryAnalysisPlatform/FrontC" | |
bug-reports: "https://github.com/BinaryAnalysisPlatform/FrontC/issues" | ||
depends: [ | ||
"dune" {>= "2.7"} | ||
"FrontC" {>= "4.0.0"} | ||
"FrontC" {>= "4.1.0"} | ||
"odoc" {with-doc} | ||
] | ||
build: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(* | ||
(* | ||
* $Id$ | ||
* Copyright (c) 2003, Hugues Cassé <[email protected]> | ||
* | ||
|
@@ -10,10 +10,10 @@ open Frontc | |
|
||
(* Options *) | ||
let banner = | ||
"ctoxml V1.0 (02/14/04)\n" ^ | ||
"Copyright (c) 2004, Hugues Cassé <[email protected]>\n\n" ^ | ||
"SYNTAX:\tctoxml [options] files...\n" ^ | ||
"\tctoxml [options] --\n" | ||
"ctoxml v4.1\n" ^ | ||
"Copyright (c) 2004-2021, Hugues Cassé <[email protected]> et al\n\n" ^ | ||
"SYNTAX:\tctoxml [options] files...\n" ^ | ||
"\tctoxml [options] --\n" | ||
let args: parsing_arg list ref = ref [] | ||
let files: string list ref = ref [] | ||
let out_file = ref "" | ||
|
@@ -22,55 +22,53 @@ let from_stdin = ref false | |
|
||
(* Options scanning *) | ||
let opts = [ | ||
("-o", Arg.Set_string out_file, | ||
"Output to the given file."); | ||
("-pp", Arg.Unit (fun _ -> args := USE_CPP :: !args), | ||
"Preprocess the input files."); | ||
("-nogcc", Arg.Unit (fun _ -> args := (GCC_SUPPORT false) :: !args), | ||
"Do not use the GCC extensions."); | ||
("-proc", Arg.String (fun cpp -> args := (PREPROC cpp) :: !args), | ||
"Use the given preprocessor"); | ||
("-i", Arg.String (fun file -> args := (INCLUDE file) :: !args), | ||
"Include the given file."); | ||
("-I", Arg.String (fun dir -> args := (INCLUDE_DIR dir) :: !args), | ||
"Include retrieval directory"); | ||
("-D", Arg.String (fun def -> args := (DEF def) :: !args), | ||
"Pass this definition to the preprocessor."); | ||
("-U", Arg.String (fun undef -> args := (UNDEF undef) :: !args), | ||
"Pass this undefinition to the preprocessor."); | ||
("--", Arg.Set from_stdin, | ||
"Takes input from standard input."); | ||
("-o", Arg.Set_string out_file, | ||
"Output to the given file."); | ||
("-pp", Arg.Unit (fun _ -> args := USE_CPP :: !args), | ||
"Preprocess the input files."); | ||
("-nogcc", Arg.Unit (fun _ -> args := (GCC_SUPPORT false) :: !args), | ||
"Do not use the GCC extensions."); | ||
("-proc", Arg.String (fun cpp -> args := (PREPROC cpp) :: !args), | ||
"Use the given preprocessor"); | ||
("-i", Arg.String (fun file -> args := (INCLUDE file) :: !args), | ||
"Include the given file."); | ||
("-I", Arg.String (fun dir -> args := (INCLUDE_DIR dir) :: !args), | ||
"Include retrieval directory"); | ||
("-D", Arg.String (fun def -> args := (DEF def) :: !args), | ||
"Pass this definition to the preprocessor."); | ||
("-U", Arg.String (fun undef -> args := (UNDEF undef) :: !args), | ||
"Pass this undefinition to the preprocessor."); | ||
("--", Arg.Set from_stdin, | ||
"Takes input from standard input."); | ||
] | ||
|
||
|
||
(* Main Program *) | ||
let _ = | ||
|
||
(* Parse arguments *) | ||
Arg.parse opts (fun file -> files := file :: !files) banner; | ||
(* Parse arguments *) | ||
Arg.parse opts (fun file -> files := file :: !files) banner; | ||
|
||
(* Get the output *) | ||
let (output, close) = | ||
if !out_file = "" then (stdout,false) | ||
else ((open_out !out_file), true) in | ||
|
||
(* Get the output *) | ||
let (output, close) = | ||
if !out_file = "" then (stdout,false) | ||
else ((open_out !out_file), true) in | ||
|
||
(* Process the input *) | ||
let process opts = | ||
match Frontc.parse opts with | ||
PARSING_ERROR -> () | ||
| PARSING_OK file -> | ||
let doc = Frontc.convert_to_xml file in | ||
Cxml.output_doc output doc in | ||
|
||
(* Process the inputs *) | ||
let _ = | ||
if !from_stdin || !files = [] | ||
then process !args | ||
else | ||
List.iter (fun file -> process ((FROM_FILE file) :: !args)) !files in | ||
(* Process the input *) | ||
let process opts = | ||
match Frontc.parse opts with | ||
PARSING_ERROR -> () | ||
| PARSING_OK file -> | ||
let doc = Frontc.convert_to_xml file in | ||
Cxml.output_doc output doc in | ||
|
||
(* Close the output if needed *) | ||
if close then close_out output | ||
(* Process the inputs *) | ||
let _ = | ||
if !from_stdin || !files = [] | ||
then process !args | ||
else | ||
List.iter (fun file -> process ((FROM_FILE file) :: !args)) !files in | ||
|
||
|
||
(* Close the output if needed *) | ||
if close then close_out output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ open Frontc | |
|
||
(* Options *) | ||
let banner = | ||
"printc V4.0\n" ^ | ||
"Copyright (c) 2007, Hugues Cassé <[email protected]> et al.\n\n" ^ | ||
"printc v4.1\n" ^ | ||
"Copyright (c) 2007-2021, Hugues Cassé <[email protected]> et al.\n\n" ^ | ||
"SYNTAX:\tprintc [options] files...\n" ^ | ||
"\tprintc [options] --\n" | ||
let args: parsing_arg list ref = ref [] | ||
|