-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (33 loc) · 1.17 KB
/
Program.cs
File metadata and controls
41 lines (33 loc) · 1.17 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
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
namespace JenPile {
class Program {
static void Main(string[] args) {
string fileToCompile = null;
for (int i = 0; i < args.Length; i++) {
if ((args[i] == "-c") && (i + 1 < args.Length) && (args[i + 1] != null)) {
// Example: CSUF323_Compiler.exe -c HelloWorld.jen
fileToCompile = args[i + 1];
}
}
InputCollector input = new InputCollector();
Lexer lex = new Lexer();
Parser expression = new Parser();
if (fileToCompile != null) {
input.ReadInFile(fileToCompile);
} else {
input.ReadInUserInput();
}
lex.LexInput(input.Inputs);
//TODO: For Demoing
Console.WriteLine("Begining Lexer: ");
lex.PrintTokens(lex.LexInput(input.Inputs));
Console.WriteLine("");
Console.WriteLine("Begining Parser: ");
expression.Driver(lex.LexInput(input.Inputs));
}
}
}