|
Revision 2406, 2.0 KB
(checked in by mspiegel, 16 months ago)
|
|
Added copyright notices.
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | package com.sun.fortress.compiler.phases; |
|---|
| 19 | |
|---|
| 20 | import com.sun.fortress.compiler.AnalyzeResult; |
|---|
| 21 | import com.sun.fortress.compiler.GlobalEnvironment; |
|---|
| 22 | import com.sun.fortress.exceptions.StaticError; |
|---|
| 23 | import com.sun.fortress.repository.FortressRepository; |
|---|
| 24 | |
|---|
| 25 | public 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 | } |
|---|