Esempio n. 1
0
 private static void parserTester(string input)
 {
     Console.WriteLine("{0}", input);
     try
     {
         AzSQLParseTree parseTree = AzSQL.ParseAzSQL(input);
         Console.WriteLine("{0}", parseTree.filterCondition.ToString());
     }
     catch (AzSQLParseException ex)
     {
         Console.ForegroundColor = ConsoleColor.Red;
         Console.WriteLine("Syntax Eror at line {0}, position {1}: {2}", ex.line, ex.charPosition, ex.Message);
         Console.ResetColor();
     }
     catch (Exception ex)
     {
         Console.ForegroundColor = ConsoleColor.Red;
         Console.WriteLine("Exception {0}: {1}", ex.GetType().FullName, ex.Message);
         Console.ResetColor();
     }
     finally
     {
         Console.WriteLine("----------------------");
         Console.WriteLine();
     }
 }
Esempio n. 2
0
        private static void E2ETester(string input, StorageCredentials creds)
        {
            Console.WriteLine("{0}", input);
            IEnumerable <DynamicTableEntity> results = AzSQL.RunQuery(input, creds);

            AzTableQuery.RenderResults(results);
            Console.WriteLine("----------------------");
            Console.WriteLine();
        }
Esempio n. 3
0
        private static void repl()    // R-E-P-Loop
        {
            StorageCredentials creds = new StorageCredentials(acctName, acctKey);
            string             input;
            string             prompt = "> ";

            Console.Write("{0}", prompt); input = Console.ReadLine();
            while (input.ToLower() != "quit" && input.ToLower() != "exit")
            {
                if (input.Trim() != "")
                {
                    try
                    {
                        IEnumerable <DynamicTableEntity> results = AzSQL.RunQuery(input, creds);
                        AzTableQuery.RenderResults(results);
                    }
                    catch (AzSQLParseException ex)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Syntax Eror at line {0}, position {1}: {2}", ex.line, ex.charPosition, ex.Message);
                        Console.ResetColor();
                    }
                    catch (Exception ex)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("Exception {0}: {1}", ex.GetType().FullName, ex.Message);
                        Console.ResetColor();
                    }
                    finally
                    {
                        Console.WriteLine();
                    }
                }
                Console.Write("{0}", prompt); input = Console.ReadLine();
            }
        }