コード例 #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
ファイル: Program.cs プロジェクト: ILya-Lev/ExpressionParser
 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();
     }
 }