Commit 4c75051e authored by bguillaum's avatar bguillaum

remove bad_labels + improve Makefiles

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@6889 7838e531-6607-4d57-9587-6c381814729c
parent 196ab41d
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
(require 'generic-x) ;;pour Emacs OK, mais semble ne pas marcher avec XEmacs (require 'generic-x) ;;pour Emacs OK, mais semble ne pas marcher avec XEmacs
(define-generic-mode 'grew-mode (define-generic-mode 'grew-mode
'("%");;comments '("%");;comments
'("features" "module" "rule" "lex_rule" "match" "without" "labels" "bad_labels" "sequences" "commands" "graph" "confluent" "include" "filter");;keywords '("features" "module" "rule" "lex_rule" "match" "without" "labels" "sequences" "commands" "graph" "confluent" "include" "filter");;keywords
'( '(
;; ("class\\s (\*\*)* +\\(\\sw[a-zA-Z0-9_.-]*\\)" 1 'font-lock-type-face);noms de classes ;; ("class\\s (\*\*)* +\\(\\sw[a-zA-Z0-9_.-]*\\)" 1 'font-lock-type-face);noms de classes
;; ("\?[a-zA-Z0-9]+" . font-lock-variable-name-face) ;; ("\?[a-zA-Z0-9]+" . font-lock-variable-name-face)
......
...@@ -109,18 +109,6 @@ let rule_page_text previous next rule m ast file = " ...@@ -109,18 +109,6 @@ let rule_page_text previous next rule m ast file = "
"</code>" "</code>"
) else ( ""))^ ) else ( ""))^
(if (List.length m.Ast.bad_labels > 0) then (
"<div class=\"h7\">Prohibited</div>
<code class=\"code\">"^
(
let rec tab_to_html tab = match tab with
| [] -> ""
| h::[] -> h
| h::t -> h^", "^(tab_to_html t)
in tab_to_html m.Ast.bad_labels
)^
"</code>"
) else ( ""))^
*) *)
(* (*
...@@ -339,8 +327,8 @@ in ...@@ -339,8 +327,8 @@ in
let rules_array = Array.of_list modules_array.(i).Ast.rules in let rules_array = Array.of_list modules_array.(i).Ast.rules in
for j = 0 to (Array.length rules_array -1) do for j = 0 to (Array.length rules_array -1) do
let pattern_commands_view = Filename.concat output_dir (modules_array.(i).Ast.module_id^"_"^rules_array.(j).Ast.rule_id^"_pattern_commands") in (* let pattern_commands_view = Filename.concat output_dir (modules_array.(i).Ast.module_id^"_"^rules_array.(j).Ast.rule_id^"_pattern_commands") in *)
let antipattern_view = Filename.concat output_dir (modules_array.(i).Ast.module_id^"_"^rules_array.(j).Ast.rule_id^"antipattern_") in (* let antipattern_view = Filename.concat output_dir (modules_array.(i).Ast.module_id^"_"^rules_array.(j).Ast.rule_id^"antipattern_") in *)
(* let (patterns,antis) = (Ast.Grew_dot.to_dot_rule rules_array.(j)) in*) (* let (patterns,antis) = (Ast.Grew_dot.to_dot_rule rules_array.(j)) in*)
(* let i2 = ref 0 in*) (* let i2 = ref 0 in*)
......
...@@ -61,7 +61,7 @@ HTMLer_byte: ...@@ -61,7 +61,7 @@ HTMLer_byte:
# librairie # librairie
libgrew.mli : grew_types.mli libgrew.mli : grew_types.mli libgrew_.mli
rm -rf libgrew.mli rm -rf libgrew.mli
touch libgrew.mli touch libgrew.mli
echo "(** Grew Library" > libgrew.mli echo "(** Grew Library" > libgrew.mli
...@@ -76,8 +76,6 @@ libgrew.mli : grew_types.mli ...@@ -76,8 +76,6 @@ libgrew.mli : grew_types.mli
cat libgrew_.mli >> libgrew.mli cat libgrew_.mli >> libgrew.mli
libgrew.cma : $(FILES_CMO) parser_byte HTMLer_byte libgrew.mli libgrew.ml libgrew.cma : $(FILES_CMO) parser_byte HTMLer_byte libgrew.mli libgrew.ml
rm libgrew.mli
@make libgrew.mli
ifeq (@DEP2PICT@,no) ifeq (@DEP2PICT@,no)
ocamlc -c -pp 'camlp4o pa_macro.cmo' $(BYPE_FLAGS) $(FILES_CMO) str.cma -I parser $(PARSER_CMO) -I HTMLer HTMLer.cmo libgrew.mli ocamlc -c -pp 'camlp4o pa_macro.cmo' $(BYPE_FLAGS) $(FILES_CMO) str.cma -I parser $(PARSER_CMO) -I HTMLer HTMLer.cmo libgrew.mli
ocamlc -a -o libgrew.cma $(BYPE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall $(FILES_CMO) -I parser $(PARSER_CMO) -I HTMLer HTMLer.cmo libgrew.ml ocamlc -a -o libgrew.cma $(BYPE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall $(FILES_CMO) -I parser $(PARSER_CMO) -I HTMLer HTMLer.cmo libgrew.ml
...@@ -87,8 +85,6 @@ else ...@@ -87,8 +85,6 @@ else
endif endif
libgrew.cmxa : $(FILES_CMX) parser_opt HTMLer_opt libgrew.mli libgrew.ml libgrew.cmxa : $(FILES_CMX) parser_opt HTMLer_opt libgrew.mli libgrew.ml
rm libgrew.mli
@make libgrew.mli
ifeq (@DEP2PICT@,no) ifeq (@DEP2PICT@,no)
ocamlopt -c -pp 'camlp4o pa_macro.cmo' $(OPT_FLAGS) $(FILES_CMX) str.cmxa -I parser $(PARSER_CMX) -I HTMLer HTMLer.cmx libgrew.mli ocamlopt -c -pp 'camlp4o pa_macro.cmo' $(OPT_FLAGS) $(FILES_CMX) str.cmxa -I parser $(PARSER_CMX) -I HTMLer HTMLer.cmx libgrew.mli
ocamlopt -a -o libgrew.cmxa $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall $(FILES_CMX) -I parser $(PARSER_CMX) -I HTMLer HTMLer.cmx libgrew.ml ocamlopt -a -o libgrew.cmxa $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -linkall $(FILES_CMX) -I parser $(PARSER_CMX) -I HTMLer HTMLer.cmx libgrew.ml
...@@ -322,6 +318,7 @@ clean: ...@@ -322,6 +318,7 @@ clean:
rm -f grew grew.byte rm -f grew grew.byte
rm -f test test.byte rm -f test test.byte
rm -f *.nf *.png *.html rm -f *.nf *.png *.html
rm -f libgrew.mli
purge_makefile: purge_makefile:
@make -C HTMLer purge @make -C HTMLer purge
......
...@@ -101,7 +101,6 @@ module Ast = struct ...@@ -101,7 +101,6 @@ module Ast = struct
type modul = { type modul = {
module_id:Id.name; module_id:Id.name;
local_labels: (string * string option) list; local_labels: (string * string option) list;
bad_labels: string list;
rules: rule list; rules: rule list;
confluent: bool; confluent: bool;
module_doc:string; module_doc:string;
......
...@@ -89,7 +89,6 @@ module Ast : sig ...@@ -89,7 +89,6 @@ module Ast : sig
type modul = { type modul = {
module_id:Id.name; module_id:Id.name;
local_labels: (string * string option) list; local_labels: (string * string option) list;
bad_labels: string list;
rules: rule list; rules: rule list;
confluent: bool; confluent: bool;
module_doc:string; module_doc:string;
......
...@@ -152,7 +152,6 @@ module Modul = struct ...@@ -152,7 +152,6 @@ module Modul = struct
type t = { type t = {
name: string; name: string;
local_labels: (string * string option) array; local_labels: (string * string option) array;
bad_labels: Label.t list;
rules: Rule.t list; rules: Rule.t list;
filters: Rule.t list; filters: Rule.t list;
confluent: bool; confluent: bool;
...@@ -177,7 +176,6 @@ module Modul = struct ...@@ -177,7 +176,6 @@ module Modul = struct
{ {
name = ast_module.Ast.module_id; name = ast_module.Ast.module_id;
local_labels = locals; local_labels = locals;
bad_labels = List.map Label.from_string ast_module.Ast.bad_labels;
rules = rules; rules = rules;
filters = filters; filters = filters;
confluent = ast_module.Ast.confluent; confluent = ast_module.Ast.confluent;
......
...@@ -10,22 +10,24 @@ parser_global.cmo: parser_global.ml ...@@ -10,22 +10,24 @@ parser_global.cmo: parser_global.ml
parser_global.cmx: parser_global.ml parser_global.cmx: parser_global.ml
ocamlopt -c $(OPT_FLAGS) parser_global.ml ocamlopt -c $(OPT_FLAGS) parser_global.ml
gr_grs_parser.cmx: gr_grs_parser.mly ../grew_utils.cmx ../grew_ast.cmx parser_global.cmo gr_grs_parser.ml: gr_grs_parser.mly
menhir --infer --ocamlc "ocamlc -c -I .. grew_utils.cmo grew_ast.cmo parser_global.cmo" gr_grs_parser.mly menhir --infer --ocamlc "ocamlc -c -I .. grew_utils.cmo grew_ast.cmo parser_global.cmo" gr_grs_parser.mly
gr_grs_parser.cmx: gr_grs_parser.ml ../grew_utils.cmx ../grew_ast.cmx parser_global.cmo
ocamlopt -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.mli ocamlopt -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.mli
ocamlopt -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.ml ocamlopt -c $(OPT_FLAGS) -I .. grew_utils.cmx grew_ast.cmx gr_grs_parser.ml
gr_grs_parser.cmo: gr_grs_parser.mly ../grew_utils.cmo ../grew_ast.cmx parser_global.cmo gr_grs_parser.cmo: gr_grs_parser.ml ../grew_utils.cmo ../grew_ast.cmx parser_global.cmo
menhir --infer --ocamlc "ocamlc -c -I .. grew_utils.cmo grew_ast.cmo parser_global.cmo" gr_grs_parser.mly
ocamlc -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.mli ocamlc -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.mli
ocamlc -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.ml ocamlc -c $(BYTE_FLAGS) -I .. grew_utils.cmo grew_ast.cmo gr_grs_parser.ml
lexer.cmx: gr_grs_parser.cmx lexer.mll ../grew_ast.cmx lexer.ml: lexer.mll
ocamllex lexer.mll ocamllex lexer.mll
lexer.cmx: gr_grs_parser.cmx lexer.ml ../grew_ast.cmx
ocamlopt -c $(OPT_FLAGS) -I .. grew_ast.cmx lexer.ml ocamlopt -c $(OPT_FLAGS) -I .. grew_ast.cmx lexer.ml
lexer.cmo: gr_grs_parser.cmo lexer.mll ../grew_ast.cmo lexer.cmo: gr_grs_parser.cmo lexer.ml ../grew_ast.cmo
ocamllex lexer.mll
ocamlc -c $(BYTE_FLAGS) -I .. grew_ast.cmo lexer.ml ocamlc -c $(BYTE_FLAGS) -I .. grew_ast.cmo lexer.ml
grew_parser.cmx: gr_grs_parser.cmx lexer.cmx grew_parser.ml ../grew_ast.cmx grew_parser.cmx: gr_grs_parser.cmx lexer.cmx grew_parser.ml ../grew_ast.cmx
...@@ -36,7 +38,3 @@ grew_parser.cmo: gr_grs_parser.cmo lexer.cmo grew_parser.ml ../grew_ast.cmo ...@@ -36,7 +38,3 @@ grew_parser.cmo: gr_grs_parser.cmo lexer.cmo grew_parser.ml ../grew_ast.cmo
clean: clean:
rm -rf *.cmi *.cmx *.cmo lexer.ml gr_grs_parser.ml *.o *.mli *.annot rm -rf *.cmi *.cmx *.cmo lexer.ml gr_grs_parser.ml *.o *.mli *.annot
# ocamlopt -c rules_to_html.ml
# ocamlopt -o main str.cmxa grew_ast.cmx rules_to_html.cmx lexer.cmx gr_grs_parser.cmx main.ml
...@@ -44,7 +44,6 @@ let localize t = (t,get_loc ()) ...@@ -44,7 +44,6 @@ let localize t = (t,get_loc ())
%token FEATURE /* feature */ %token FEATURE /* feature */
%token FILE /* file */ %token FILE /* file */
%token LABELS /* labels */ %token LABELS /* labels */
%token BAD_LABELS /* bad_labels */
%token MATCH /* match */ %token MATCH /* match */
%token WITHOUT /* without */ %token WITHOUT /* without */
%token COMMANDS /* commands */ %token COMMANDS /* commands */
...@@ -239,11 +238,10 @@ modules: ...@@ -239,11 +238,10 @@ modules:
| x = list(grew_module) { x } | x = list(grew_module) { x }
grew_module: grew_module:
| doc = option(module_doc) MODULE conf = boption(CONFLUENT) id = module_id LACC l = option(local_labels) b = option(local_bad_labels) r = rules RACC | doc = option(module_doc) MODULE conf = boption(CONFLUENT) id = module_id LACC l = option(local_labels) r = rules RACC
{ {
{ Ast.module_id = fst id; { Ast.module_id = fst id;
local_labels = (match l with None -> [] | Some x -> x); local_labels = (match l with None -> [] | Some x -> x);
bad_labels = (match b with None -> [] | Some x -> x);
rules = r; rules = r;
confluent = conf; confluent = conf;
module_doc = (match doc with Some d -> d | None -> ""); module_doc = (match doc with Some d -> d | None -> "");
...@@ -264,7 +262,6 @@ module_doc: ...@@ -264,7 +262,6 @@ module_doc:
/* */ /* */
/* labels {ANT_TMP} */ /* labels {ANT_TMP} */
/* */ /* */
/* bad_labels { SUJ, OBJ } */
/*=============================================================================================*/ /*=============================================================================================*/
...@@ -272,13 +269,6 @@ module_doc: ...@@ -272,13 +269,6 @@ module_doc:
local_labels: local_labels:
| LABELS x = labels { x } | LABELS x = labels { x }
local_bad_labels:
| BAD_LABELS x = bad_labels { x }
%inline bad_labels:
| x = delimited(LACC,separated_nonempty_list(COMA,IDENT),RACC) { x }
/*=============================================================================================*/ /*=============================================================================================*/
/* */ /* */
......
...@@ -64,7 +64,6 @@ and global = parse ...@@ -64,7 +64,6 @@ and global = parse
| "feature" { FEATURE } | "feature" { FEATURE }
| "file" { FILE } | "file" { FILE }
| "labels" { LABELS } | "labels" { LABELS }
| "bad_labels" { BAD_LABELS }
| "match" { MATCH } | "match" { MATCH }
| "without" { WITHOUT } | "without" { WITHOUT }
| "commands" { COMMANDS } | "commands" { COMMANDS }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment