-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParserTest.java
More file actions
36 lines (31 loc) · 802 Bytes
/
ParserTest.java
File metadata and controls
36 lines (31 loc) · 802 Bytes
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
import java.io.*;
import minipython.lexer.Lexer;
import minipython.parser.Parser;
import minipython.node.*;
import java.util.*;
public class ParserTest
{
public static void main(String[] args)
{
try
{
Parser parser =
new Parser(
new Lexer(
new PushbackReader(
new FileReader(args[0].toString()), 1024)));
Hashtable symtable = new Hashtable();
List<AFunction> functions = new ArrayList<AFunction>();
Start ast = parser.parse();
ast.apply(new myvisitor(symtable, functions));
ast.apply(new mysecondvisitor(symtable, functions));
/* -- debugging -- */
//System.out.println(symtable);
//System.out.println(functions);
}
catch (Exception e)
{
System.err.println(e);
}
}
}