Example #1
0
        public static Node Show(string text)
        {
            var input  = new AntlrInputStream(text);
            var lexer  = new coolgrammarLexer(input);
            var tokens = new CommonTokenStream(lexer);
            var parser = new coolgrammarParser(tokens);
            //Console.WriteLine(parser.program().ToString(parser));

            var v = new Transpiler();

            return(v.Visit(parser.program()));
        }
        public static Node Show(string text)
        {
            var input  = new AntlrInputStream(text);
            var lexer  = new coolgrammarLexer(input);
            var tokens = new CommonTokenStream(lexer);
            var parser = new coolgrammarParser(tokens);

            var v = new Transpiler();

            var p   = parser.program();
            var exc = p.exception;

            if (exc == null)
            {
                return(v.Visit(p));
            }
            return(null);
        }