-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (22 loc) · 792 Bytes
/
Main.java
File metadata and controls
23 lines (22 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.io.IOException;
import java.util.*;
public class Main{
public static void main(String[] args) {
List<InterpreterError> errors = new LinkedList<>();
try{
Lexer lexer = new Lexer("input.fare");
Filter filter = new Filter(lexer, errors);
Parser parser = new Parser(filter, errors);
CUNode root = parser.compilationUnit();
root.semantischeAnalyse(null, errors);
if(errors.size() == 0)
root.run();
else{
System.out.println("Errors:");
int i=1;
for (InterpreterError error:errors)
System.out.println(i++ +") "+error);
}
}catch(IOException e){System.out.println(e);}
}
}