forked from GitHub/gf-core
"gf -server" mode now contains everything needed to run the minibar and the grammar editor (including example-based grammar writing). The Setup.hs script installs the required files where gf -server can find them. These files have been moved to a new directory: src/www. The separate server program pgf-http is now obsolete.
58 lines
1.4 KiB
HTML
58 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<html> <head>
|
|
<title>PGF online server example</title>
|
|
<style type="text/css">
|
|
body { background: #ddd; }
|
|
h1, h2, h3, small, th { font-family: sans-serif; }
|
|
div.modtime { float: right; }
|
|
.modtime { color: #666; white-space: nowrap; }
|
|
</style>
|
|
<script type="text/JavaScript" src="support.js"></script>
|
|
<script type="text/JavaScript" src="pgf_online.js"></script>
|
|
<script type="text/JavaScript">
|
|
|
|
var server_options={
|
|
grammars_url: "http://www.grammaticalframework.org/grammars/",
|
|
grammar_list: ["Foods.pgf"]
|
|
}
|
|
var pgf_server = pgf_online(server_options);
|
|
|
|
function call_server() {
|
|
pgf_server.parse({from:"FoodsEng",input:document.forms[0].input.value},
|
|
show_output)
|
|
}
|
|
|
|
function show_output(parsed) {
|
|
document.getElementById("output").innerHTML=parsed[0].trees[0]
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<h1>PGF online server example</h1>
|
|
|
|
<form onsubmit="call_server(); return false">
|
|
Input:
|
|
<input name=input size=50 value="this cheese is expensive">
|
|
<input type=submit value=Parse>
|
|
|
|
<p>
|
|
Output:
|
|
<span id=output></span>
|
|
</form>
|
|
|
|
|
|
<h2>Documentation</h2>
|
|
<ul>
|
|
<li><a href="gf-web-api-examples.html">GF Web API examples</a>
|
|
</ul>
|
|
|
|
<hr>
|
|
<div class=modtime><small>
|
|
<!-- hhmts start --> Last modified: Wed Aug 3 16:52:51 CEST 2011 <!-- hhmts end -->
|
|
</small></div>
|
|
<address><a href="http://www.cse.chalmers.se/~hallgren/">TH</a></address>
|
|
</body> </html>
|