using System; public class CalculatorMain { public static void Main (string[] args) { try { CalculatorTokenizer t; if(args.Length>0) t = new CalculatorTokenizer(args[0],true); else t = new CalculatorTokenizer(); try { // arg to parse is to enable building the parse tree // - COMPACT_TREE for the trimmed version CalculatorParser p = new CalculatorParser(t); p.Parse(CalculatorParser.COMPACT_TREE); } catch (Exception e) { Console.WriteLine("*** Parsing error: "+e); } } catch (Exception e) { Console.WriteLine("*** Tokenizing error: "+e); } } }