UNPKG

apg-js-examples

Version:

Examples of using the suite of apg-js applications and libraries.

36 lines (35 loc) 1.53 kB
<!DOCTYPE html> <html lang="en"> <head> <title>web-conv</title> <meta charset="utf-8" /> <link rel="stylesheet" href="../../node_modules/apg-js/dist/apg-lib-bundle.css" /> <!-- <link rel="stylesheet" href="../../node_modules/apg-js/dist/apg-lib-bundle.css"> --> </head> <body onload="onload()"> <h1>Test the bundled apg API</h1> <p>Have a look at "web-apg-api.html" & "web-apg-api.js" to see how it is used.</p> <p> Click on "generate" to generate a grammar object from the SABNF grammar.<br /> (Errors are not reported in detail.) </p> <p>Then click the "parse" button to use the generated grammar object to parse the input string.</p> <p class="title"> <b>SABNF grammar:</b> </p> <textarea id="grammar" rows="20" cols="75" style="float: left"></textarea> <p>&nbsp;&nbsp;<input type="button" value="generate" style="width: 100px" onclick="generate()" /></p> <p class="title" style="clear: left"> <br /> <b>SABNF input string:</b> </p> <textarea id="input" rows="20" cols="75" style="float: left"></textarea> <p>&nbsp;&nbsp;<input type="button" value="parse" style="width: 100px" onclick="parse()" /></p> <p class="title" style="clear: left"><br /><b>output:</b></p> <div id="output">Translation will appear here.</div> </body> <script src="../../node_modules/apg-js/dist/apg-api-bundle.js" charset="utf-8"></script> <script src="./web-apg-api.js" charset="utf-8"></script> </html>