-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
33 lines (33 loc) · 1.03 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
namespace Gwent
{
class Program
{
static void Main(string[]args)
{
string text =File.ReadAllText("C:/Users/John/Desktop/programacion/Gwent++/Compiler/source.txt");
LexicalAnalyzer lex=new LexicalAnalyzer(text);
List<Token>tokens=lex.GetTokens();
lex.Print_errors();
Parser Parser=new Parser(tokens);
ElementalProgram program=Parser.Parse();
if(Parser.errors.Count!=0)
{
Parser.Print_errors();
}
else
{
SemanticAnalizer semanticAnalizer=new SemanticAnalizer(program);
semanticAnalizer.Semantic_Analizer();
if(semanticAnalizer.errors.Count!=0)
{
semanticAnalizer.Print_errors();
}
else
{
Interpreter interpreter=new Interpreter(program);
interpreter.Interpret();
}
}
}
}
}