Exemple #1
0
        static void Main(string[] args)
        {
            Console.Write("> ");
            string s = Console.ReadLine( );

            SimpleParser p = new SimpleParser( );

            StringReader r = new StringReader(s);

            Console.Write("{0} = ", s);

            try
            {
                Console.WriteLine(p.Parse(r));
            }
            catch (ParserException e)
            {
                Console.WriteLine(e.Message);
            }

            Console.ReadKey( );
        }
Exemple #2
0
        static void Main( string[ ] args )
        {
            Console.Write( "> " );
            string s = Console.ReadLine( );

            SimpleParser p = new SimpleParser( );

            StringReader r = new StringReader( s );

            Console.Write( "{0} = ", s );

            try
            {
                Console.WriteLine( p.Parse( r ) );
            }
            catch ( ParserException e )
            {
                Console.WriteLine( e.Message );
            }

            Console.ReadKey( );
        }