Source code: mlsub/compilation/Module.java
1 /**************************************************************************/
2 /* B O S S A */
3 /* A simple imperative object-oriented research language */
4 /* (c) Daniel Bonniot 1999 */
5 /* */
6 /* This program is free software; you can redistribute it and/or modify */
7 /* it under the terms of the GNU General Public License as published by */
8 /* the Free Software Foundation; either version 2 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /**************************************************************************/
12
13 // File : Module.java
14 // Created : Mon Feb 14 11:46:42 2000 by Daniel Bonniot
15 //$Modified: Tue Feb 22 17:12:15 2000 by Daniel Bonniot $
16
17 package mlsub.compilation;
18
19 import java.util.*;
20
21 /**
22 * The smallest unit that can be compiled independantly.
23 *
24 * @author Daniel Bonniot
25 */
26
27 public interface Module
28 {
29 /** Returns the list of Modules this modules depends on. */
30 List getRequirements();
31
32 /** Creates the scope. */
33 void scope();
34
35 /** Resolve scoping and load the constants in the context. */
36 void load();
37
38 /** Resolve scoping for entities that need the global context. */
39 void typedResolve();
40
41 /** Resolve local entities, that might increase the global context. */
42 void localResolve();
43
44 /** Check types. */
45 void typecheck();
46
47 /** Compile the module.
48
49 This may involve:
50 - code generation
51 - saving the interface of the module
52 */
53 void compile();
54
55 void link();
56
57 /** Returns the name of this module. */
58 String getName();
59
60 /** The date of the last modification of this module. */
61 long lastModification();
62
63 // should be "static"
64 void freezeGlobalContext();
65 void unfreezeGlobalContext();
66 }