Exemplo n.º 1
0
		public static JsStatement ParseStatement(string source, bool allowCustomKeywords = false) {
			var lex = new ES3Lexer(new ANTLRStringStream(source.Trim())) { AllowCustomKeywords = allowCustomKeywords };
			var tokens = new CommonTokenStream(lex);
			var parser = new ES3Parser(tokens);

			var r = parser.sourceElement();
			var tree = new ES3Walker(new CommonTreeNodeStream(r.Tree));
			return tree.statement();
		}
Exemplo n.º 2
0
        public static JsStatement ParseStatement(string source)
        {
            var lex = new ES3Lexer(new ANTLRStringStream(source.Trim()));
               			CommonTokenStream tokens = new CommonTokenStream(lex);
            var parser = new ES3Parser(tokens);

            var r = parser.sourceElement();
            var tree = new ES3Walker(new CommonTreeNodeStream(r.Tree));
            return tree.statement();
        }