- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParserTest.java
More file actions
Latest commit
36 lines (31 loc) · 802 Bytes
/
Copy pathParserTest.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
importjava.io.*;
importminipython.lexer.Lexer;
importminipython.parser.Parser;
importminipython.node.*;
importjava.util.*;
publicclassParserTest
{
publicstaticvoidmain(String[] args)
{
try
{
Parserparser =
newParser(
newLexer(
newPushbackReader(
newFileReader(args[0].toString()), 1024)));
Hashtablesymtable = newHashtable();
List<AFunction> functions = newArrayList<AFunction>();
Startast = parser.parse();
ast.apply(newmyvisitor(symtable, functions));
ast.apply(newmysecondvisitor(symtable, functions));
/* -- debugging -- */
//System.out.println(symtable);
//System.out.println(functions);
}
catch (Exceptione)
{
System.err.println(e);
}
}
}