• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3<head>
4<meta http-equiv="content-type" content="text/html;charset=utf-8" />
5<title>t021hoist</title>
6
7<!-- ANTLR includes -->
8<script type="text/javascript" src="../../lib/antlr3-all.js"></script>
9<script type="text/javascript" src="t021hoistLexer.js"></script>
10<script type="text/javascript" src="t021hoistParser.js"></script>
11
12
13<!-- JsUnit include -->
14<script type="text/javascript" src="../jsunit/app/jsUnitCore.js"></script>
15
16<!-- Test Code -->
17<script type="text/javascript">
18    function testValid1() {
19        var cstream = new org.antlr.runtime.ANTLRStringStream("enum"),
20            lexer = new t021hoistLexer(cstream),
21            tstream = new org.antlr.runtime.CommonTokenStream(lexer),
22            parser = new t021hoistParser(tstream);
23
24        parser.enableEnum = true;
25        var enumIs = parser.stat();
26
27        assertEquals(enumIs, "keyword");
28    }
29
30    function testValid2() {
31        var cstream = new org.antlr.runtime.ANTLRStringStream("enum"),
32            lexer = new t021hoistLexer(cstream),
33            tstream = new org.antlr.runtime.CommonTokenStream(lexer),
34            parser = new t021hoistParser(tstream);
35
36        parser.enableEnum = false;
37        var enumIs = parser.stat();
38
39        assertEquals(enumIs, "ID");
40    }
41</script>
42
43</head>
44<body>
45    <h1>t021hoist</h1>
46</body>
47</html>
48