Exemplo n.º 1
0
        protected static List <Chat> Parse(string[] lines)
        {
            HandleDefaultCommand(lines, "SAY");
            var            ais    = new AntlrInputStream(String.Join("\n", lines));
            DialogicParser parser = CreateParser(ais);

            parser.ErrorHandler = new BailErrorStrategy();
            ParserRuleContext prc = parser.script();
            ChatParser        cp  = new ChatParser();

            cp.Visit(prc);
            PrintLispTree(parser, prc);
            Console.WriteLine(cp);
            return(cp.chats);
        }