xref: /aosp_15_r20/external/antlr/runtime/JavaScript/tests/functional/t016actions.html (revision 16467b971bd3e2009fad32dd79016f2c7e421deb)
1*16467b97STreehugger Robot<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2*16467b97STreehugger Robot<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3*16467b97STreehugger Robot<head>
4*16467b97STreehugger Robot<meta http-equiv="content-type" content="text/html;charset=utf-8" />
5*16467b97STreehugger Robot<title>t016actions</title>
6*16467b97STreehugger Robot
7*16467b97STreehugger Robot<!-- ANTLR includes -->
8*16467b97STreehugger Robot<script type="text/javascript" src="../../lib/antlr3-all.js"></script>
9*16467b97STreehugger Robot<script type="text/javascript" src="t016actionsLexer.js"></script>
10*16467b97STreehugger Robot<script type="text/javascript" src="t016actionsParser.js"></script>
11*16467b97STreehugger Robot
12*16467b97STreehugger Robot
13*16467b97STreehugger Robot<!-- JsUnit include -->
14*16467b97STreehugger Robot<script type="text/javascript" src="../jsunit/app/jsUnitCore.js"></script>
15*16467b97STreehugger Robot
16*16467b97STreehugger Robot<!-- Test Code -->
17*16467b97STreehugger Robot<script type="text/javascript">
18*16467b97STreehugger Robot    function testValid() {
19*16467b97STreehugger Robot        var cstream = new org.antlr.runtime.ANTLRStringStream("int foo;"),
20*16467b97STreehugger Robot            lexer = new t016actionsLexer(cstream),
21*16467b97STreehugger Robot            tstream = new org.antlr.runtime.CommonTokenStream(lexer),
22*16467b97STreehugger Robot            parser = new t016actionsParser(tstream);
23*16467b97STreehugger Robot
24*16467b97STreehugger Robot        var result = parser.declaration();
25*16467b97STreehugger Robot        assertEquals("foo", result);
26*16467b97STreehugger Robot    }
27*16467b97STreehugger Robot</script>
28*16467b97STreehugger Robot
29*16467b97STreehugger Robot</head>
30*16467b97STreehugger Robot<body>
31*16467b97STreehugger Robot    <h1>t016actions</h1>
32*16467b97STreehugger Robot</body>
33*16467b97STreehugger Robot</html>
34