Experiment with porting SGML to YAP, and trying to preserve SWI code as much
as possible.
This commit is contained in:
35
packages/sgml/RDF/rdf-parser
Executable file
35
packages/sgml/RDF/rdf-parser
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This is not the normal parser, just the front-end for the CGI interface.
|
||||
# The real CGI stuff is written in Prolog in the file online.pl. The
|
||||
# request is in online.html
|
||||
#
|
||||
# The RDF parser itself is just a Prolog library. See rdf2pl.{html,pdf}.
|
||||
|
||||
base=@BASEDIR@
|
||||
tmp=/tmp/rdf-parser-$$
|
||||
export ERROR_FILE=$tmp
|
||||
|
||||
ulimit -t 20 # seconds CPU time limit
|
||||
|
||||
function error()
|
||||
{ cat << _EOM_
|
||||
Content-type: text/plain
|
||||
|
||||
Sorry, an internal error occurred. For details, see below.
|
||||
|
||||
_EOM_
|
||||
cat $tmp
|
||||
rm -r $tmp
|
||||
exit 0
|
||||
}
|
||||
|
||||
cd $base > $tmp 2>&1
|
||||
@SWI@ -f none -F none -t halt \
|
||||
-g "load_files(online,[silent(true)]),go" 2>$tmp
|
||||
|
||||
case $? in
|
||||
0) rm -f $tmp
|
||||
exit 0 ;;
|
||||
*) error ;;
|
||||
esac
|
Reference in New Issue
Block a user