Commit 2b8e8d46 authored by gerd's avatar gerd

Initial revision.


git-svn-id: https://godirepo.camlcity.org/svn/lib-pxp/trunk@384 dbe99aee-44db-0310-b2b3-d33182c8eb97
parent d62b0e80
Copyright 1999 by Gerd Stolpmann
The package PXP is copyright by Gerd Stolpmann.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this document and the PXP software (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
The Software is provided ``as is'', without warranty of any kind, express
or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall Gerd Stolpmann be liable for any claim, damages or
other liability, whether in an action of contract, tort or otherwise,
arising from, out of or in connection with the Software or the use or
other dealings in the software.
# make all: compiles the configured packages with ocamlc
# make opt: compiles the configured packages with ocamlopt
# make install: installs the configured packages
# make clean: cleans everything up
# Inclusion of Makefile.conf may fail when cleaning up:
-include Makefile.conf
all:
$(MAKE) -C tools all
for pkg in $(PKGLIST); do $(MAKE) -C src/$$pkg all || exit; done
opt:
for pkg in $(PKGLIST); do $(MAKE) -C src/$$pkg opt || exit; done
install:
for pkg in $(PKGLIST); do $(MAKE) -C src/$$pkg install || exit; done
uninstall:
$(MAKE) -C src uninstall
clean:
rm -f Makefile.conf
$(MAKE) -C tools CLEAN
$(MAKE) -C src CLEAN
$(MAKE) -C examples CLEAN
$(MAKE) -C rtests CLEAN
CLEAN: clean
distclean:
$(MAKE) -C tools distclean
$(MAKE) -C src distclean
$(MAKE) -C examples distclean
$(MAKE) -C rtests distclean
# Inclusion of Makefile.conf may fail when cleaning up:
-include $(TOP_DIR)/Makefile.conf
# How to invoke compilers and tools:
OCAMLC = $(OCAMLFIND) ocamlc -g $(OCAMLC_OPTIONS) -package "$(PACKAGES)"
OCAMLOPT = $(OCAMLFIND) ocamlopt $(OCAMLOPT_OPTIONS) -package "$(PACKAGES)"
OCAMLDEP = ocamldep $(OCAMLDEP_OPTIONS)
OCAMLFIND = ocamlfind
OCAMLYACC = ocamlyacc
OCAMLLEX = ocamllex
TOOLS_DIR = $(TOP_DIR)/tools
M2PARSERGEN = $(TOOLS_DIR)/m2parsergen
UCS2_TO_UTF8 = $(TOOLS_DIR)/ucs2_to_utf8
COLLECT_FILES = $(TOOLS_DIR)/collect_files
INSERT_VARIANT = $(TOOLS_DIR)/insert_variant
# Files to remove everywhere by "make clean":
CLEAN_LIST = *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa
# Generic build rules:
.SUFFIXES: .cmo .cmi .cmx .ml .mli .mll .mly .m2y
.ml.cmx:
$(OCAMLOPT) -c $<
.ml.cmo:
$(OCAMLC) -c $<
.mli.cmi:
$(OCAMLC) -c $<
.mll.ml:
$(OCAMLLEX) $<
.mly.ml:
$(OCAMLYACC) $<
.m2y.ml:
$(M2PARSERGEN) $<
----------------------------------------------------------------------
WEITER
----------------------------------------------------------------------
dynamic/att_nodes
dynamic/namespace_nodes
Tests fr
node:
method validate_contents :
?use_dfa:bool -> ?check_data_nodes:bool -> unit -> unit
val pinstr : 'ext node -> proc_instruction
val attribute_name : 'ext node -> string
val attribute_value : `ext node -> att_value
val attribute_string_value : `ext node -> string
val namespace_normprefix : 'ext node -> string
val namespace_srcprefix : 'ext node -> string
val namespace_uri : 'ext node -> string
----------------------------------------------------------------------
- Namespaces:
rtest namespaces
- from_channel: simple_transformations do not work
- xmlforms: change from camltk to labltk
- PXP 1.2: Adapter to Nethtml: Parses HTML and converts it to a PXP object
tree.
- PXP 1.2: Pxp_marshal: also marshal DTDs. Make sure that _all_ attributes
are marshaled. (It seems that id, standalone_declaration are missing.)
- PXP 1.2: Pxp_document aufrumen: Vererbung geschickter einsetzen
- PXP 1.2: Pxp_marshal.relocate
- PXP 1.2: embedded XML (see below)
- PXP 1.2: XPATH
- PXP 1.2: Adapter to Netclient
----------------------------------------------------------------------
- E-XML:
<dtd< dtd material >>
<element< xml material >> --> transformiert in eine FUNKTION, die mit
create_xxx den Term zusammenbaut. Mittels $-Notation lt sich angeben,
welche (benannten) Argumente die Funktion hat.
<data< text material >>
spec, dtd: aus dem Environment
${name:string}: Ein String wird in das Attribut/Textknoten eingefgt
${name:att_value}: Das Attribut wird auf den att_value gesetzt.
NUR so: attribut="${name:att_value}"
${name:node}: Ein einzelner Knoten
${name:nodelist}: Eine liste von Knoten
Beispiel:
let m = <element< <a href="abc">The hyperlink to ${dest:string}</a> >>
Ergibt: m : string -> 'ext node
Die Leerzeichen vor <a> und nach </a> werden ignoriert
#! /bin/sh
# $Id: configure,v 1.1 2001/06/14 23:35:06 gerd Exp $
# defaults:
with_lex_iso88591=1
with_lex_utf8=1
with_wlex=1
version="1.0.99"
exec_suffix=""
help_lex_iso88591="Enable/disable ocamllex-based lexical analyzer for ISO-8859-1"
help_lex_utf8="Enable/disable ocamllex-based lexical analyzer for UTF-8"
help_wlex="Enable/disable wlex-based lexical analyzer for ISO-8859-1 and UTF-8"
options="lex_iso88591 lex_utf8 wlex"
options () {
for opt in $options; do
e="o=\$with_$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
if [ $o -gt 0 ]; then
echo " -with-$uopt"
else
echo " -without-$uopt"
fi
done
}
usage () {
cat <<_EOF_ >&2
usage: ./configure [ options ]
_EOF_
for opt in $options; do
e="help=\$help_$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
echo "-with-$uopt:" >&2
echo "-without-$uopt:" >&2
echo " $help" >&2
done
cat <<_EOF_ >&2
Defaults are:
_EOF_
options >&2
exit 1
}
check_opt () {
for x in $options; do
if [ "$x" = "$1" ]; then
return 0
fi
done
echo "Unknown option: $1" >&2
exit 1
}
while [ "$#" -gt 0 ]; do
case "$1" in
-with-*)
opt=`echo "$1" | sed -e 's/-with-//' -e 's/-/_/g'`
check_opt "$opt"
eval "with_$opt=1"
shift
;;
-without-*)
opt=`echo "$1" | sed -e 's/-without-//' -e 's/-/_/g'`
check_opt "$opt"
eval "with_$opt=0"
shift
;;
*)
usage
esac
done
######################################################################
# Check ocamlfind
echo -n "Checking for ocamlfind... "
if ocamlfind query stdlib >/dev/null 2>/dev/null; then
echo "found"
else
echo "not found"
echo "Sorry, installation is not possible without ocamlfind (findlib)!"
echo "Make sure that ocamlfind is in your PATH, or download findlib"
echo "from www.ocaml-programming.de"
exit 1
fi
######################################################################
# Check netstring
echo -n "Checking for netstring... "
if ocamlfind query netstring >/dev/null 2>/dev/null; then
echo "found"
else
echo "not found"
echo "Sorry, installation is not possible without netstring!"
echo "Please download netstring from www.ocaml-programming.de"
exit 1
fi
######################################################################
# Check wlex
if [ $with_wlex -gt 0 ]; then
echo -n "Checking for wlexing... "
if ocamlfind query wlexing >/dev/null 2>/dev/null; then
echo "found"
else
echo "not found"
echo "wlex support is disabled"
with_wlex=0
fi
fi
######################################################################
# Check cygwin
echo -n "Checking for cygwin... "
u=`uname`
case "$u" in
CYGWIN*)
echo "found"
exec_suffix=".exe"
;;
*)
echo "not found"
;;
esac
######################################################################
# Summary
echo
echo "Effective options:"
options
echo
pkglist="pxp pxp-engine"
reqall="pxp-engine"
for opt in $options; do
e="o=\$with_$opt"
eval "$e"
if [ $o -gt 0 ]; then
uopt=`echo "$opt" | sed -e 's/_/-/g'`
pkglist="$pkglist pxp-$uopt"
# Don't include pxp-lex* into reqall if pxp-wlex is available
if [ "$with_wlex" -gt 0 ]; then
case "$opt" in
lex_*)
true ;;
*)
reqall="$reqall pxp-$uopt" ;;
esac
else
reqall="$reqall pxp-$uopt"
fi
fi
done
######################################################################
# Write META.in
for pkg in $pkglist; do
echo "Writing src/$pkg/META"
sed -e "s/@VERSION@/$version/g" \
-e "s/@REQALL@/$reqall/g" \
src/$pkg/META.in >src/$pkg/META
done
######################################################################
# Write Makefile.conf
echo "Writing Makefile.conf"
cat <<_EOF_ >Makefile.conf
VERSION = $version
PKGLIST = $pkglist
EXEC_SUFFIX = $exec_suffix
_EOF_
######################################################################
# Finish
echo
echo "You can now compile PXP by invoking"
echo " make all"
echo "for the bytecode compiler, and optionally by invoking"
echo " make opt"
echo "for the native-code compiler (if supported on your architecture)."
echo "Finally, a"
echo " make install"
echo "will install the package."
description = "Polymorphic XML Parser"
version = "@VERSION@"
requires = "netstring"
archive(byte) = "pxp_engine.cma"
archive(byte,tooploop) = "pxp_engine.cma pxp_top.cmo"
archive(native) = "pxp_engine.cmxa"
TOP_DIR = ../..
include $(TOP_DIR)/Makefile.rules
all:
cp pxp_lib_ocamlc.ml pxp_lib.ml
$(MAKE) generate
$(MAKE) depend
$(MAKE) -f Makefile.code all
opt:
cp pxp_lib_ocamlopt.ml pxp_lib.ml
$(MAKE) generate
$(MAKE) depend
$(MAKE) -f Makefile.code opt
generate: pxp_yacc.ml
depend:
$(OCAMLDEP) *.ml *.mli >depend
clean:
rm -f $(CLEAN_LIST) META
CLEAN: clean
distclean: clean
install:
files=`$(COLLECT_FILES) *.mli *.cmi *.cma *.cmxa *.a pxp_top.cmo META` && \
$(OCAMLFIND) install pxp-engine $$files
uninstall:
$(OCAMLFIND) remove pxp-engine
TOP_DIR = ../..
include $(TOP_DIR)/Makefile.rules
PACKAGES = netstring
OBJ = pxp_types.cmo pxp_lexer_types.cmo \
pxp_lexers.cmo \
pxp_dfa.cmo \
pxp_lib.cmo pxp_aux.cmo pxp_reader.cmo \
pxp_entity.cmo pxp_dtd.cmo pxp_document.cmo \
pxp_yacc.cmo pxp_marshal.cmo pxp_codewriter.cmo
XOBJ = $(OBJ:.cmo=.cmx)
all: pxp_engine.cma pxp_top.cmo
opt: pxp_engine.cmxa
pxp_engine.cma: $(OBJ)
$(OCAMLC) -o pxp_engine.cma -a $(OBJ)
pxp_engine.cmxa: $(XOBJ)
$(OCAMLOPT) -o pxp_engine.cmxa -a $(XOBJ)
include depend
TOP_DIR = ../..
include $(TOP_DIR)/Makefile.rules
all:
clean:
rm -f META
CLEAN: clean
distclean:
install:
$(OCAMLFIND) install pxp META
uninstall:
$(OCAMLFIND) remove pxp
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