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 @@
(require 'generic-x) ;;pour Emacs OK, mais semble ne pas marcher avec XEmacs
(define-generic-mode 'grew-mode
'("%");;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
;; ("\?[a-zA-Z0-9]+" . font-lock-variable-name-face)
......
......@@ -109,18 +109,6 @@ let rule_page_text previous next rule m ast file = "
"</code>"
) 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
let rules_array = Array.of_list modules_array.(i).Ast.rules in
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 antipattern_view = Filename.concat output_dir (modules_array.(i).Ast.module_id^"_"^rules_array.(j).Ast.rule_id^"antipattern_") 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 (patterns,antis) = (Ast.Grew_dot.to_dot_rule rules_array.(j)) in*)
(* let i2 = ref 0 in*)
......
......@@ -61,7 +61,7 @@ HTMLer_byte:
# librairie
libgrew.mli : grew_types.mli
libgrew.mli : grew_types.mli libgrew_.mli
rm -rf libgrew.mli
touch libgrew.mli
echo "(** Grew Library" > libgrew.mli
......@@ -76,8 +76,6 @@ libgrew.mli : grew_types.mli
cat libgrew_.mli >> libgrew.mli
libgrew.cma : $(FILES_CMO) parser_byte HTMLer_byte libgrew.mli libgrew.ml
rm libgrew.mli
@make libgrew.mli
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 -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
endif
libgrew.cmxa : $(FILES_CMX) parser_opt HTMLer_opt libgrew.mli libgrew.ml
rm libgrew.mli
@make libgrew.mli
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 -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:
rm -f grew grew.byte
rm -f test test.byte
rm -f *.nf *.png *.html
rm -f libgrew.mli
purge_makefile:
@make -C HTMLer purge
......
......@@ -101,7 +101,6 @@ module Ast = struct
type modul = {
module_id:Id.name;
local_labels: (string * string option) list;
bad_labels: string list;
rules: rule list;
confluent: bool;
module_doc:string;
......
......@@ -89,7 +89,6 @@ module Ast : sig
type modul = {
module_id:Id.name;
local_labels: (string * string option) list;
bad_labels: string list;
rules: rule list;
confluent: bool;
module_doc:string;
......
......@@ -152,7 +152,6 @@ module Modul = struct
type t = {
name: string;
local_labels: (string * string option) array;
bad_labels: Label.t list;
rules: Rule.t list;
filters: Rule.t list;
confluent: bool;
......@@ -177,7 +176,6 @@ module Modul = struct
{
name = ast_module.Ast.module_id;
local_labels = locals;
bad_labels = List.map Label.from_string ast_module.Ast.bad_labels;
rules = rules;
filters = filters;
confluent = ast_module.Ast.confluent;
......
......@@ -10,22 +10,24 @@ parser_global.cmo: parser_global.ml
parser_global.cmx: 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
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.ml
gr_grs_parser.cmo: gr_grs_parser.mly ../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
gr_grs_parser.cmo: gr_grs_parser.ml ../grew_utils.cmo ../grew_ast.cmx parser_global.cmo
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
lexer.cmx: gr_grs_parser.cmx lexer.mll ../grew_ast.cmx
lexer.ml: 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
lexer.cmo: gr_grs_parser.cmo lexer.mll ../grew_ast.cmo
ocamllex lexer.mll
lexer.cmo: gr_grs_parser.cmo lexer.ml ../grew_ast.cmo
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
......@@ -36,7 +38,3 @@ grew_parser.cmo: gr_grs_parser.cmo lexer.cmo grew_parser.ml ../grew_ast.cmo
clean:
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 ())
%token FEATURE /* feature */
%token FILE /* file */
%token LABELS /* labels */
%token BAD_LABELS /* bad_labels */
%token MATCH /* match */
%token WITHOUT /* without */
%token COMMANDS /* commands */
......@@ -239,11 +238,10 @@ modules:
| x = list(grew_module) { x }
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;
local_labels = (match l with None -> [] | Some x -> x);
bad_labels = (match b with None -> [] | Some x -> x);
rules = r;
confluent = conf;
module_doc = (match doc with Some d -> d | None -> "");
......@@ -264,7 +262,6 @@ module_doc:
/* */
/* labels {ANT_TMP} */
/* */
/* bad_labels { SUJ, OBJ } */
/*=============================================================================================*/
......@@ -272,13 +269,6 @@ module_doc:
local_labels:
| 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
| "feature" { FEATURE }
| "file" { FILE }
| "labels" { LABELS }
| "bad_labels" { BAD_LABELS }
| "match" { MATCH }
| "without" { WITHOUT }
| "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