root/trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/Phase.java @ 2406

Revision 2406, 2.0 KB (checked in by mspiegel, 16 months ago)

Added copyright notices.

Line 
1/*******************************************************************************
2  Copyright 2008 Sun Microsystems, Inc.,
3  4150 Network Circle, Santa Clara, California 95054, U.S.A.
4  All rights reserved.
5
6  U.S. Government Rights - Commercial software.
7  Government users are subject to the Sun Microsystems, Inc. standard
8  license agreement and applicable provisions of the FAR and its supplements.
9
10  Use is subject to license terms.
11
12  This distribution may include materials developed by third parties.
13
14  Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
15  trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
16  ******************************************************************************/
17
18package com.sun.fortress.compiler.phases;
19
20import com.sun.fortress.compiler.AnalyzeResult;
21import com.sun.fortress.compiler.GlobalEnvironment;
22import com.sun.fortress.exceptions.StaticError;
23import com.sun.fortress.repository.FortressRepository;
24
25public abstract class Phase {   
26       
27    Phase parentPhase;
28        FortressRepository repository;
29    GlobalEnvironment env;
30    long lastModified;
31   
32    private AnalyzeResult result;   
33   
34        public Phase(Phase parentPhase){
35        this.parentPhase = parentPhase;
36        if (parentPhase != null) {
37                repository = parentPhase.getRepository();
38                env = parentPhase.getEnv();
39                lastModified = parentPhase.getLastModified();
40        }
41    }
42
43    public final AnalyzeResult getResult() { return result; }
44   
45    public final FortressRepository getRepository() {
46                return repository;
47        }
48
49        public final GlobalEnvironment getEnv() {
50                return env;
51        }
52
53        public final long getLastModified() {
54                return lastModified;
55        }
56       
57    public abstract AnalyzeResult execute() throws StaticError ;
58
59    public final AnalyzeResult run() throws StaticError {
60        if (parentPhase != null)
61                parentPhase.run();       
62        result = execute();
63        return result;
64    }
65       
66}
Note: See TracBrowser for help on using the browser.