예제 #1
0
 static void Main(string[] args)
 {
     try
     {
         string        expression         = Expression(args.Length > 0 ? args[0] : "");
         ParserLevel   pl                 = new ParserLevel(expression);
         List <string> expressionSequence = pl.Parse();
         foreach (var expr in expressionSequence)
         {
             Console.WriteLine(expr);
         }
     }
     catch (ArgumentException exc)
     {
         Console.WriteLine(exc.Message);
     }
     catch (OverflowException exc)
     {
         Console.WriteLine(exc.Message);
     }
     catch (FormatException exc)
     {
         Console.WriteLine(exc.Message);
     }
     finally
     {
         Console.ReadKey();
     }
 }
예제 #2
0
 static void Main(string[] args)
 {
     try
     {
         string expression = Expression(args.Length > 0 ? args[0] : "");
         ParserLevel pl = new ParserLevel(expression);
         List<string> expressionSequence = pl.Parse();
         foreach (var expr in expressionSequence)
         {
             Console.WriteLine(expr);
         }
     }
     catch (ArgumentException exc)
     {
         Console.WriteLine(exc.Message);
     }
     catch (OverflowException exc)
     {
         Console.WriteLine(exc.Message);
     }
     catch (FormatException exc)
     {
         Console.WriteLine(exc.Message);
     }
     finally
     {
         Console.ReadKey();
     }
 }