Changeset 2133

Show
Ignore:
Timestamp:
06/29/08 09:16:13 (3 months ago)
Author:
sukyoungryu
Message:

[refactoring] Cleaning up the compiler/driver/repository directories.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/Fortress.java

    r2132 r2133  
    1818package com.sun.fortress.compiler; 
    1919 
    20 import com.sun.fortress.repository.FortressRepository; 
    2120import java.io.File; 
    2221import java.io.FileNotFoundException; 
     
    2524import java.util.Map; 
    2625 
     26import com.sun.fortress.repository.FortressRepository; 
     27import com.sun.fortress.repository.GraphRepository; 
     28import com.sun.fortress.repository.CacheBasedRepository; 
    2729import com.sun.fortress.compiler.environments.TopLevelEnvGen; 
    2830import com.sun.fortress.compiler.index.ApiIndex; 
     
    5052public class Fortress { 
    5153 
    52  private final FortressRepository _repository; 
    53  
    54  public Fortress(FortressRepository repository) { _repository = repository; } 
    55  
    56  //    /** 
    57  //     * Compile all definitions in the given files, and any additional sources that 
    58  //     * they depend on, and add them to the fortress. 
    59  //     */ 
    60  //    public Iterable<? extends StaticError> compile(Path path, File... files) { 
    61  //        return compile(path, IterUtil.asIterable(files)); 
    62  //    } 
    63  // 
    64  //    /** 
    65  //     * Compile all definitions in the given files, and any additional sources that 
    66  //     * they depend on, and add them to the fortress. 
    67  //     */ 
    68  //    public Iterable<? extends StaticError> compile(Path path, Iterable<File> files) { 
    69  //        GlobalEnvironment env = new GlobalEnvironment.FromMap(_repository.apis()); 
    70  // 
    71  //        FortressParser.Result pr = FortressParser.parse(files, env, path); 
    72  //        // Parser.Result pr = Parser.parse(files, env); 
    73  //        if (!pr.isSuccessful()) { return pr.errors(); } 
    74  //        System.out.println("Parsing done."); 
    75  // 
    76  //        return analyze(env, pr); 
    77  //    } 
    78  
    79  /** 
    80   * Compile all definitions in the given files, and any additional sources that 
    81   * they depend on, and add them to the fortress. 
    82   */ 
    83  public Iterable<? extends StaticError> compile(Path path, String... files) { 
    84  
    85   FortressRepository bcr = Driver.fssRepository(path, _repository); 
    86  
    87                 Debug.debug( 2, "Compiling files " + java.util.Arrays.asList(files) ); 
    88   Parser.Result result = compileInner(bcr, files); 
    89  
    90   // Parser.Result pr = Parser.parse(files, env); 
    91   if (!result.isSuccessful()) { return result.errors(); } 
    92   if (bcr.verbose()) 
    93    System.err.println("Parsing done."); 
    94  
    95   GlobalEnvironment env = new GlobalEnvironment.FromMap(bcr.apis()); 
    96  
    97   //return analyze(env, result); 
    98   return IterUtil.empty(); 
    99  } 
     54    private final FortressRepository _repository; 
     55    public static FortressRepository CURRENT_INTERPRETER_REPOSITORY = null; 
     56 
     57    /** 
     58     * This is used to communicate, clumsily, with parsers generated by syntax expansion. 
     59     * The interface should be improved. 
     60     */ 
     61    public static void setCurrentInterpreterRepository( FortressRepository g ){ 
     62        CURRENT_INTERPRETER_REPOSITORY = g; 
     63    } 
     64 
     65    private static FortressRepository specificRepository(Path p, FortressRepository cache ){ 
     66        FortressRepository fr = new GraphRepository( p, cache ); 
     67        CURRENT_INTERPRETER_REPOSITORY = fr; 
     68        return fr; 
     69    } 
     70 
     71    private static FortressRepository specificRepository(Path p) { 
     72        // This is bogus; we need to find a better way to communicate with the 
     73        // syntax transfomer. 
     74 
     75        return specificRepository( p, new CacheBasedRepository(ProjectProperties.ANALYZED_CACHE_DIR) ); 
     76    } 
     77 
     78    public static FortressRepository extendedRepository(String s, FortressRepository cache ) { 
     79       return specificRepository(ProjectProperties.SOURCE_PATH.prepend(s), cache); 
     80    } 
     81 
     82 
     83 
     84    public Fortress(FortressRepository repository) { _repository = repository; } 
     85 
     86    /** 
     87     * Compile all definitions in the given files, and any additional sources that 
     88     * they depend on, and add them to the fortress. 
     89     */ 
     90    public Iterable<? extends StaticError> compile(Path path, String... files) { 
     91        FortressRepository bcr = new GraphRepository( path, _repository ); 
     92        CURRENT_INTERPRETER_REPOSITORY = bcr; 
     93 
     94        Debug.debug( 2, "Compiling files " + java.util.Arrays.asList(files) ); 
     95        Parser.Result result = compileInner(bcr, files); 
     96 
     97        if (!result.isSuccessful()) { return result.errors(); } 
     98        if (bcr.verbose()) 
     99            System.err.println("Compiling done."); 
     100 
     101        GlobalEnvironment env = new GlobalEnvironment.FromMap(bcr.apis()); 
     102 
     103        return IterUtil.empty(); 
     104    } 
    100105 
    101106 private Parser.Result compileInner(FortressRepository bcr, 
     
    317322 
    318323 public Iterable<? extends StaticError>  run(Path path, APIName componentName, boolean test, List<String> args) { 
    319   FortressRepository bcr = Driver.specificRepository(path); 
     324  FortressRepository bcr = specificRepository(path); 
    320325 
    321326  try { 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/Types.java

    r2112 r2133  
    3333 
    3434import static com.sun.fortress.nodes_util.NodeFactory.*; 
     35import static com.sun.fortress.interpreter.glue.WellKnownNames.*; 
    3536 
    3637/** 
     
    4546 
    4647    public static final Id ANY_NAME = makeId("AnyType", "Any"); 
    47     public static final Id ARRAY_NAME = makeId("FortressLibrary","Array"); 
     48    public static final Id ARRAY_NAME = makeId(fortressLibrary,"Array"); 
    4849    public static final AnyType ANY = new AnyType(); 
    4950    public static final BottomType BOTTOM = new BottomType(); 
    50     public static final TraitType OBJECT = makeTraitType("FortressLibrary", "Object"); 
    51     // public static final Type TUPLE = NodeFactory.makeTraitType("FortressBuiltin", "Tuple"); 
    52      
     51    public static final TraitType OBJECT = makeTraitType(fortressLibrary, "Object"); 
     52    // public static final Type TUPLE = NodeFactory.makeTraitType(fortressBuiltin, "Tuple"); 
     53 
    5354    public static final Domain BOTTOM_DOMAIN = NodeFactory.makeDomain(BOTTOM); 
    5455 
    5556    public static final VoidType VOID = new VoidType(); 
    56     public static final TraitType FLOAT_LITERAL = makeTraitType("FortressBuiltin", "FloatLiteral"); 
    57     public static final TraitType INT_LITERAL = makeTraitType("FortressBuiltin", "IntLiteral"); 
    58     public static final TraitType BOOLEAN = makeTraitType("FortressBuiltin", "Boolean"); 
    59     public static final TraitType CHAR = makeTraitType("FortressBuiltin", "Char"); 
    60     public static final TraitType STRING = makeTraitType("FortressBuiltin", "String"); 
    61     public static final TraitType REGION = makeTraitType("FortressLibrary", "Region"); 
    62     public static final TraitType EXCEPTION = makeTraitType("FortressLibrary", "Exception"); 
    63     public static final TraitType CHECKED_EXCEPTION = makeTraitType("FortressLibrary", "CheckedException"); 
    64      
     57    public static final TraitType FLOAT_LITERAL = makeTraitType(fortressBuiltin, "FloatLiteral"); 
     58    public static final TraitType INT_LITERAL = makeTraitType(fortressBuiltin, "IntLiteral"); 
     59    public static final TraitType BOOLEAN = makeTraitType(fortressBuiltin, "Boolean"); 
     60    public static final TraitType CHAR = makeTraitType(fortressBuiltin, "Char"); 
     61    public static final TraitType STRING = makeTraitType(fortressBuiltin, "String"); 
     62    public static final TraitType REGION = makeTraitType(fortressLibrary, "Region"); 
     63    public static final TraitType EXCEPTION = makeTraitType(fortressLibrary, "Exception"); 
     64    public static final TraitType CHECKED_EXCEPTION = makeTraitType(fortressLibrary, "CheckedException"); 
     65 
    6566    public static final LabelType LABEL = new LabelType(); 
    66      
     67 
    6768    public static final TraitType makeVarargsParamType(Type varargsType) { 
    6869        // TODO: parameterize? 
    69         return makeTraitType("FortressBuiltin", "ImmutableHeapSequence"); 
    70     } 
    71      
     70        return makeTraitType(fortressBuiltin, "ImmutableHeapSequence"); 
     71    } 
     72 
    7273    public static TraitType makeThreadType(Type typeArg) { 
    73         return makeTraitType(makeId("FortressBuiltin", "Thread"), 
     74        return makeTraitType(makeId(fortressBuiltin, "Thread"), 
    7475                             makeTypeArg(typeArg)); 
    7576    } 
    76      
     77 
    7778    public static Id getArrayKName(int k){ 
    7879     String name = "Array"+k; 
    79      return makeId("FortressLibrary",name); 
    80     } 
    81      
     80     return makeId(fortressLibrary,name); 
     81    } 
     82 
    8283    public static TraitType makeArrayType(Type elem, Type indexed){ 
    8384     return makeTraitType(ARRAY_NAME, makeTypeArg(elem),makeTypeArg(indexed)); 
    8485    } 
    85      
     86 
    8687    public static TraitType makeArrayKType(int k, List<StaticArg> args){ 
    8788     return  makeTraitType(getArrayKName(k),args); 
    8889    } 
    89      
     90 
    9091    /** 
    9192     * Create a type {@code FortressLibrary.Generator[\typeArg\]}. 
    9293     */ 
    9394    public static TraitType makeGeneratorType(Type typeArg) { 
    94         return makeTraitType(makeId("FortressLibrary", "Generator"), 
     95        return makeTraitType(makeId(fortressLibrary, "Generator"), 
    9596                             makeTypeArg(typeArg)); 
    9697    } 
    97      
     98 
    9899    /** 
    99100     * Create a type {@code FortressLibrary.Condition[\typeArg\]}. 
    100101     */ 
    101102    public static TraitType makeConditionType(Type typeArg) { 
    102         return makeTraitType(makeId("FortressLibrary", "Condition"), 
     103        return makeTraitType(makeId(fortressLibrary, "Condition"), 
    103104                             makeTypeArg(typeArg)); 
    104105    } 
    105      
     106 
    106107    /** Construct the appropriate type from a list of union elements. */ 
    107108    public static Type makeUnion(Iterable<Type> disjuncts) { 
    108109        return MAKE_UNION.value(disjuncts); 
    109110    } 
    110      
     111 
    111112    /** Construct the appropriate type from a list of union elements. */ 
    112113    public static final Lambda<Iterable<Type>, Type> MAKE_UNION = 
     
    125126        return MAKE_INTERSECTION.value(conjuncts); 
    126127    } 
    127      
     128 
    128129    /** Construct the appropriate type from a list of intersection elements. */ 
    129130    public static final Lambda<Iterable<Type>, Type> MAKE_INTERSECTION = 
     
    137138        } 
    138139    }; 
    139      
     140 
    140141    /** Treat an arbitrary type as a union and enumerate its elements. */ 
    141142    public static Iterable<Type> disjuncts(Type t) { 
    142143        return t.accept(DISJUNCTS); 
    143144    } 
    144      
     145 
    145146    /** Treat an arbitrary type as a union and enumerate its elements. */ 
    146147    public static final NodeVisitorLambda<Iterable<Type>> DISJUNCTS = 
     
    156157        } 
    157158    }; 
    158      
     159 
    159160    /** Treat an arbitrary type as an intersection and enumerate its elements. */ 
    160161    public static Iterable<Type> conjuncts(Type t) { 
     
    178179        //} 
    179180    }; 
    180      
     181 
    181182    /** 
    182183     * Construct the appropriate type (void, a tuple, or the type itself) from a list of 
     
    198199        } 
    199200    }; 
    200      
     201 
    201202    /** 
    202203     * Produce the union disjunct of the given vararg tuple at a certain arity. 
     
    237238        } 
    238239    } 
    239      
     240 
    240241    /** 
    241242     * Produce a map from keyword names to types.  The iteration order of the 
     
    253254        } 
    254255    } 
    255      
     256 
    256257    /** 
    257258     * Construct a Domain from a single type representing the required arguments 
     
    265266        return makeDomain(argsType, keywordList); 
    266267    } 
    267      
     268 
    268269    /** 
    269270     * Construct a Domain from a single type representing the required arguments 
     
    296297//  NodeFactory.makeTraitType(makeId("TotalOperater"), sargs) 
    297298//  NodeFactory.makeOpArg("whoa"); 
    298    
     299 
    299300  return NI.nyi(); 
    300301 } 
    301      
     302 
    302303} 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/Driver.java

    r2127 r2133  
    9191import com.sun.fortress.nodes_util.NodeFactory; 
    9292import com.sun.fortress.nodes_util.NodeUtil; 
    93 import com.sun.fortress.repository.CacheBasedRepository; 
    94 import com.sun.fortress.repository.GraphRepository; 
    9593import com.sun.fortress.useful.BASet; 
    9694import com.sun.fortress.useful.CheckedNullPointerException; 
     
    106104import edu.rice.cs.plt.tuple.Option; 
    107105 
     106import static com.sun.fortress.interpreter.glue.WellKnownNames.*; 
     107import static com.sun.fortress.compiler.Fortress.CURRENT_INTERPRETER_REPOSITORY; 
     108 
    108109public class Driver { 
    109110 
     
    112113    private static boolean _libraryTest = false; 
    113114 
    114     private static FortressRepository DEFAULT_INTERPRETER_REPOSITORY = 
    115         new GraphRepository( ProjectProperties.SOURCE_PATH, 
    116                 new CacheBasedRepository( ProjectProperties.ANALYZED_CACHE_DIR ) ); 
    117         /* 
    118         ProjectProperties.noStaticAnalysis ? 
    119         new GraphRepository( ProjectProperties.SOURCE_PATH, 
    120                 new CacheBasedRepository( ProjectProperties.INTERPRETER_CACHE_DIR ) ) 
    121             : 
    122         new GraphRepository( ProjectProperties.SOURCE_PATH, 
    123                 new CacheBasedRepository( ProjectProperties.ANALYZED_CACHE_DIR ) ); 
    124                 */ 
    125         /* 
    126         ProjectProperties.noStaticAnalysis ? 
    127                 new BatchCachingRepository( 
    128                       (ProjectProperties.SOURCE_PATH), 
    129                       new CacheBasedRepository(ProjectProperties.INTERPRETER_CACHE_DIR) 
    130                       ) 
    131                 : 
    132         new BatchCachingAnalyzingRepository(false, 
    133             (ProjectProperties.SOURCE_PATH), 
    134             new CacheBasedRepository(ProjectProperties.ANALYZED_CACHE_DIR) 
    135             ); 
    136             */ 
    137  
    138                       /** 
    139                        * This is used to communicate, clumsily, with parsers generated by syntax expansion. 
    140                        * The interface should be improved. 
    141                        */ 
    142     public static FortressRepository CURRENT_INTERPRETER_REPOSITORY = null; 
    143  
    144     public static String libraryName = "FortressLibrary"; 
    145     public static String builtinsName = "AnyType"; 
    146     public static String nativesName = "FortressBuiltin"; 
     115    static String libraryName = fortressLibrary; 
     116    static String nativesName = fortressBuiltin; 
     117    static String builtinsName = "AnyType"; 
    147118 
    148119    private Driver() {}; 
    149120 
    150121    static public void runTests() { 
    151     } 
    152  
    153     public static FortressRepository defaultRepository() { 
    154         // This is bogus; we need to find a better way to communicate with the 
    155         // syntax transfomer. 
    156          CURRENT_INTERPRETER_REPOSITORY = DEFAULT_INTERPRETER_REPOSITORY; 
    157         return CURRENT_INTERPRETER_REPOSITORY; 
    158     } 
    159  
    160     public static FortressRepository extendedRepository(String s) { 
    161        return specificRepository(ProjectProperties.SOURCE_PATH.prepend(s)); 
    162     } 
    163  
    164     public static FortressRepository extendedRepository(String s, FortressRepository cache ) { 
    165        return specificRepository(ProjectProperties.SOURCE_PATH.prepend(s), cache); 
    166     } 
    167  
    168     public static FortressRepository specificRepository(Path p, FortressRepository cache ){ 
    169         FortressRepository fr = new GraphRepository( p, cache ); 
    170         CURRENT_INTERPRETER_REPOSITORY = fr; 
    171         return fr; 
    172     } 
    173  
    174     public static FortressRepository specificRepository(Path p) { 
    175         // This is bogus; we need to find a better way to communicate with the 
    176         // syntax transfomer. 
    177  
    178         return specificRepository( p, new CacheBasedRepository(ProjectProperties.ANALYZED_CACHE_DIR) ); 
    179  
    180         /* 
    181         FortressRepository fr = 
    182             ProjectProperties.noStaticAnalysis ? 
    183                     // new BatchCachingRepository( 
    184                     new GraphRepository( 
    185                           p, 
    186                           new CacheBasedRepository(ProjectProperties.INTERPRETER_CACHE_DIR) 
    187                           ) 
    188                     : 
    189             // new BatchCachingAnalyzingRepository(false, 
    190             new GraphRepository( 
    191                 p, 
    192                 new CacheBasedRepository(ProjectProperties.ANALYZED_CACHE_DIR) 
    193                 ); 
    194  
    195         CURRENT_INTERPRETER_REPOSITORY = fr; 
    196         return fr; 
    197         */ 
    198     } 
    199  
    200     public static void setCurrentInterpreterRepository( FortressRepository g ){ 
    201         CURRENT_INTERPRETER_REPOSITORY = g; 
    202     } 
    203  
    204     public static FortressRepository fssRepository(Path p, FortressRepository derived) { 
    205         // This is bogus; we need to find a better way to communicate with the 
    206         // syntax transfomer. 
    207  
    208         FortressRepository fr = new GraphRepository( p, derived ); 
    209             /* 
    210         BatchCachingAnalyzingRepository fr = 
    211  
    212             new BatchCachingAnalyzingRepository(false, 
    213                 p, 
    214                 derived 
    215                 ); 
    216                 */ 
    217  
    218         CURRENT_INTERPRETER_REPOSITORY = fr; 
    219         return fr; 
    220122    } 
    221123 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/glue/WellKnownNames.java

    r1882 r2133  
    2828        return "__builtinFactory"+rank; 
    2929    } 
     30 
     31    public static String fortressLibrary = "FortressLibrary"; 
     32    public static String fortressBuiltin = "FortressBuiltin"; 
     33 
     34    public static final String[] defaultLibrary = 
     35        { fortressLibrary, "AnyType", fortressBuiltin, "NatReflect", 
     36          "NativeArray" }; 
     37 
    3038    public static String varargsFactoryName = "__immutableFactory1"; 
    3139    public static String arrayElementTypeName = "T"; 
  • trunk/ProjectFortress/src/com/sun/fortress/repository/GraphRepository.java

    r2127 r2133  
    5151import com.sun.fortress.exceptions.WrappedException; 
    5252import com.sun.fortress.exceptions.MultipleStaticError; 
    53 import com.sun.fortress.interpreter.Driver; 
    5453import com.sun.fortress.syntax_abstractions.parser.FortressParser; 
    5554import com.sun.fortress.useful.Debug; 
     
    6665import com.sun.fortress.repository.graph.GraphNode; 
    6766import com.sun.fortress.repository.graph.GraphVisitor; 
     67 
     68import static com.sun.fortress.interpreter.glue.WellKnownNames.*; 
    6869 
    6970/* A graph-based repository. This repository determines the dependency structure 
     
    8182 
    8283        /* files that are dependancies of everything */ 
    83        private static final String[] roots = {"FortressLibrary", "AnyType", "FortressBuiltin", "NatReflect", "NativeArray" }
     84    private static final String[] roots = defaultLibrary
    8485 
    8586        /* stores the nodes and their relationships */ 
     
    143144            } 
    144145        } 
    145          
     146 
    146147        private class CacheVisitor implements GraphVisitor<Long, FileNotFoundException>{ 
    147148            public Long visit(ApiGraphNode node) throws FileNotFoundException { 
     
    157158            return findFile( node.getName(), ProjectProperties.COMP_SOURCE_SUFFIX ).lastModified(); 
    158159        } 
    159          
     160 
    160161        private long getFileDate( ApiGraphNode node ) throws FileNotFoundException { 
    161162            return findFile( node.getName(), ProjectProperties.API_SOURCE_SUFFIX ).lastModified(); 
     
    356357            return source.lastModified() > now; 
    357358        } 
    358          
     359 
    359360        private boolean newer( ComponentGraphNode node, long now ) throws FileNotFoundException { 
    360361            File source = findFile(node.getName(), ProjectProperties.COMP_SOURCE_SUFFIX); 
     
    585586                GraphRepository g1 = new GraphRepository( this.path, this.cache ); 
    586587                /* FIXME: hack to prevent infinite recursion */ 
    587                 Driver.setCurrentInterpreterRepository( g1 ); 
     588                Fortress.setCurrentInterpreterRepository( g1 ); 
    588589                Result result = FortressParser.parse(api_name, file, new GlobalEnvironment.FromRepository( g1 ), verbose()); 
    589590                // Result result = FortressParser.parse(file, new GlobalEnvironment.FromRepository(this), verbose()); 
    590591                /* FIXME: hack to prevent infinite recursion */ 
    591                 Driver.setCurrentInterpreterRepository( this ); 
     592                Fortress.setCurrentInterpreterRepository( this ); 
    592593                if (result.isSuccessful()) { 
    593594                    Debug.debug( 1, "Expanded component " + node ); 
     
    651652        } 
    652653 
    653         /* syntaxExpand will parse a component for us, so this method is not needed */  
     654        /* syntaxExpand will parse a component for us, so this method is not needed */ 
    654655        private Component parseComponent( ComponentGraphNode node ) throws StaticError { 
    655656                try{ 
     
    671672 
    672673        /* return a parsed api */ 
    673         private Api parseApi( ApiGraphNode node ){  
     674        private Api parseApi( ApiGraphNode node ){ 
    674675                try{ 
    675676                        APIName api_name = node.getName(); 
     
    687688                } 
    688689        } 
    689      
     690 
    690691        public Map<APIName, ApiIndex> apis() { 
    691692                return cache.apis(); 
     
    731732                    throw new MultipleStaticError(errors); 
    732733                } 
    733                  
     734 
    734735//              for ( StaticError e : errors ){ 
    735736//                      System.err.println("Error while compiling apis: " + e); 
     
    766767            } 
    767768        } 
    768       
     769 
    769770        /* add a compiled api to the repository */ 
    770771        public void addApi(APIName name, ApiIndex definition) { 
     
    891892                return builder.buildComponentIndex( component, fdot.lastModified() ); 
    892893        } 
    893          
     894 
    894895        public ComponentIndex getLinkedComponent(APIName name) throws FileNotFoundException, IOException { 
    895896                ComponentGraphNode node = addComponentGraph(name); 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/util/InterpreterWrapper.java

    r2125 r2133  
    3030 
    3131import com.sun.fortress.repository.FortressRepository; 
     32import com.sun.fortress.compiler.Fortress; 
    3233import com.sun.fortress.compiler.StaticPhaseResult; 
    3334import com.sun.fortress.exceptions.FortressException; 
     
    8283 
    8384    public  InterpreterWrapper() { 
    84         repository = Driver.CURRENT_INTERPRETER_REPOSITORY; 
     85        repository = Fortress.CURRENT_INTERPRETER_REPOSITORY; 
    8586    } 
    8687 
  • trunk/ProjectFortress/src/com/sun/fortress/unit_tests/FileTests.java

    r2127 r2133  
    3030import com.sun.fortress.repository.FortressRepository; 
    3131import com.sun.fortress.compiler.index.ComponentIndex; 
     32import com.sun.fortress.compiler.Fortress; 
    3233import com.sun.fortress.interpreter.reader.Lex; 
    3334import com.sun.fortress.repository.ProjectProperties; 
     
    100101                    oldOut.print("  ") ; oldOut.print(f); oldOut.print(" "); oldOut.flush(); 
    101102                    APIName apiname = NodeFactory.makeAPIName(s); 
    102                     FortressRepository fr = Driver.extendedRepository( path, cache ); 
     103                    FortressRepository fr = Fortress.extendedRepository( path, cache ); 
    103104                    ComponentIndex ci = fr.getLinkedComponent(apiname); 
    104105 
     
    196197    } 
    197198 
    198     public static class JSTTest extends TestCase { 
    199         String s; 
    200         String d; 
    201  
    202         public JSTTest(String d, String s) { 
    203             super("testFile"); 
    204             this.s = s; 
    205             this.d = d; 
    206         } 
    207  
    208         public String getName() { 
    209             return d + "/" + s; 
    210         } 
    211  
    212         public void testFile() throws Throwable { 
    213             System.out.println(s + " test"); 
    214             BufferedReader br = new BufferedReader(new FileReader(d + "/" + s + ".tfs")); 
    215             FortressRepository fr = Driver.defaultRepository(); 
    216             Lex lex = new Lex(br); 
    217             Unprinter up = new Unprinter(lex); 
    218             lex.name(); // Inhale opening parentheses 
    219             CompilationUnit p = (CompilationUnit) up.readNode(lex.name()); 
    220             Driver.runProgram(fr, p, true, false, new ArrayList<String>()); 
    221         } 
    222  
    223     } 
    224  
    225199    public static void main(String[] args) throws IOException { 
    226200        junit.textui.TestRunner.run(FileTests.suite("tests", true, false)); 
     
    241215 
    242216        FortressRepository cache = new CacheBasedRepository( ProjectProperties.ANALYZED_CACHE_DIR ); 
    243  
    244         /* 
    245         FortressRepository fr = 
    246             Driver.extendedRepository(dir.getCanonicalPath()); 
    247             */ 
    248  
    249 //            ProjectProperties.noStaticAnalysis ? 
    250 //                    new BatchCachingRepository( 
    251 //                          //new PathBasedSyntaxTransformingRepository 
    252 //                          (ProjectProperties.SOURCE_PATH.prepend(dir)), 
    253 //                          new CacheBasedRepository(ProjectProperties.ensureDirectoryExists("./.interpreter_cache")) 
    254 //                          ) 
    255 //                    : 
    256 //            new BatchCachingAnalyzingRepository(false, 
    257 //                (ProjectProperties.SOURCE_PATH.prepend(dir)), 
    258 //                new CacheBasedRepository(ProjectProperties.ensureDirectoryExists("./.analyzed_cache")) 
    259 //                ); 
    260  
    261  
    262         // fr.addRootApis(); 
    263217 
    264218        for (int i = 0; i < files.length; i++) { 
     
    275229                    String testname = s.substring(0, l); 
    276230                    suite.addTest(new FSSTest(cache, dir.getCanonicalPath(), dirname, testname, failsOnly, expect_failure)); 
    277                 } else if (s.endsWith(".tfs")) { 
    278                     int l = s.lastIndexOf(".tfs"); 
    279                     suite.addTest(new JSTTest(dirname, s.substring(0, l))); 
    280231                } else { 
    281232                    System.out.println("Not compiling file " + s);