-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (33 loc) · 1.02 KB
/
Program.cs
File metadata and controls
36 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.IO;
using FilterQueryDemo;
namespace FilterQueryDemo
{
class Program
{
static void Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Please provide a file name as first parameter!");
return;
}
string fileName = args[0];
// Read the full input so the parser can process it in one pass.
string input = File.ReadAllText(fileName);
// User actions collect the typed parse result during semantic callbacks.
var actions = new FilterQueryDemoUserActions();
try
{
FilterQueryDemoParser.Parse(input, fileName, actions);
actions.EvaluateParsedQuery();
Console.WriteLine("Success!");
Console.WriteLine(actions.ToString());
}
catch (Exception e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}