Commit 1dc88bf0 authored by POGODALLA Sylvain's avatar POGODALLA Sylvain

Take into account jbuilder replacement by dune in opam and fixes #14

parent f738eb30
......@@ -28,19 +28,19 @@ TAR_RELEASE = $(RELEASE)
ACGtk_DIR = $(shell basename `pwd`)
clean:
jbuilder clean
dune clean
find . -name "*~" -exec rm -f {} \;
set_log_level:
# find . -name "jbuild" -exec sed -i -e 's/-level \([^ ]*\)/-level TRACE/' {} \;
find . -name "jbuild" -exec sed -i -e 's/-level \([^ ]*\)/-level NONE/' {} \;
# find . -name "dune" -exec sed -i -e 's/-level \([^ ]*\)/-level TRACE/' {} \;
find . -name "dune" -exec sed -i -e 's/-level \([^ ]*\)/-level NONE/' {} \;
install:
jbuilder install
dune install
uninstall:
jbuilder uninstall
dune uninstall
tar:
if test -d ../$(TAR_RELEASE) ; then rm ../$(TAR_RELEASE) ; fi
......
opam-version: "1.2"
maintainer: "sylvain.pogodalla@inria.fr"
build: [
["jbuilder" "subst"] {pinned}
# remove the -p to also build the local libraries: conflict with the
# fact that some libraries are also part of the acgtkLib package
# ["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "build" "-j" jobs]
]
install: ["jbuilder" "install"]
depends: [
"jbuilder" {build}
"dypgen"
"camlp4"
"bolt"
"ANSITerminal"
"cairo2"
"yojson"
"easy-format"
"ocf"
]
available: [ ocaml-version >= "4.03.0" ]
dev-repo: "https://gitlab.inria.fr/ACG/dev/ACGtk.git"
homepage: "http://acg.gforge.inria.fr/"
license: "CeCILL"
authors: ["Sylvain Pogodalla"]
bug-reports: "sylvain.pogodalla@inria.fr"
opam-package/opam
\ No newline at end of file
......@@ -192,7 +192,6 @@ lib: [
]
doc: [
"_build/install/default/doc/acgtkLib/README.md"
"_build/install/default/doc/acgtkLib/README.html~"
"_build/install/default/doc/acgtkLib/README-opam"
"_build/install/default/doc/acgtkLib/README"
"_build/install/default/doc/acgtkLib/LICENSE.md"
......
......@@ -2,12 +2,12 @@ opam-version: "1.2"
maintainer: "sylvain.pogodalla@inria.fr"
build: [
["jbuilder" "subst"] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"jbuilder" {build}
"dune" {build}
"dypgen"
"camlp4"
"bolt"
......
;; -*-lisp-*-
(env
(release
(flags (:standard -w -58)))
(dev
(flags (:standard -w +42))))
(lang dune 1.0)
\ No newline at end of file
(lang dune 1.0)
(profile release)
\ No newline at end of file
;; -*-lisp-*-
(install
(package acgtk)
(section share_root)
(files (acg.el as emacs/site-lisp/acg.el))
)
;; -*-lisp-*-
(jbuild_version 1)
(install
(
(package acgtk)
(section share_root)
(files ((acg.el as emacs/site-lisp/acg.el)))))
;; -*-lisp-*-
(install
(package acgtk)
(section share)
(files
(anbncndn.acg as examples/anbncndn.acg)
(cfg.acg as examples/cfg.acg)
(config.json as examples/config.json)
(demo-script as examples/demo-script)
(Jean-regarde-telescope.acg as examples/Jean-regarde-telescope.acg)
(MK-lecture-example.acg as examples/MK-lecture-example.acg)
(montague.acg as examples/montague.acg)
(montague-fr.acg as examples/montague-fr.acg)
(montague-script as examples/montague-script)
(README as examples/README)
(README.md as examples/README.md)
(strings.acg as examples/strings.acg)
(tag.acg as examples/tag.acg)
(tag-fr.acg as examples/tag-fr.acg)
(tag-script as examples/tag-script)
))
;; -*-lisp-*-
(jbuild_version 1)
(install
(
(package acgtk)
(section share)
(files (
(anbncndn.acg as examples/anbncndn.acg)
(cfg.acg as examples/cfg.acg)
(config.json as examples/config.json)
(demo-script as examples/demo-script)
(Jean-regarde-telescope.acg as examples/Jean-regarde-telescope.acg)
(MK-lecture-example.acg as examples/MK-lecture-example.acg)
(montague.acg as examples/montague.acg)
(montague-fr.acg as examples/montague-fr.acg)
(montague-script as examples/montague-script)
(README as examples/README)
(README.md as examples/README.md)
(strings.acg as examples/strings.acg)
(tag.acg as examples/tag.acg)
(tag-fr.acg as examples/tag-fr.acg)
(tag-script as examples/tag-script)
))))
#|(env
(dev
(flags (:standard -w +42)))
(release
(flags (:standard -58))))
|#
\ No newline at end of file
......@@ -2,17 +2,17 @@ opam-version: "1.2"
maintainer: "sylvain.pogodalla@inria.fr"
build: [
["jbuilder" "subst"] {pinned}
["dune" "subst"] {pinned}
# remove the -p to also build the local libraries: conflict with the
# fact that some libraries are also part of the acgtkLib package
# ["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "build" "-j" jobs]
# ["dune" "build" "-p" name "-j" jobs]
["dune" "build" "-j" jobs]
]
install: ["jbuilder" "install"]
install: ["dune" "install"]
depends: [
"jbuilder" {build}
"dune" {build}
"dypgen"
"camlp4"
"bolt"
......
......@@ -18,7 +18,6 @@
(**************************************************************************)
open Logic
open Signature
module Data_Lexicon : Interface.Lexicon_sig
with
......
;; -*-lisp-*-
;; This stanza declares the AcgData library
(library
(name acgData)
(public_name acgtkLib.acgData)
(flags (:standard -w -58))
(preprocess (per_module
((action (system "%{bin:camlp4} -parser o -parser op -printer a -loc loc %{lib:bolt:bolt_pp.cmo} -level NONE %{input-file}" ))
reduction acg_lexicon type_system signature)
))
(libraries
logic ; internal library
datalogLib ; internal library
))
(documentation (package acgtk))
......@@ -19,8 +19,6 @@
open UtilsLib
type position = Lexing.position
let update_loc lexbuf file =
let pos = lexbuf.Lexing.lex_curr_p in
let new_file = match file with
......@@ -179,7 +177,7 @@ let version_error_to_string = function
let warning_to_string w =
match w with
| Variable_or_constant (s,pos1,pos2) -> Printf.sprintf "\"%s\" is a variable here, but is also declared as constant in the signature" s
| Variable_or_constant (s,_,_) -> Printf.sprintf "\"%s\" is a variable here, but is also declared as constant in the signature" s
let error_msg e input_file =
let msg,location_msg =
......@@ -195,7 +193,7 @@ let error_msg e input_file =
| None -> msg
| Some loc -> Printf.sprintf "File \"%s\", %s\n%s" input_file loc msg
let dyp_error lexbuf input_file =
let dyp_error lexbuf =
let pos1=Lexing.lexeme_start_p lexbuf in
let pos2=Lexing.lexeme_end_p lexbuf in
match bad_infix_usage () with
......@@ -205,7 +203,7 @@ let dyp_error lexbuf input_file =
let emit_warning w input_file =
match w with
| Variable_or_constant (s,pos1,pos2) ->
| Variable_or_constant (_,pos1,pos2) ->
let msg = warning_to_string w in
let line2 = pos2.Lexing.pos_lnum in
let col2 = pos2.Lexing.pos_cnum - pos2.Lexing.pos_bol in
......
......@@ -110,10 +110,10 @@ val unset_infix : unit -> unit
while the file [filename] is being processed *)
val error_msg : error -> string -> string
(** [dyp_error lexbuf filename] returns an exception {!Error.Error} so
that it can be caught in a uniform way. [lexbuf] and [filename] are
(** [dyp_error lexbuf] returns an exception {!Error.Error} so
that it can be caught in a uniform way. [lexbuf] is
used to set correctly the location information of the parse error *)
val dyp_error : Lexing.lexbuf -> string -> exn
val dyp_error : Lexing.lexbuf -> exn
(** [warnings_to_string filname ws] returns a string describing the
warnings anf their location for the file [filename] *)
......
;; -*-lisp-*-
(jbuild_version 1)
;; This stanza declares the AcgData library
(library
((name acgData)
(public_name acgtkLib.acgData)
(flags (:standard -w -58))
(preprocess (per_module
((action (system "${bin:camlp4} -parser o -parser op -printer a -loc loc ${lib:bolt:bolt_pp.cmo} -level NONE ${<}" ))
(reduction acg_lexicon type_system signature))
))
(libraries (
logic ; internal library
datalogLib ; internal library
))))
(documentation ((package acgtk)))
......@@ -23,7 +23,8 @@ struct
[obj_type=image_1 -> image_2 -> ... -> image_n]. Note that the
list is in the {em reverse order} and that [abs_type] should be
2nd order. *)
let map_types abs_type obj_type sg obj_sg=
let map_types abs_type obj_type sg =
let rec map_types_aux abs_type obj_type lst =
LOG "Mapping (aux) type:%s" (Sg.type_to_string abs_type sg) LEVEL TRACE;
LOG "On (aux): %s" (Lambda.raw_type_to_string obj_type) LEVEL TRACE;
......@@ -117,14 +118,14 @@ struct
object signature of some ACG. *)
let generate_and_add_rule
~abs_cst:(name,abs_t_type)
~abs_cst:(_,abs_t_type)
~obj_princ_type:principle_type
~obj_typing_env:env
prog
~abs_sig
~obj_sig =
let rule_id,prog=Datalog.Program.get_fresh_rule_id prog in
let type_lst = map_types abs_t_type principle_type abs_sig obj_sig in
let type_lst = map_types abs_t_type principle_type abs_sig in
match type_lst with
| [] -> failwith "Bug: there should be a type correspondance"
| (_,name,image)::tl ->
......@@ -171,7 +172,7 @@ struct
let edb_and_query ~obj_term ~obj_type ~obj_typing_env ~dist_type prog ~abs_sig ~obj_sig =
(* It makes the assumption that no constant has been
previously defined or used in the program *)
let type_lst = map_types dist_type obj_type abs_sig obj_sig in
let type_lst = map_types dist_type obj_type abs_sig in
match type_lst with
| [] -> failwith "Bug: there should be a type correspondance"
| [_,name,image] ->
......@@ -188,7 +189,7 @@ struct
([],prog) in
let prog=Datalog.Program.add_e_facts prog (e_facts,prog.Datalog.Program.const_table,prog.Datalog.Program.rule_id_gen) in
build_predicate_w_cst_args (name,image) prog
| (_,name,image)::tl -> failwith "Bug: querying non atomic types is not yet implemented"
| (_,_,_)::tl -> failwith "Bug: querying non atomic types is not yet implemented"
end
......@@ -17,7 +17,6 @@
(* *)
(**************************************************************************)
open Logic.Abstract_syntax
open Logic.Lambda
(*
......
;; -*-lisp-*-
(ocamllex db_lexer)
(ocamlyacc db_parser)
;; This stanza declares the DatalogLib
(library
(name datalogLib)
(public_name acgtkLib.datalogLib)
(flags (:standard -w -58))
(preprocess (per_module
(
(action (system "%{bin:camlp4} -parser o -parser op -printer a -loc loc %{lib:bolt:bolt_pp.cmo} -level NONE %{input-file}" ))
datalog
unionFind
)
)
)
(modules (:standard db_parser db_lexer \ test db_test))
(libraries
bolt ; external libraries
str ; external libraries
ANSITerminal ; external libraries
utilsLib ; internal library
))
(executables
(names test db_test)
(modules test db_test)
(preprocess (per_module
((action (system "%{bin:camlp4} -parser o -parser op -printer a -loc loc %{lib:bolt:bolt_pp.cmo} -level NONE %{input-file}" ))
db_test)
))
(libraries
threads
utilsLib
datalogLib
))
(alias
(name testbuild)
(deps test.exe db_test.exe))
(documentation (package acgtk))
;; -*-lisp-*-
(jbuild_version 1)
(ocamllex (db_lexer))
(ocamlyacc (db_parser))
;; This stanza declares the DatalogLib
(library
((name datalogLib)
(public_name acgtkLib.datalogLib)
(flags (:standard -w -58))
(preprocess (per_module
(
(action (system "${bin:camlp4} -parser o -parser op -printer a -loc loc ${lib:bolt:bolt_pp.cmo} -level NONE ${<}" ))
(datalog unionFind)
)
)
)
(modules (:standard db_parser db_lexer \ test db_test))
(libraries (bolt ; external libraries
str ; external libraries
ANSITerminal ; external libraries
utilsLib ; internal library
))))
(executables
((names (test db_test))
(modules (test db_test))
(preprocess (per_module
((action (system "${bin:camlp4} -parser o -parser op -printer a -loc loc ${lib:bolt:bolt_pp.cmo} -level NONE ${<}" ))
(db_test))
))
(libraries (threads
utilsLib
datalogLib))))
(alias
((name testbuild)
(deps (test.exe db_test.exe))))
(documentation ((package acgtk)))
......@@ -25,13 +25,14 @@ struct
l in
init length (fun i -> IntMap.find i map)
let rec get_v1 i t =
(* let rec get_v1 i t =
match !t with
| Arr a -> a.(i+1)
| Diff (j,v,_) when j=i -> v
| Diff (_,_,t') -> get_v1 i t'
| Invalid -> raise Unaccessible
*)
let set_v1 i v t =
match !t with
| Arr a as n ->
......@@ -61,7 +62,7 @@ struct
end
| Invalid -> raise Unaccessible
let rec get_aux i t =
let get_aux i t =
match !t with
| Arr a -> a.(i)
| Diff (i,v,t') ->
......
;; -*-lisp-*-
(executable
(name test)
(libraries
threads
utilsLib
logic))
(alias
(name testbuild)
(deps test.exe))
;; -*-lisp-*-
(jbuild_version 1)
(executable
((name test)
(libraries (threads
utilsLib
logic))))
(alias
((name testbuild)
(deps (test.exe))))
......@@ -570,7 +570,7 @@ sig_entries :
let starting_parse_time = Sys.time () in
let e =
try (fst (List.hd (data ~global_data:override ~local_data:actual_env Data_lexer.lexer lexbuf))) with
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf filename) in
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf) in
let ending_parse_time = Sys.time () in
let () = Printf.printf "Done (required %.3f seconds).\n%!" (ending_parse_time -. starting_parse_time) in
let () = match output with
......@@ -612,7 +612,7 @@ let parse_term ?(output=false) t sg =
let () = Data_lexer.set_to_term () in
let abs_term,abs_type =
try fst (List.hd(term_alone ~global_data:false ~local_data:(Some (Signature sg)) Data_lexer.lexer lexbuf)) with
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf "stdin") in
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf) in
let () =
match output with
| true ->
......@@ -649,7 +649,7 @@ let parse_heterogenous_term ?(output=false) t lex =
let () = Data_lexer.set_to_term () in
let obj_term,abs_type =
try fst (List.hd(heterogenous_term_and_type ~global_data:false ~local_data:(Some (Abs_and_obj (abs,obj))) Data_lexer.lexer lexbuf)) with
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf "stdin") in
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf) in
let abs_type=Environment.Signature1.convert_type abs_type abs in
let obj_type=Environment.Lexicon.interpret_type abs_type lex in
let obj_term=Environment.Signature1.typecheck obj_term obj_type obj in
......@@ -685,7 +685,7 @@ let parse_heterogenous_term ?(output=false) t lex =
try
let () = Data_lexer.set_to_sig_entry () in
try Some ((fst (List.hd(sig_entry ~global_data:false ~local_data:(Some (Signature sg)) Data_lexer.lexer lexbuf))) sg) with
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf "stdin")
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf)
with
| Error.Error er ->
let () = pp_error er t in
......@@ -698,7 +698,7 @@ let parse_heterogenous_term ?(output=false) t lex =
try
let () = Data_lexer.set_to_lex_entry () in
try Some ((fst (List.hd(lex_entry ~global_data:false ~local_data:(Some (Abs_and_obj (Environment.Lexicon.get_sig lex))) Data_lexer.lexer lexbuf))) lex) with
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf "stdin")
| Dyp.Syntax_error -> raise (Error.dyp_error lexbuf)
with
| Error.Error er ->
let () = pp_error er t in
......
;; -*-lisp-*-
(rule
(targets data_parser.ml)
(deps (:input-file data_parser.dyp))
(action (chdir %{project_root} (run %{bin:dypgen} --noemit-token-type --no-pp --no-obj-type --no-mli %{input-file})))
)
(ocamllex data_lexer)
;; This stanza declares the Grammar library
(library
(name grammars)
(preprocess (per_module ((action (system "%{bin:camlp4} -parser o -parser op -printer a -loc loc %{lib:bolt:bolt_pp.cmo} -level NONE %{input-file}" ))
entry)))
(flags (:standard -w -58))
(modules (:standard \ acgc interactive))
(libraries
logic
acgData
)
)
;; This declares the acgc executable implemented by acgc.ml
(executable
(name acgc)
(public_name acgc)
(package acgtk)
(modules acgc)
(libraries
threads
logic
acgData
grammars
))
(documentation (package acgtkLib))
;; -*-lisp-*-
(jbuild_version 1)
(rule
((targets (data_parser.ml))
(deps (data_parser.dyp))
(action (chdir ${ROOT} (run ${bin:dypgen} --noemit-token-type --no-pp --no-obj-type --no-mli ${<}))))
)
(ocamllex (data_lexer))
;; This stanza declares the Grammar library
(library
((name grammars)
(preprocess (per_module ((action (system "${bin:camlp4} -parser o -parser op -printer a -loc loc ${lib:bolt:bolt_pp.cmo} -level NONE ${<}" ))(entry))))
(flags (:standard -w -58))
(modules (:standard \ acgc interactive))
(libraries (
logic
acgData
))
))
;; This declares the acgc executable implemented by acgc.ml
(executable
((name acgc)
(public_name acgc)
(package acgtk)
(modules acgc)
(libraries (
threads
logic
acgData
grammars
))))
(documentation ((package acgtkLib)))
;; -*-lisp-*-
;; This declares the Logic libreary
(library
(name logic)
(public_name acgtkLib.logic)
(flags (:standard -w -58))
(modules (:standard \ typeInference_test))
(preprocess (per_module
((action (system "%{bin:camlp4} -parser o -parser op -printer a -loc loc %{lib:bolt:bolt_pp.cmo} -level NONE %{input-file}" ))
typeInference
varUnionFind))
)
(libraries
dyp ; external library
ANSITerminal ; external library
utilsLib ; internal library
))
(executables
(names typeInference_test)
(modules typeInference_test)
(libraries
threads
utilsLib
logic))
(alias
(name testbuild)
(deps typeInference_test.exe))
(documentation (package acgtk))
;; -*-lisp-*-
(jbuild_version 1)
;; This declares the Logic libreary
(library
((name logic)
(public_name acgtkLib.logic)
(flags (:standard -w -58))
(modules (:standard \ typeInference_test))
(preprocess (per_module
((action (system "${bin:camlp4} -parser o -parser op -printer a -loc loc ${lib:bolt:bolt_pp.cmo} -level NONE ${<}" ))
(typeInference varUnionFind))
))
(libraries (dyp ; external library
ANSITerminal ; external library
utilsLib ; internal library
))))
(executables
((names (typeInference_test))
(modules (typeInference_test))
(libraries (threads
utilsLib
logic))))
(alias
((name testbuild)
(deps (typeInference_test.exe))))
(documentation ((package acgtk)))
(**************************************************************************)
(* g *)
(* *)
(* ACG development toolkit *)
(* *)
(* Copyright 2008 INRIA *)
......
;; -*-lisp-*-
(rule
(targets script_parser.ml)
(deps (:input-file script_parser.dyp))
(action (chdir %{project_root} (run %{bin:dypgen} --noemit-token-type --no-pp --no-obj-type --no-mli %{input-file})))
)
(ocamllex script_lexer)
;; This stanza declares the scripting library
(library
(name scripting)
(flags (:standard -w -58))
(modules (:standard \ acg io_test))
(libraries
threads
cairo2
ocf
utilsLib
acgData
grammars
))
;; This declares the acgc executable implemented by acg.ml
(executable
(name acg)
(public_name acg)
(package acgtk)
(modules acg)
(flags (:standard -w -58))
(libraries
threads
cairo2
ocf
utilsLib
acgData
grammars
scripting
))
(documentation (package acgtk))
;; -*-lisp-*-
(jbuild_version 1)
(rule
((targets (script_parser.ml))
(deps (script_parser.dyp))
(action (chdir ${ROOT} (run ${bin:dypgen} --noemit-token-type --no-pp --no-obj-type --no-mli ${<}))))
)
(ocamllex (script_lexer))
;; This stanza declares the scripting library
(library
((name scripting)
(flags (:standard -w -58))
(modules (:standard \ acg io_test))
(libraries (
threads
cairo2
ocf
utilsLib
acgData
grammars
))