Пример #1
0
        public static void Main(string[] args)
        {
            if (args.Length > 0)
            {

                ICharStream input = new ANTLRFileStream(args[0]);
                PythonLexer lexer = new MyLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lexer);
                PythonTokenSource indentedSource = new PythonTokenSource(tokens);
                tokens = new CommonTokenStream(indentedSource);
                //Console.Out.WriteLine("tokens="+tokens.GetTokens());
                PythonParser parser = new PythonParser(tokens);
                parser.file_input();
            }
            else
                Console.Error.WriteLine("Usage: dynscope <input-file>");
        }
Пример #2
0
 public static void Main(string[] args)
 {
     if (args.Length > 0)
     {
         ICharStream       input          = new ANTLRFileStream(args[0]);
         PythonLexer       lexer          = new MyLexer(input);
         CommonTokenStream tokens         = new CommonTokenStream(lexer);
         PythonTokenSource indentedSource = new PythonTokenSource(tokens);
         tokens = new CommonTokenStream(indentedSource);
         //Console.Out.WriteLine("tokens="+tokens.GetTokens());
         PythonParser parser = new PythonParser(tokens);
         parser.file_input();
     }
     else
     {
         Console.Error.WriteLine("Usage: dynscope <input-file>");
     }
 }