diff options
Diffstat (limited to 'runtime/JavaScript/tests/functional/t037rulePropertyRef.html')
-rwxr-xr-x | runtime/JavaScript/tests/functional/t037rulePropertyRef.html | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/runtime/JavaScript/tests/functional/t037rulePropertyRef.html b/runtime/JavaScript/tests/functional/t037rulePropertyRef.html new file mode 100755 index 0000000..10d8f90 --- /dev/null +++ b/runtime/JavaScript/tests/functional/t037rulePropertyRef.html @@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="content-type" content="text/html;charset=utf-8" /> +<title>t037rulePropertyRef</title> + +<!-- ANTLR includes --> +<script type="text/javascript" src="../../lib/antlr3-all.js"></script> +<script type="text/javascript" src="t037rulePropertyRefLexer.js"></script> +<script type="text/javascript" src="t037rulePropertyRefParser.js"></script> + + +<!-- JsUnit include --> +<script type="text/javascript" src="../jsunit/app/jsUnitCore.js"></script> + +<!-- Test Code --> +<script type="text/javascript"> + var TLexer = function() { + TLexer.superclass.constructor.apply(this, arguments); + }; + org.antlr.lang.extend(TLexer, t037rulePropertyRefLexer, { + recover: function(re) { + /* don't recover, just crash */ + throw re; + } + }); + + var TParser = function() { + TParser.superclass.constructor.apply(this, arguments); + }; + org.antlr.lang.extend(TParser, t037rulePropertyRefParser, { + recover: function(re) { + /* don't recover, just crash */ + throw re; + } + }); + + + function testValid1() { + var cstream = new org.antlr.runtime.ANTLRStringStream(' a a a a '), + lexer = new TLexer(cstream), + tstream = new org.antlr.runtime.CommonTokenStream(lexer), + parser = new TParser(tstream); + + var ret = parser.a().bla; + + assertEquals(ret[0].index, 1); + assertEquals(ret[1].index, 7); + assertEquals(ret[2], "a a a a"); + } +</script> + +</head> +<body> + <h1>t037rulePropertyRef</h1> +</body> +</html> |