-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGOParsST.java
More file actions
40 lines (26 loc) · 860 Bytes
/
GOParsST.java
File metadata and controls
40 lines (26 loc) · 860 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
36
37
38
39
40
import java_cup . runtime . *;
import java.io.*;
public class GOParsST {
public static void main (String args[])
throws IOException {
System.out.println("Source Program");
System.out.println("--------------");
System.out.println();
try {
SymbolFactory symbolFatory = new ComplexSymbolFactory();
GOParserST parser =
new GOParserST (new GOLexer (new InputStreamReader(System.in),
symbolFatory));
// parser.parse();
java_cup .runtime . Symbol parserValue = parser . parse ();
SymbolTable env = (SymbolTable) parserValue . value;
// SymbolTable env2 = new SymbolTable();
//env2 = (SymbolTable) parserValue . value;
env . print ("main");
}
catch(Exception e) {
System . out . println ("Error in invoking parser/lexer");
System . out . println (e);
}
}
}