static void Main(string[] args) { var lexer = new ExpLexer(new System.IO.StreamReader("test.txt")); var parse = new ExpParser(lexer); var result = parse.s().res.Value; Console.WriteLine(result); Console.ReadKey(); }
static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("For run use: parsers <input file>"); return; } expNode root; using (StreamReader fin = new StreamReader(args[0])) { var lexer = new ExpLexer(fin); var parser = new ExpParser(lexer); root = parser.exp(); } Application.EnableVisualStyles(); Application.Run(new Form1(root)); }
public ExpParser(ExpLexer lexer) : base(lexer) { }