KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > javaToJimple > jj > ExtensionInfo


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2004 Jennifer Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 package soot.javaToJimple.jj;
21
22 import polyglot.lex.Lexer;
23 //import soot.javaToJimple.jj.parse.Lexer_c;
24
//import soot.javaToJimple.jj.parse.Grm;
25
//import polyglot.ext.jl.parse.Lexer_c;
26
//import polyglot.ext.jl.parse.Grm;
27
import soot.javaToJimple.jj.ast.*;
28 import soot.javaToJimple.jj.types.*;
29
30 import polyglot.ast.*;
31 import polyglot.types.*;
32 import polyglot.util.*;
33 import polyglot.visit.*;
34 import polyglot.frontend.*;
35 import polyglot.main.*;
36
37 import java.util.*;
38 import java.io.*;
39
40 /**
41  * Extension information for jj extension.
42  */

43 public class ExtensionInfo extends polyglot.ext.jl.ExtensionInfo {
44     static {
45         // force Topics to load
46
Topics t = new Topics();
47     }
48
49     public String JavaDoc defaultFileExtension() {
50         return "jj";
51     }
52
53     public String JavaDoc compilerName() {
54         return "jjc";
55     }
56
57     /*public Parser parser(Reader reader, FileSource source, ErrorQueue eq) {
58         Lexer lexer = new Lexer_c(reader, source.name(), eq);
59         Grm grm = new Grm(lexer, ts, nf, eq);
60         return new CupParser(grm, source, eq);
61     }*/

62
63     protected NodeFactory createNodeFactory() {
64         return new JjNodeFactory_c();
65     }
66
67     protected TypeSystem createTypeSystem() {
68         return new JjTypeSystem_c();
69     }
70
71     public List passes(Job job) {
72         List passes = super.passes(job);
73         // TODO: add passes as needed by your compiler
74
return passes;
75     }
76
77     private HashMap sourceJobMap;
78
79     public HashMap sourceJobMap(){
80         return sourceJobMap;
81     }
82
83     public void sourceJobMap(HashMap map){
84         sourceJobMap = map;
85     }
86 }
87
Popular Tags