Changeset 2407
- Timestamp:
- 07/28/08 21:01:19 (16 months ago)
- Location:
- trunk/ProjectFortress/src/com/sun/fortress/compiler/phases
- Files:
-
- 8 modified
-
CodeGenerationPhase.java (modified) (2 diffs)
-
DesugarPhase.java (modified) (2 diffs)
-
DisambiguatePhase.java (modified) (2 diffs)
-
EmptyPhase.java (modified) (2 diffs)
-
GrammarPhase.java (modified) (2 diffs)
-
Phase.java (modified) (2 diffs)
-
PhaseOrder.java (modified) (2 diffs)
-
TypeCheckPhase.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/CodeGenerationPhase.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 27 27 28 28 public class CodeGenerationPhase extends Phase { 29 30 public CodeGenerationPhase(Phase parentPhase) {31 super(parentPhase);32 }33 29 34 @Override 35 public AnalyzeResult execute() throws StaticError { 36 Debug.debug( Debug.Type.FORTRESS, 1, "Start phase CodeGeneration" ); 37 AnalyzeResult previous = parentPhase.getResult(); 38 39 TopLevelEnvGen.CompilationUnitResult apiGR = TopLevelEnvGen 40 .generateApiEnvs(previous.apis()); 30 public CodeGenerationPhase(Phase parentPhase) { 31 super(parentPhase); 32 } 41 33 42 if (!apiGR.isSuccessful()) { 43 throw new MultipleStaticError(apiGR.errors()); 44 } 34 @Override 35 public AnalyzeResult execute() throws StaticError { 36 Debug.debug(Debug.Type.FORTRESS, 1, "Start phase CodeGeneration"); 37 AnalyzeResult previous = parentPhase.getResult(); 45 38 46 // Generate top-level byte code environments for components 47 TopLevelEnvGen.CompilationUnitResult componentGR = TopLevelEnvGen 48 .generateComponentEnvs(previous.components()); 39 TopLevelEnvGen.CompilationUnitResult apiGR = TopLevelEnvGen 40 .generateApiEnvs(previous.apis()); 49 41 50 if (!componentGR.isSuccessful()) {51 throw new MultipleStaticError(componentGR.errors());52 }42 if (!apiGR.isSuccessful()) { 43 throw new MultipleStaticError(apiGR.errors()); 44 } 53 45 54 return new AnalyzeResult(previous.apis(), previous.components(), 55 IterUtil.<StaticError> empty(), previous.typeEnvAtNode()); 56 57 } 46 // Generate top-level byte code environments for components 47 TopLevelEnvGen.CompilationUnitResult componentGR = TopLevelEnvGen 48 .generateComponentEnvs(previous.components()); 49 50 if (!componentGR.isSuccessful()) { 51 throw new MultipleStaticError(componentGR.errors()); 52 } 53 54 return new AnalyzeResult(previous.apis(), previous.components(), 55 IterUtil.<StaticError> empty(), previous.typeEnvAtNode()); 56 57 } 58 58 59 59 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/DesugarPhase.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 29 29 30 30 public class DesugarPhase extends Phase { 31 32 33 public DesugarPhase(Phase parentPhase) {34 super(parentPhase);35 }36 31 37 @Override 38 public AnalyzeResult execute( ) throws StaticError { 39 Debug.debug( Debug.Type.FORTRESS, 1, "Start phase Desugar" ); 40 AnalyzeResult previous = parentPhase.getResult(); 41 42 GlobalEnvironment apiEnv = new GlobalEnvironment.FromMap(CollectUtil.union(repository.apis(), 43 previous.apis())); 32 public DesugarPhase(Phase parentPhase) { 33 super(parentPhase); 34 } 44 35 45 Desugarer.ApiResult apiDSR = Desugarer.desugarApis(previous.apis(), apiEnv); 36 @Override 37 public AnalyzeResult execute() throws StaticError { 38 Debug.debug(Debug.Type.FORTRESS, 1, "Start phase Desugar"); 39 AnalyzeResult previous = parentPhase.getResult(); 46 40 47 if ( ! apiDSR.isSuccessful() ){ 48 throw new MultipleStaticError(apiDSR.errors()); 49 } 41 GlobalEnvironment apiEnv = new GlobalEnvironment.FromMap(CollectUtil 42 .union(repository.apis(), previous.apis())); 50 43 51 Desugarer.ComponentResult componentDSR = Desugarer.desugarComponents(previous.components(), apiEnv); 44 Desugarer.ApiResult apiDSR = Desugarer.desugarApis(previous.apis(), 45 apiEnv); 52 46 53 if ( ! componentDSR.isSuccessful() ){54 throw new MultipleStaticError(componentDSR.errors());55 }47 if (!apiDSR.isSuccessful()) { 48 throw new MultipleStaticError(apiDSR.errors()); 49 } 56 50 57 return new AnalyzeResult(apiDSR.apis(), componentDSR.components(), 58 IterUtil.<StaticError>empty(), previous.typeEnvAtNode()); 51 Desugarer.ComponentResult componentDSR = Desugarer.desugarComponents( 52 previous.components(), apiEnv); 53 54 if (!componentDSR.isSuccessful()) { 55 throw new MultipleStaticError(componentDSR.errors()); 56 } 57 58 return new AnalyzeResult(apiDSR.apis(), componentDSR.components(), 59 IterUtil.<StaticError> empty(), previous.typeEnvAtNode()); 59 60 } 60 61 -
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/DisambiguatePhase.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 29 29 import edu.rice.cs.plt.iter.IterUtil; 30 30 31 public class DisambiguatePhase extends Phase { 31 public class DisambiguatePhase extends Phase { 32 32 33 public DisambiguatePhase(Phase parentPhase) {34 super(parentPhase);35 } 36 33 public DisambiguatePhase(Phase parentPhase) { 34 super(parentPhase); 35 } 36 37 37 @Override 38 public AnalyzeResult execute( ) throws StaticError {39 Debug.debug( Debug.Type.FORTRESS, 1, "Start phase Disambiguate");40 AnalyzeResult previous = parentPhase.getResult(); 38 public AnalyzeResult execute() throws StaticError { 39 Debug.debug(Debug.Type.FORTRESS, 1, "Start phase Disambiguate"); 40 AnalyzeResult previous = parentPhase.getResult(); 41 41 42 // Build a new GlobalEnvironment consisting of all APIs in a global43 // repository combined with all APIs that have been processed in the previous 44 // step. For now, we are implementing pure static linking, so there is45 // no global repository. 46 GlobalEnvironment rawApiEnv = 47 new GlobalEnvironment.FromMap(CollectUtil.union(repository.apis(), 48 previous.apis()));42 // Build a new GlobalEnvironment consisting of all APIs in a global 43 // repository combined with all APIs that have been processed in the 44 // previous 45 // step. For now, we are implementing pure static linking, so there is 46 // no global repository. 47 GlobalEnvironment rawApiEnv = new GlobalEnvironment.FromMap(CollectUtil 48 .union(repository.apis(), previous.apis())); 49 49 50 // Rewrite all API ASTs so they include only fully qualified names, relying 51 // on the rawApiEnv constructed in the previous step. Note that, after this 52 // step, the rawApiEnv is stale and needs to be rebuilt with the new API ASTs. 53 Disambiguator.ApiResult apiDR = 54 Disambiguator.disambiguateApis(previous.apiIterator(), rawApiEnv, repository.apis()); 55 if (!apiDR.isSuccessful()) { 56 throw new MultipleStaticError(apiDR.errors()); 57 } 50 // Rewrite all API ASTs so they include only fully qualified names, 51 // relying 52 // on the rawApiEnv constructed in the previous step. Note that, after 53 // this 54 // step, the rawApiEnv is stale and needs to be rebuilt with the new API 55 // ASTs. 56 Disambiguator.ApiResult apiDR = Disambiguator.disambiguateApis(previous 57 .apiIterator(), rawApiEnv, repository.apis()); 58 if (!apiDR.isSuccessful()) { 59 throw new MultipleStaticError(apiDR.errors()); 60 } 58 61 59 // Rebuild ApiIndices.60 IndexBuilder.ApiResult apiIR = 61 IndexBuilder.buildApis(apiDR.apis(),lastModified);62 if (!apiIR.isSuccessful()) {63 throw new MultipleStaticError(apiIR.errors());64 }62 // Rebuild ApiIndices. 63 IndexBuilder.ApiResult apiIR = IndexBuilder.buildApis(apiDR.apis(), 64 lastModified); 65 if (!apiIR.isSuccessful()) { 66 throw new MultipleStaticError(apiIR.errors()); 67 } 65 68 66 // Rebuild GlobalEnvironment. 67 GlobalEnvironment apiEnv = 68 new GlobalEnvironment.FromMap(CollectUtil.union(repository.apis(), 69 apiIR.apis())); 69 // Rebuild GlobalEnvironment. 70 GlobalEnvironment apiEnv = new GlobalEnvironment.FromMap(CollectUtil 71 .union(repository.apis(), apiIR.apis())); 70 72 71 Disambiguator.ComponentResult componentDR = 72 Disambiguator.disambiguateComponents(previous.componentIterator(), apiEnv,73 previous.components());74 if (!componentDR.isSuccessful()) {75 throw new MultipleStaticError(componentDR.errors());76 }73 Disambiguator.ComponentResult componentDR = Disambiguator 74 .disambiguateComponents(previous.componentIterator(), apiEnv, 75 previous.components()); 76 if (!componentDR.isSuccessful()) { 77 throw new MultipleStaticError(componentDR.errors()); 78 } 77 79 78 // Rebuild ComponentIndices.79 IndexBuilder.ComponentResult componentsDone = 80 IndexBuilder.buildComponents(componentDR.components(), lastModified);81 if (!componentsDone.isSuccessful()) {82 throw new MultipleStaticError(componentsDone.errors());83 }80 // Rebuild ComponentIndices. 81 IndexBuilder.ComponentResult componentsDone = IndexBuilder 82 .buildComponents(componentDR.components(), lastModified); 83 if (!componentsDone.isSuccessful()) { 84 throw new MultipleStaticError(componentsDone.errors()); 85 } 84 86 85 return new AnalyzeResult(apiIR.apis(), componentsDone.components(), 86 IterUtil.<StaticError>empty(), previous.typeEnvAtNode());87 87 return new AnalyzeResult(apiIR.apis(), componentsDone.components(), 88 IterUtil.<StaticError> empty(), previous.typeEnvAtNode()); 89 88 90 } 89 91 -
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/EmptyPhase.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 38 38 public class EmptyPhase extends Phase { 39 39 40 private final Iterable<Api> apis; 41 private final Iterable<Component> components; 42 43 public EmptyPhase(FortressRepository repository, GlobalEnvironment env, 44 Iterable<Api> apis, Iterable<Component> components, long lastModified) { 45 super(null); 46 this.repository = repository; 47 this.env = env; 48 this.apis = apis; 49 this.components = components; 50 this.lastModified = lastModified; 51 } 40 private final Iterable<Api> apis; 41 private final Iterable<Component> components; 52 42 53 @Override 54 public AnalyzeResult execute( ) throws StaticError { 55 Debug.debug( Debug.Type.FORTRESS, 1, "Start phase Empty" ); 56 IndexBuilder.ApiResult apiIndex = IndexBuilder.buildApis(apis, lastModified); 57 IndexBuilder.ComponentResult componentIndex = IndexBuilder.buildComponents(components, lastModified); 43 public EmptyPhase(FortressRepository repository, GlobalEnvironment env, 44 Iterable<Api> apis, Iterable<Component> components, 45 long lastModified) { 46 super(null); 47 this.repository = repository; 48 this.env = env; 49 this.apis = apis; 50 this.components = components; 51 this.lastModified = lastModified; 52 } 53 54 @Override 55 public AnalyzeResult execute() throws StaticError { 56 Debug.debug(Debug.Type.FORTRESS, 1, "Start phase Empty"); 57 IndexBuilder.ApiResult apiIndex = IndexBuilder.buildApis(apis, 58 lastModified); 59 IndexBuilder.ComponentResult componentIndex = IndexBuilder 60 .buildComponents(components, lastModified); 58 61 return new AnalyzeResult(apiIndex.apis(), componentIndex.components(), 59 IterUtil.<StaticError>empty(), Option.<Map<Pair<Node,Span>, TypeEnv>>none()); 62 IterUtil.<StaticError> empty(), Option 63 .<Map<Pair<Node, Span>, TypeEnv>> none()); 60 64 } 61 65 -
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/GrammarPhase.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 31 31 public class GrammarPhase extends Phase { 32 32 33 public GrammarPhase(Phase parentPhase) { 34 super(parentPhase); 35 } 36 37 @Override 38 public AnalyzeResult execute() throws StaticError { 39 Debug.debug( Debug.Type.FORTRESS, 1, "Start phase GrammarPhase" ); 40 AnalyzeResult previous = parentPhase.getResult(); 33 public GrammarPhase(Phase parentPhase) { 34 super(parentPhase); 35 } 41 36 42 GlobalEnvironment apiEnv = 43 new GlobalEnvironment.FromMap(CollectUtil.union(repository.apis(), 44 previous.apis())); 37 @Override 38 public AnalyzeResult execute() throws StaticError { 39 Debug.debug(Debug.Type.FORTRESS, 1, "Start phase GrammarPhase"); 40 AnalyzeResult previous = parentPhase.getResult(); 45 41 46 GrammarRewriter.ApiResult apiID = GrammarRewriter.rewriteApis(previous.apis(), apiEnv); 47 if (!apiID.isSuccessful()) { 48 throw new MultipleStaticError(apiID.errors()); 49 } 42 GlobalEnvironment apiEnv = new GlobalEnvironment.FromMap(CollectUtil 43 .union(repository.apis(), previous.apis())); 50 44 51 IndexBuilder.ApiResult apiDone = IndexBuilder.buildApis(apiID.apis(), lastModified); 52 if (!apiDone.isSuccessful()) { 53 throw new MultipleStaticError(apiDone.errors()); 54 } 45 GrammarRewriter.ApiResult apiID = GrammarRewriter.rewriteApis(previous 46 .apis(), apiEnv); 47 if (!apiID.isSuccessful()) { 48 throw new MultipleStaticError(apiID.errors()); 49 } 55 50 56 return new AnalyzeResult(apiDone.apis(), previous.components(), 57 IterUtil.<StaticError>empty(), previous.typeEnvAtNode()); 58 } 51 IndexBuilder.ApiResult apiDone = IndexBuilder.buildApis(apiID.apis(), 52 lastModified); 53 if (!apiDone.isSuccessful()) { 54 throw new MultipleStaticError(apiDone.errors()); 55 } 56 57 return new AnalyzeResult(apiDone.apis(), previous.components(), 58 IterUtil.<StaticError> empty(), previous.typeEnvAtNode()); 59 } 59 60 60 61 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/Phase.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 23 23 import com.sun.fortress.repository.FortressRepository; 24 24 25 public abstract class Phase { 26 25 public abstract class Phase { 26 27 27 Phase parentPhase; 28 FortressRepository repository;28 FortressRepository repository; 29 29 GlobalEnvironment env; 30 30 long lastModified; 31 32 private AnalyzeResult result; 33 34 public Phase(Phase parentPhase){31 32 private AnalyzeResult result; 33 34 public Phase(Phase parentPhase) { 35 35 this.parentPhase = parentPhase; 36 36 if (parentPhase != null) { 37 repository = parentPhase.getRepository();38 env = parentPhase.getEnv();39 lastModified = parentPhase.getLastModified();37 repository = parentPhase.getRepository(); 38 env = parentPhase.getEnv(); 39 lastModified = parentPhase.getLastModified(); 40 40 } 41 41 } 42 42 43 public final AnalyzeResult getResult() { return result; } 44 43 public final AnalyzeResult getResult() { 44 return result; 45 } 46 45 47 public final FortressRepository getRepository() { 46 return repository;47 }48 return repository; 49 } 48 50 49 public final GlobalEnvironment getEnv() {50 return env;51 }51 public final GlobalEnvironment getEnv() { 52 return env; 53 } 52 54 53 public final long getLastModified() {54 return lastModified;55 }56 57 public abstract AnalyzeResult execute() throws StaticError ;55 public final long getLastModified() { 56 return lastModified; 57 } 58 59 public abstract AnalyzeResult execute() throws StaticError; 58 60 59 61 public final AnalyzeResult run() throws StaticError { 60 if (parentPhase != null)61 parentPhase.run();62 if (parentPhase != null) 63 parentPhase.run(); 62 64 result = execute(); 63 65 return result; 64 66 } 65 67 66 68 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/PhaseOrder.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 26 26 27 27 public enum PhaseOrder { 28 EMPTY("Empty Phase"), 29 DISAMBIGUATE("Disambiguation"), 30 GRAMMAR("Grammar Rewriting"), 31 TYPECHECK("Typechecking"), 32 DESUGAR("Desugaring"), 33 CODEGEN("Code generation"); 34 35 private String phaseName; 28 EMPTY("Empty Phase"), 29 DISAMBIGUATE("Disambiguation"), 30 GRAMMAR("Grammar Rewriting"), 31 TYPECHECK("Typechecking"), 32 DESUGAR("Desugaring"), 33 CODEGEN("Code generation"); 36 34 37 PhaseOrder(String phaseName) { 38 this.phaseName = phaseName; 39 } 40 41 public Phase makePhase(FortressRepository repository, GlobalEnvironment env, 42 Iterable<Api> apis, Iterable<Component> components, long lastModified) throws StaticError { 43 Phase empty = new EmptyPhase(repository,env,apis,components,lastModified); 44 switch(this) { 45 case EMPTY: return empty; 46 default: return makePhaseHelper(empty); 47 } 48 } 49 50 private Phase makePhaseHelper(Phase emptyPhase) { 51 switch(this) { 52 case EMPTY: return emptyPhase; 53 case DISAMBIGUATE: return new DisambiguatePhase(EMPTY.makePhaseHelper(emptyPhase)); 54 case GRAMMAR: return new GrammarPhase(DISAMBIGUATE.makePhaseHelper(emptyPhase)); 55 case TYPECHECK: return new TypeCheckPhase(GRAMMAR.makePhaseHelper(emptyPhase)); 56 case DESUGAR: return new DesugarPhase(TYPECHECK.makePhaseHelper(emptyPhase)); 57 case CODEGEN: return new CodeGenerationPhase(DESUGAR.makePhaseHelper(emptyPhase)); 58 default: return InterpreterBug.bug("Unknown static analysis phase: " + phaseName); 59 } 60 } 61 62 @Override 63 public String toString() { 64 return phaseName; 65 } 66 35 private String phaseName; 36 37 PhaseOrder(String phaseName) { 38 this.phaseName = phaseName; 39 } 40 41 public Phase makePhase(FortressRepository repository, 42 GlobalEnvironment env, Iterable<Api> apis, 43 Iterable<Component> components, long lastModified) 44 throws StaticError { 45 Phase empty = new EmptyPhase(repository, env, apis, components, 46 lastModified); 47 switch (this) { 48 case EMPTY: 49 return empty; 50 default: 51 return makePhaseHelper(empty); 52 } 53 } 54 55 private Phase makePhaseHelper(Phase emptyPhase) { 56 switch (this) { 57 case EMPTY: 58 return emptyPhase; 59 case DISAMBIGUATE: 60 return new DisambiguatePhase(EMPTY.makePhaseHelper(emptyPhase)); 61 case GRAMMAR: 62 return new GrammarPhase(DISAMBIGUATE.makePhaseHelper(emptyPhase)); 63 case TYPECHECK: 64 return new TypeCheckPhase(GRAMMAR.makePhaseHelper(emptyPhase)); 65 case DESUGAR: 66 return new DesugarPhase(TYPECHECK.makePhaseHelper(emptyPhase)); 67 case CODEGEN: 68 return new CodeGenerationPhase(DESUGAR.makePhaseHelper(emptyPhase)); 69 default: 70 return InterpreterBug.bug("Unknown static analysis phase: " 71 + phaseName); 72 } 73 } 74 75 @Override 76 public String toString() { 77 return phaseName; 78 } 79 67 80 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/phases/TypeCheckPhase.java
r2406 r2407 14 14 Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered 15 15 trademarks of Sun Microsystems, Inc. in the U.S. and other countries. 16 ******************************************************************************/16 ******************************************************************************/ 17 17 18 18 package com.sun.fortress.compiler.phases; … … 37 37 38 38 public class TypeCheckPhase extends Phase { 39 39 40 40 public TypeCheckPhase(Phase parentPhase) { 41 super(parentPhase);42 }41 super(parentPhase); 42 } 43 43 44 @Override45 public AnalyzeResult execute( ) throws StaticError {46 Debug.debug( Debug.Type.FORTRESS, 1, "Start phase TypeCheck");47 AnalyzeResult previous = parentPhase.getResult(); 44 @Override 45 public AnalyzeResult execute() throws StaticError { 46 Debug.debug(Debug.Type.FORTRESS, 1, "Start phase TypeCheck"); 47 AnalyzeResult previous = parentPhase.getResult(); 48 48 49 IndexBuilder.ApiResult apiIndex = IndexBuilder.buildApis(previous.apiIterator(), lastModified); 50 IndexBuilder.ComponentResult componentIndex = IndexBuilder.buildComponents(previous.componentIterator(), lastModified); 51 GlobalEnvironment apiEnv = new GlobalEnvironment.FromMap(CollectUtil.union(repository.apis(), 52 apiIndex.apis())); 49 IndexBuilder.ApiResult apiIndex = IndexBuilder.buildApis(previous 50 .apiIterator(), lastModified); 51 IndexBuilder.ComponentResult componentIndex = IndexBuilder 52 .buildComponents(previous.componentIterator(), lastModified); 53 GlobalEnvironment apiEnv = new GlobalEnvironment.FromMap(CollectUtil 54 .union(repository.apis(), apiIndex.apis())); 53 55 54 StaticChecker.ApiResult apiSR = StaticChecker.checkApis( apiIndex.apis(), apiEnv ); 56 StaticChecker.ApiResult apiSR = StaticChecker.checkApis( 57 apiIndex.apis(), apiEnv); 55 58 56 if ( !apiSR.isSuccessful() ){57 throw new MultipleStaticError(apiSR.errors());58 }59 if (!apiSR.isSuccessful()) { 60 throw new MultipleStaticError(apiSR.errors()); 61 } 59 62 60 StaticChecker.ComponentResult componentSR =61 StaticChecker.checkComponents(componentIndex.components(), env);63 StaticChecker.ComponentResult componentSR = StaticChecker 64 .checkComponents(componentIndex.components(), env); 62 65 63 if ( !componentSR.isSuccessful() ){64 throw new MultipleStaticError(componentSR.errors());65 }66 if (!componentSR.isSuccessful()) { 67 throw new MultipleStaticError(componentSR.errors()); 68 } 66 69 67 return new AnalyzeResult(apiSR.apis(), componentSR.components(), 68 IterUtil.<StaticError> empty(), 69 Option.<Map<Pair<Node,Span>, TypeEnv>>some(componentSR.typeEnvAtNode())); 70 return new AnalyzeResult(apiSR.apis(), componentSR.components(), 71 IterUtil.<StaticError> empty(), Option 72 .<Map<Pair<Node, Span>, TypeEnv>> some(componentSR 73 .typeEnvAtNode())); 70 74 } 71 75

