Commit 18314bff authored by pj2m's avatar pj2m

grew* migration

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@6314 7838e531-6607-4d57-9587-6c381814729c
parents
name = "libgrew_dev"
description = "Libgrew"
version = "@VERSION@"
requires = ""
archive(byte) = "libgrew.cma"
archive(native) = "libgrew.cmxa"
all:
@make -C src libgrew.cmxa
@make -C src libgrew.cma
include config/Makefile
conf:
cd config && aclocal
autoconf -o configure config/configure.in
purge_makefile:
@make -C src purge_makefile
@make purge
@make -C config purge
clean:
@make -C src clean
@make cleanup
uninstall:
rm -rf $(OCAMLFIND_DIR)/for_mac_libgrew
ocamlfind remove libgrew > /dev/null
uninstall_dev:
rm -rf $(OCAMLFIND_DIR)/for_mac_libgrew
ocamlfind remove libgrew_dev > /dev/null
LIB_DEP = libgrew.cma libgrew.cmxa libgrew.a libgrew.cmi
install: uninstall
cp META META_
sed -itmp "s|@VERSION@|$(VERSION)|g" META
rm -rf METAtmp
ifneq ($(DESTDIR),)
mkdir -p $(DESTDIR)$(OCAMLFIND_DIR)
touch $(DESTDIR)$(OCAMLFIND_DIR)/for_mac_libgrew
endif
mkdir -p $(DESTDIR)$(DATA_DIR)/
cp data/style.css $(DESTDIR)$(DATA_DIR)/
cd src && ocamlfind install libgrew ../META $(LIB_DEP)
mv META_ META
install_dev: uninstall_dev
cp META META_
sed -itmp "s|@VERSION@|$(VERSION)|g" META
sed -itmp "s|@DEV@|_dev|g" META
rm -rf METAtmp
cd src && ocamlfind install libgrew_dev ../META $(LIB_DEP)
mv META_ META
cp data/style.css $(DESTDIR)$(DATA_DIR)/
.PHONY: doc
doc:
@make -C src doc
################################################################################
################## PACKAGING ###################################################
################################################################################
targz: clean conf purge_makefile
rm -rf libcaml-grew-$(VERSION)
mkdir -p libcaml-grew-$(VERSION)
cp -r config libcaml-grew-$(VERSION)/
cp configure libcaml-grew-$(VERSION)/
cp Makefile.in libcaml-grew-$(VERSION)/
cp META libcaml-grew-$(VERSION)/
cp -r src libcaml-grew-$(VERSION)/
cp -r data libcaml-grew-$(VERSION)/
cd libcaml-grew-$(VERSION)/ && find . -name .svn -print0 | xargs -0 rm -rf
cd libcaml-grew-$(VERSION)/ && find . -name autom4te.cache -print0 | xargs -0 rm -rf
tar -czvf packaging/libcaml-grew-$(VERSION).tar.gz libcaml-grew-$(VERSION)
rm -rf libcaml-grew-$(VERSION)
portfile: targz
cd packaging && sh create_portfile.sh $(VERSION)
pack_deb: targz
sh packaging/make_deb.sh $(VERSION) $(INSTALL_DIR) $(DATA_DIR) $(DOC_DIR)
LOG_DIR = @LOG_INCLUDE@
LOG_BYTE = $(LOG_DIR) log.cma
LOG_OPT = $(LOG_DIR) log.cmxa
DEP2PICT_DIR = @DEP2PICT_INCLUDE@
DEP2PICT_BYTE = $(DEP2PICT_DIR) dep2pict.cma
DEP2PICT_OPT = $(DEP2PICT_DIR) dep2pict.cmxa
ANSITERMINAL_DIR = @ANSITERMINAL_INCLUDE@
ANSITERMINAL_BYTE = $(ANSITERMINAL_DIR) ANSITerminal.cma
ANSITERMINAL_OPT = $(ANSITERMINAL_DIR) ANSITerminal.cmxa
INSTALL_DIR_LIB = @OCAMLLIB@
INSTALL_DIR = @prefix@/bin/
DATA_DIR = @prefix@@datarootdir@/libgrew/
DOC_DIR = @prefix@@datarootdir@/libgrew-doc/
BYTE_FLAGS = -g -dtypes
OPT_FLAGS = -g -dtypes
DEBUG = @DEBUG@
WARNING = @WARNING@
MESSAGE = @MESSAGE@
INFO = @INFO@
OCAMLFIND_DIR=`ocamlfind printconf destdir`
VERSION = 0.9.1
cleanup:
rm -rf *.cmo *.cmx *.cmi *.annot *.o *.*~
purge:
rm -rf Makefile
infos:
@echo ""
@echo "version -> " $(VERSION)
@echo ""
@echo "prefix -> " @prefix@
@echo "exec install dir -> " $(INSTALL_DIR)
@echo "lib install dir -> " $(INSTALL_DIR_LIB)
@echo "data install dir -> " $(DATA_DIR)
@echo "doc install dir -> " $(DOC_DIR)
@echo ""
@echo "log -> " $(LOG_OPT)
@echo "dep2pict -> " $(DEP2PICT_OPT)
@echo "ansiterminal -> " $(ANSITERMINAL_OPT)
@echo ""
@echo "byte compil flags -> " $(BYTE_FLAGS)
@echo "native compil flags -> " $(OPT_FLAGS)
@echo ""
@echo "DEBUG -> " $(DEBUG)
@echo "WARNING -> " $(WARNING)
@echo "MESSAGE -> " $(MESSAGE)
@echo "INFO -> " $(INFO)
@echo ""
AC_PREREQ([2.63])
AC_INIT(grew, 1.0, paul.masson@inria.fr)
echo ""
echo "Checking essential libraries, tools and programs."
echo ""
AC_ARG_ENABLE(
[config],
[AS_HELP_STRING(
[--enable-config],
[Enable configuration check (default is yes)])],
[config=$enableval],
[config=yes])
if test "$config" = yes ; then
# Look for ocamlfind
AC_PATH_PROG(OCAMLFIND,ocamlfind,no)
# Checks for libraries.
AC_MSG_CHECKING(for ocaml library path)
OCAMLLIB=$(ocamlc -where)
AC_MSG_RESULT($OCAMLLIB)
if test "$OCAMLLIB" = ""; then
AC_MSG_ERROR(Cannot find ocaml library path)
fi
AC_PATH_PROG(MENHIR,menhir,no)
if test "$MENHIR" = "no"; then
AC_MSG_ERROR(Cannot find menhir)
fi
#Look for ANSITerminal
AC_MSG_CHECKING([for ANSITerminal])
if test -f c_check_ANSITerminal.ml ; then
if test -w c_check_ANSITerminal.ml ; then
rm c_check_ANSITerminal.* >& /dev/null
else
AC_MSG_ERROR(Cannot remove c_check_ANSITerminal.ml. Please change its right with chmod 666 c_check_ANSITerminal.ml)
fi
fi
echo "open ANSITerminal;;" > c_check_ANSITerminal.ml
if (ocaml ANSITerminal.cma c_check_ANSITerminal.ml >& /dev/null) ; then
AC_MSG_RESULT(standard)
else
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(The ANSITerminal library is missing.)
else
if $OCAMLFIND query ANSITerminal > /dev/null 2>&1 ; then
ANSITERMINAL_INCLUDE="-I `$OCAMLFIND query ANSITerminal`"
AC_MSG_RESULT(ocamlfind)
else
AC_MSG_ERROR(The ANSITerminal library is missing.)
fi
fi
fi
rm c_check_ANSITerminal.ml >& /dev/null
#Look for Log
AC_MSG_CHECKING([for log])
if test -f c_check_log.ml ; then
if test -w c_check_log.ml ; then
rm c_check_log.* >& /dev/null
else
AC_MSG_ERROR(Cannot remove c_check_log.ml. Please change its right with chmod 666 c_check_log.ml)
fi
fi
echo "open Log;;" > c_check_log.ml
if (ocamlc -c log.cma c_check_log.ml >& /dev/null) ; then
AC_MSG_RESULT(standard)
else
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(The log library is missing.)
else
if $OCAMLFIND query log > /dev/null 2>&1 ; then
LOG_INCLUDE="-I `$OCAMLFIND query log`"
AC_MSG_RESULT(ocamlfind)
else
AC_MSG_ERROR(The log library is missing.)
fi
fi
fi
rm c_check_log.* >& /dev/null
#Look for Dep2pict
AC_MSG_CHECKING([for dep2pict])
if test -f c_check_dep2pict.ml ; then
if test -w c_check_dep2pict.ml ; then
rm c_check_dep2pict.* >& /dev/null
else
AC_MSG_ERROR(Cannot remove c_check_dep2pict.ml. Please change its right with chmod 666 c_check_dep2pict.ml)
fi
fi
echo "open Dep2pict;;" > c_check_dep2pict.ml
if (ocamlc -c dep2pict.cma c_check_dep2pict.ml >& /dev/null) ; then
AC_MSG_RESULT(standard)
else
if test "$OCAMLFIND" = no ; then
AC_MSG_ERROR(The dep2pict library is missing.)
else
if $OCAMLFIND query dep2pict > /dev/null 2>&1 ; then
DEP2PICT_INCLUDE="-I `$OCAMLFIND query dep2pict`"
AC_MSG_RESULT(ocamlfind)
else
AC_MSG_ERROR(The dep2pict library is missing.)
fi
fi
fi
rm c_check_dep2pict.* >& /dev/null
fi
AC_ARG_ENABLE(
[debug],
[AS_HELP_STRING([--enable-debug], [Display debug trace])],
[with_debug=$enableval],
[with_debug=no])
AC_ARG_ENABLE(
[warning],
[AS_HELP_STRING([--enable-warning], [Display warning trace])],
[with_warning=$enableval],
[with_warning=no])
AC_ARG_ENABLE(
[message],
[AS_HELP_STRING([--enable-message], [Display message trace])],
[with_message=$enableval],
[with_message=yes])
AC_ARG_ENABLE(
[info],
[AS_HELP_STRING([--enable-info], [Display info trace])],
[with_info=$enableval],
[with_info=yes])
if test "x$with_debug" != xno ; then
AC_SUBST(DEBUG,yes)
else
AC_SUBST(DEBUG,no)
fi
if test "x$with_warning" != xno ; then
AC_SUBST(WARNING,yes)
else
AC_SUBST(WARNING,no)
fi
if test "x$with_message" != xno ; then
AC_SUBST(MESSAGE,yes)
else
AC_SUBST(MESSAGE,no)
fi
if test "x$with_info" != xno ; then
AC_SUBST(INFO,yes)
else
AC_SUBST(INFO,no)
fi
#trunk directory
TRUNK=`pwd`
AC_SUBST(TRUNK)
AC_SUBST(OCAMLC)
AC_SUBST(OCAMLOPT)
AC_SUBST(OCAMLLIB)
AC_SUBST(ANSITERMINAL_INCLUDE)
AC_SUBST(LOG_INCLUDE)
AC_SUBST(DEP2PICT_INCLUDE)
echo ""
AC_SUBST(SET_MAKE)
AC_CONFIG_FILES(\
config/Makefile \
Makefile \
src/Makefile \
src/parser/Makefile \
src/HTMLer/Makefile \
src/checker/Makefile \
)
VERSION=`grep "VERSION = .*" config/Makefile.in | sed 's|VERSION = \(.*\)|\1|'`
AC_SUBST(VERSION)
AC_PROG_MAKE_SET
echo ""
echo "Creating Makefiles"
echo ""
AC_OUTPUT
echo ""
echo "Some information"
echo ""
cd config && make infos
echo ""
This diff is collapsed.
body { font-family: Arial }
#doc {
font-family: Arial;
background:#FEFFDA;
padding-left:20px;
padding-right:20px;
padding-top:10px;
padding-bottom:10px;
border-width:1px;
border-style:dotted;
border-color:#465F91;
}
a:visited {color : #465F91; text-decoration : none; }
a:link {color : #465F91; text-decoration : none;}
a:hover {color : Red; text-decoration : none; background-color: #5FFF88}
a:active {color : Red; text-decoration : underline; }
.keyword { font-weight : bold ; color : Red }
.keywordsign { color : #C04600 }
.superscript { font-size : 4 }
.subscript { font-size : 4 }
.comment { color : Green }
.constructor { color : Blue }
.type { color : #5C6585 }
.string { color : Maroon }
.warning { color : Red ; font-weight : bold }
.info { margin-left : 3em; margin-right : 3em }
.code { color : #465F91 ; }
.module_title { color : #465F91;display:inline; }
h1 { font-size : 20pt ; text-align: center; }
h2 { font-size : 18pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90BDFF ;padding: 2px; }
h3 { font-size : 16pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90DDFF ;padding: 2px; }
h4 { font-size : 15pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90EDFF ;padding: 2px; }
h5 { font-size : 14pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #90FDFF ;padding: 2px; }
h6 { font-size : 13pt ; border: 1px solid #CCCCCC; color:aliceblue; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #465F91; }
div.h7 { font-size : 12pt ; color:465F91; padding: 2px; font-weight:bold;}
div.h8 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #F0FFFF ; padding: 2px; }
div.h9 { font-size : 20pt ; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px;text-align: center; background-color: #FFFFFF ; padding: 2px; }
.typetable { border-style : hidden }
.indextable { border-style : hidden }
.paramstable { border-style : hidden ; padding: 5pt 5pt}
body { background-color : White }
tr { background-color : White }
th {
border-right-width: 1px;
border-right-style:dotted;
border-right-color:black;
border-bottom-width: 1px;
border-bottom-style:dotted;
border-bottom-color:black;
border-top-width: 1px;
border-top-style:dotted;
border-top-color:black;
}
th.first {
border-right-width: 1px;
border-right-style:dotted;
border-right-color:black;
border-bottom-width: 1px;
border-bottom-style:dotted;
border-bottom-color:black;
border-top-width: 1px;
border-top-style:dotted;
border-top-color:black;
border-left-width: 1px;
border-left-style:dotted;
border-left-color:black;
}
td.stats {
border-right-width: 1px;
border-right-style:dotted;
border-right-color:black;
border-bottom-width: 1px;
border-bottom-style:dotted;
border-bottom-color:black;
}
td.first_stats {
border-right-width: 1px;
border-right-style:dotted;
border-right-color:black;
border-bottom-width: 1px;
border-bottom-style:dotted;
border-bottom-color:black;
border-left-width: 1px;
border-left-style:dotted;
border-left-color:black;
}
td.typefieldcomment { background-color : #FFFFFF }
pre { margin-bottom: 4px }
div.sig_block {margin-left: 2em}
Package: libcaml-grew
Version: @VERSION@
Section: base
Priority: optional
Architecture: all
Depends: ocaml, libcaml-ansiterminal (=@libcaml-ansiterminal-VERSION@), libcaml-log (=@libcaml-log-VERSION@),libcaml-dep2pict (=@libcaml-dep2pict-VERSION@), menhir
Maintainer: Paul MASSON <paul.masson@loria.fr>
Description: LibGrew is an OCaml library prototype for graph rewriting
#! /bin/sh
cd /tmp/libcaml-grew
tar -xf libcaml-grew-@VERSION@.tar.gz
cd libcaml-grew-@VERSION@
./configure > log.install
make >> log.install
make uninstall >> log.install
make install >> log.install
cd ..
rm -rf libcaml-grew-@VERSION@
#! /bin/bash
ocamlfind remove libgrew > /dev/null
#! /bin/sh
VERSION=$1
md5=`openssl md5 libcaml-grew-$VERSION.tar.gz | sed "s|MD5(libcaml-grew-$VERSION\.tar.gz)= ||"`
sha1=`openssl sha1 libcaml-grew-$VERSION.tar.gz | sed "s|SHA1(libcaml-grew-$VERSION\.tar.gz)= ||"`
rmd160=`openssl rmd160 libcaml-grew-$VERSION.tar.gz | sed "s|RIPEMD160(libcaml-grew-$VERSION\.tar.gz)= ||"`
cp default_portfile/Portfile.default Portfile
sed -i "s|@MD5_SUM@|$md5|" Portfile
sed -i "s|@SHA1_SUM@|$sha1|" Portfile
sed -i "s|@RMD160_SUM@|$rmd160|" Portfile
sed -i "s|@VERSION@|$VERSION|" Portfile
PortSystem 1.0
name libcaml-grew
version @VERSION@
categories textproc
platforms darwin
maintainers inria.fr:paul.masson
description LibGrew : Ocaml prototype for graph rewriting
long_description Ocaml prototype for graph rewriting
homepage http://wikilligramme.loria.fr
master_sites http://wikilligramme.loria.fr/macport/@repos@/archive/libcaml-grew
checksums md5 @MD5_SUM@ \
sha1 @SHA1_SUM@ \
rmd160 @RMD160_SUM@
depends_build port:ocaml \
port:libcaml-ansiterminal \
port:libcaml-log \
port:caml-menhir
use_parallel_build no
#! /bin/sh
VERSION=$1
INSTALL_DIR=$2
DATA_DIR=$3
DOC_DIR=$4
rm -rf packaging/libcaml-grew*.deb
mkdir -p packaging/deb/DEBIAN/
mkdir -p packaging/deb/tmp/libcaml-grew/
cp packaging/libcaml-grew-$VERSION.tar.gz packaging/deb/tmp/libcaml-grew/
size="0"
cp packaging/DEBIAN/control packaging/deb/DEBIAN/control
cp packaging/DEBIAN/postinst packaging/deb/DEBIAN/postinst
cp packaging/DEBIAN/postrm packaging/deb/DEBIAN/postrm
chmod 755 packaging/deb/DEBIAN/postrm
chmod 755 packaging/deb/DEBIAN/postinst
sed -i "s|@VERSION@|$VERSION|" packaging/deb/DEBIAN/control
sed -i "s|@SIZE@|$size|" packaging/deb/DEBIAN/control
sed -i "s|@VERSION@|$VERSION|" packaging/deb/DEBIAN/postinst
(cd packaging/ && dpkg-deb --build deb && cd -) || (echo "Fatal error : maybe the version number is null (make ... VERSION=...)" && exit 1)
mv packaging/deb.deb packaging/libcaml-grew-$VERSION.deb
rm -rf packaging/deb
This diff is collapsed.
all: HTMLer.cmx
byte: HTMLer.cmo
include ../../config/Makefile
HTMLer.cmx: HTMLer.ml ../ast.cmx
ocamlopt -c $(OPT_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -I .. ast.cmx HTMLer.ml
HTMLer.cmo: HTMLer.ml ../ast.cmo
ocamlc -c $(BYTE_FLAGS) -pp 'camlp4o pa_macro.cmo -DDATA_DIR=\"$(DATA_DIR)\"' -I .. ast.cmo HTMLer.ml
This diff is collapsed.
open Log
open Utils
type feature_spec =
| Closed of string * string list (* (the name, the set of atomic values) *)
| Open of string (* the name *)
type domain = feature_spec list
type feature_kind = Equality | Disequality
type u_feature = {
kind: feature_kind;
name: string;
values: string list;
}
type feature = u_feature * Loc.t
type u_node = {
node_id: Id.name;
position: int option;
fs: feature list;
}
type node = u_node * Loc.t
type u_edge = {
edge_id: Id.name option;
src: Id.name;
edge_labels: string list;
tar: Id.name;
negative: bool;
}
type edge = u_edge * Loc.t
type u_const =
| Start of Id.name * string list (* (source, labels) *)
| End of Id.name * string list (* (target, labels) *)
type const = u_const * Loc.t
type pattern = {
pat_nodes: node list;
pat_edges: edge list;
pat_const: const list;
}
type graph = {
nodes: (Id.name * node) list;
edge: edge list;
}
type command =
| Del_edge_expl of (Id.name * Id.name * string)
| Del_edge_name of string
| Add_edge of (Id.name * Id.name * string)
| Shift_edge of (Id.name*Id.name)
| Merge_node of (Id.name*Id.name)
| New_neighbour of (Id.name * Id.name * string)
| Del_node of Id.name
| New_feat of string * string
| Copy_feat of string * string
| Del_feat of string
type rule = {
rule_id:Id.name;
pos_pattern: pattern;
neg_patterns: pattern list;
commands: (command * Loc.t) list;
rule_doc:string;
rule_loc: Loc.t;
}
type modul = {
module_id:Id.name;
local_labels: (string * string option) list;
bad_labels: string list;
rules: rule list;
confluent: bool;
module_doc:string;
mod_loc:Loc.t;
}
type sequence = {
seq_name:string;
seq_mod:string list;
seq_doc:string;
seq_loc:Loc.t;
}
(**
a GRS: graph rewriting system
*)
type grs = {
domain: domain;
labels: (string * string option) list; (* the list of global edge labels *)
modules: modul list; (* the ordered list of modules used from rewriting *)
sequences: sequence list;
}
type gr = {
nodes: node list;
edges: edge list;
}
module AST_HTML = struct
let accleft = "<b>{</b>"
let accright = "<b>}</b>"
let rec tab_to_html tab = match tab with
| [] -> ""
| h::[] -> h
| h::t -> h^", "^(tab_to_html t)
let rec tab_to_html_semic tab = match tab with
| [] -> ""
| h::[] -> h
| h::t -> h^"; "^(tab_to_html_semic t)
let rec tab_to_html_pipe tab = match tab with
| [] -> ""
| h::[] -> h
| h::t -> h^"| "^(tab_to_html_pipe t)
let rec tab_to_html_arrow tab = match tab with
| [] -> ""
| h::[] -> h
| h::t -> h^" ⇨ "^(tab_to_html_arrow t)
let rec feat_values_tab_to_html tab = match tab with
| [] -> ""
| h::[] -> h
| h::t -> h^" | "^(feat_values_tab_to_html t)
let rec feat_values_tab_to_dot tab = match tab with
| [] -> ""
| h::[] -> h
| h::t -> h^" \\| "^(feat_values_tab_to_dot t)
let rec feat_tab_to_html_newline tab = match tab with
| [] -> ""
| (equal,h1,h2,_,_)::[] -> h1^(if equal then " = " else " <> ")^(feat_values_tab_to_dot h2)
| (equal,h1,h2,_,_)::t -> h1^(if equal then " = " else " <> ")^(feat_values_tab_to_dot h2)^"\\n"^(feat_tab_to_html_newline t)
let to_html_domain domain =
"features {\n"^
(let rec compute tab = match tab with
| [] -> ""
| h::[] -> begin match h with Open a -> "\t"^a^" : *\n" | Closed (name,values) -> "\t"^name^" : "^(tab_to_html values)^"\n"; end;
| h::t -> begin match h with Open a -> "\t"^a^" : * ;\n"^compute t | Closed (name,values) -> "\t"^name^" : "^(tab_to_html values)^" ;\n"^compute t; end;