Exemple #1
0
        //Here, all general messages go
        public virtual void ScriptNotify(object sender, NotifyEventArgs e)
        {
            string msg = e.Value;

            string[] msgParts = msg.Split('|');
            string   method   = msgParts[0];

            if (JavascriptParser.isMapReady(method))
            {
                handleMapReady();
            }
        }
        private ITree GetAntlrComputedExpressionTree()
        {
            ICharStream       input  = new ANTLRStringStream(sourceText);
            JavascriptLexer   lexer  = new JavascriptLexer(input);
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            JavascriptParser  parser = new JavascriptParser(tokens);

            try
            {
                return(parser.Expression().Tree);
            }
            catch (RecognitionException re)
            {
                throw new ArgumentException(re.Message, re);
            }
        }
Exemple #3
0
        private ITree GetAntlrComputedExpressionTree()
        {
            ICharStream       input  = new ANTLRStringStream(sourceText);
            JavascriptLexer   lexer  = new JavascriptLexer(input);
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            JavascriptParser  parser = new JavascriptParser(tokens);

            try
            {
                return(parser.Expression().Tree);
            }
            catch (RecognitionException re)
            {
                throw new ArgumentException(re.Message, re);
            }
            // LUCENENET: Antlr 3.5.1 doesn't ever wrap ParseException, so the other catch block
            // for RuntimeException that wraps ParseException would have
            // been completely unnecesary in Java and is also unnecessary here.
        }
 private ITree GetAntlrComputedExpressionTree()
 {
     ICharStream input = new ANTLRStringStream(sourceText);
     JavascriptLexer lexer = new JavascriptLexer(input);
     CommonTokenStream tokens = new CommonTokenStream(lexer);
     JavascriptParser parser = new JavascriptParser(tokens);
     try
     {
         return parser.Expression().Tree;
     }
     catch (RecognitionException re)
     {
         throw new ArgumentException(re.Message, re);
     }
 }