-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
43 lines (38 loc) · 1.44 KB
/
Program.cs
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
37
38
39
40
41
42
43
using System;
namespace lrCalculator
{
class Program
{
static void Main(string[] args)
{
Print.PrintIntro();
while (true)
{
Console.ForegroundColor=ConsoleColor.DarkCyan;
Console.Write(" ► ");
Console.ResetColor();
string text=Console.ReadLine();
if(text.StartsWith("#"))
{
char cmd='a';
if(text.Length>=2)
cmd=text[1];
switch (cmd)
{
case 's':ShowStats.showStateTransision=!ShowStats.showStateTransision;break;
case 'p':ShowStats.showParseTable=!ShowStats.showParseTable;break;
case 'l':ShowStats.showParsingLive=!ShowStats.showParsingLive;break;
case 't':ShowStats.showParseTree=!ShowStats.showParseTree;break;
default: Console.WriteLine($"invalid input {text}");break;
}
}else if(text.Equals("exit")){
break;
}
else
{
LRParser.Run(text);
}
}
}
}
}