KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ext > param > types > ParamTypeSystem


1 package polyglot.ext.param.types;
2
3 import polyglot.types.*;
4 import polyglot.util.Position;
5 import java.util.*;
6
7 /**
8  * Type system for parameterized types.
9  */

10 public interface ParamTypeSystem extends TypeSystem {
11     /**
12      * Create a new mutable PClass.
13      *
14      * @param pos The position of the pclass
15      */

16     MuPClass mutablePClass(Position pos);
17
18     /**
19      * Instantiate a parametric type on a list of actual parameters.
20      *
21      * @param pos The position of the instantiated type
22      * @param base The parameterized type
23      * @param actuals The list of actuals
24      *
25      * @throws SemanticException when the actuals do not agree with the formals
26      */

27     ClassType instantiate(Position pos, PClass base, List actuals)
28         throws SemanticException;
29
30     /**
31      * Apply a parameter substitution to a type.
32      *
33      * @param base The type on which we perform substitutions.
34      * @param substMap Map from formal parameters to actuals; the formals are
35      * not necessarily formals of <code>base</code>.
36      */

37     Type subst(Type base, Map substMap);
38
39     /**
40      * Apply a parameter substitution to a type.
41      *
42      * @param base The type on which we perform substitutions.
43      * @param substMap Map from formal parameters to actuals; the formals are
44      * not necessarily formals of <code>base</code>.
45      * @param cache Cache of substitutions performed, implemented as a map from
46      * base type to substituted type. This is passed in to ensure pointers to
47      * outer classes are substituted correctly.
48      */

49     Type subst(Type base, Map substMap, Map cache);
50
51     /**
52      * Create a substitutor.
53      *
54      * @param substMap Map from formal parameters to actuals; the formals are
55      * not necessarily formals of <code>base</code>.
56      * @param cache Cache of substitutions performed, implemented as a map from
57      * base type to substituted type. This is passed in to ensure pointers to
58      * outer classes are substituted correctly.
59      */

60     Subst subst(Map substMap, Map cache);
61 }
62
Popular Tags