Changeset 3093

Show
Ignore:
Timestamp:
11/24/08 18:09:59 (12 months ago)
Author:
sukyoungryu
Message:

[ast restructuring] Remove distinctions between declarations in APIs (AbsDecl?) and in components (Decl).

Location:
trunk
Files:
1 added
34 modified

Legend:

Unmodified
Added
Removed
  • trunk/Library/FortressSyntax.fsi

    r3078 r3093  
    3939      Decls : List[\Decl\] 
    4040      Decl : List[\Decl\] 
    41       AbsDecls : List[\AbsDecl\] 
    42       AbsDecl : AbsDecl 
     41      AbsDecls : List[\Decl\] 
     42      AbsDecl : Decl 
    4343  end 
    4444 
  • trunk/ProjectFortress/astgen/Fortress.ast

    r3092 r3093  
    7676     * declaration in components or APIs 
    7777     */ 
    78     interface AbsDeclOrDecl(); 
    79         /** 
    80          * declaration in APIs 
    81          */ 
    82         interface AbsDecl(); 
    83         /** 
    84          * declaration in components 
    85          */ 
    86         interface Decl(); 
     78    interface Decl(); 
    8779    /** 
    8880     * left-hand-side of assignments, local variable declarations, or 
     
    108100     */ 
    109101    interface HasParams(Option<List<Param>> params, 
    110                         List<? extends AbsDeclOrDecl> decls); 
     102                        List<Decl> decls); 
    111103    /** 
    112104     * with a where clause 
     
    135127     */ 
    136128    interface GenericWithParams() extends Generic, HasParams; 
    137     interface GenericAbsDeclOrDecl() extends Generic, AbsDeclOrDecl; 
    138         interface GenericDecl() extends Decl; 
    139     interface GenericAbsDeclOrDeclWithParams() extends GenericWithParams, 
    140                                                        GenericAbsDeclOrDecl; 
    141         interface GenericDeclWithParams() extends GenericDecl; 
     129    interface GenericDecl() extends Generic, Decl; 
     130        interface GenericDeclWithParams() extends GenericWithParams; 
    142131 
    143132    /** 
     
    183172             *       end 
    184173             */ 
    185             Api(List<AbsDecl> decls); 
     174            Api(List<Decl> decls); 
    186175        /** 
    187176         * import statement 
     
    232221         */ 
    233222        abstract TraitObjectAbsDeclOrDecl(List<Modifier> mods 
    234                                               = Collections.<Modifier>emptyList(), 
    235                                           Id name, 
    236                                           List<StaticParam> staticParams 
    237                                               = Collections.<StaticParam>emptyList(), 
    238                                           List<TraitTypeWhere> extendsClause 
    239                                               = Collections.<TraitTypeWhere>emptyList(), 
    240                                           Option<WhereClause> where 
    241                                               = Option.<WhereClause>none(), 
    242                                           List<? extends AbsDeclOrDecl> decls) 
    243                                          implements HasWhere, GenericAbsDeclOrDecl; 
     223                                     = Collections.<Modifier>emptyList(), 
     224                                 Id name, 
     225                                 List<StaticParam> staticParams 
     226                                     = Collections.<StaticParam>emptyList(), 
     227                                 List<TraitTypeWhere> extendsClause 
     228                                     = Collections.<TraitTypeWhere>emptyList(), 
     229                                 Option<WhereClause> where 
     230                                     = Option.<WhereClause>none(), 
     231                                 List<Decl> decls) 
     232                                 implements HasWhere, GenericDecl; 
    244233            /** 
    245234             * trait declaration in components or APIs 
    246235             */ 
    247236            abstract TraitAbsDeclOrDecl(List<BaseType> excludes 
    248                                             = Collections.<BaseType>emptyList(), 
    249                                         Option<List<BaseType>> comprises 
    250                                             = Option.<List<BaseType>>none(), 
    251                                         List<? extends AbsDeclOrDecl> decls); 
     237                                   = Collections.<BaseType>emptyList(), 
     238                               Option<List<BaseType>> comprises 
     239                                   = Option.<List<BaseType>>none(), 
     240                               List<Decl> decls); 
    252241                /** 
    253242                 * trait declaration in APIs 
     
    274263                 *       end 
    275264                 */ 
    276                 AbsTraitDecl(List<AbsDecl> decls) implements AbsDecl; 
     265                AbsTraitDecl(List<Decl> decls) implements Decl; 
    277266                /** 
    278267                 * trait declaration in components 
     
    298287             */ 
    299288            abstract ObjectAbsDeclOrDecl(Option<List<Param>> params 
    300                                              = Option.<List<Param>>none(), 
    301                                          Option<List<BaseType>> throwsClause 
    302                                              = Option.<List<BaseType>>none(), 
    303                                          Option<Contract> contract 
    304                                              = Option.<Contract>none(), 
    305                                          List<? extends AbsDeclOrDecl> decls) 
    306                                         implements GenericAbsDeclOrDeclWithParams; 
     289                                    = Option.<List<Param>>none(), 
     290                                Option<List<BaseType>> throwsClause 
     291                                    = Option.<List<BaseType>>none(), 
     292                                Option<Contract> contract 
     293                                    = Option.<Contract>none(), 
     294                                List<Decl> decls) 
     295                               implements GenericDeclWithParams; 
    307296                /** 
    308297                 * object declaration in APIs 
     
    328317                 * e.g.) object Empty[\alph\]() extends List[\alpha\] end 
    329318                 */ 
    330                 AbsObjectDecl(List<AbsDecl> decls) implements AbsDecl; 
     319                AbsObjectDecl(List<Decl> decls) implements Decl; 
    331320                /** 
    332321                 * object declaration in components 
     
    344333                 *       end 
    345334                 */ 
    346                 ObjectDecl(List<Decl> decls) 
    347                           implements GenericDeclWithParams; 
     335                ObjectDecl(List<Decl> decls) implements GenericDeclWithParams; 
    348336        /** 
    349337         * variable declaration in components or APIs 
    350338         */ 
    351         abstract VarAbsDeclOrDecl(List<LValue> lhs) implements AbsDeclOrDecl; 
     339        abstract VarAbsDeclOrDecl(List<LValue> lhs) implements Decl; 
    352340            /** 
    353341             * variable declaration in APIs 
     
    362350             * e.g.) var (x, y): ZZ64... 
    363351             */ 
    364             AbsVarDecl() implements AbsDecl, Decl; 
     352            AbsVarDecl() implements Decl; 
    365353            /** 
    366354             * variable declaration in components 
     
    391379         */ 
    392380        abstract FnAbsDeclOrDecl(List<Modifier> mods 
    393                                      = Collections.<Modifier>emptyList(), 
    394                                  IdOrOpOrAnonymousName name, 
    395                                  List<StaticParam> staticParams 
    396                                      = Collections.<StaticParam>emptyList(), 
    397                                  List<Param> params 
    398                                      = Collections.<Param>emptyList(), 
    399                                  Option<Type> returnType 
    400                                      = Option.<Type>none(), 
    401                                  Option<List<BaseType>> throwsClause 
    402                                      = Option.<List<BaseType>>none(), 
    403                                  Option<WhereClause> where 
    404                                      = Option.<WhereClause>none(), 
    405                                  Option<Contract> contract 
    406                                      = Option.<Contract>none(), 
    407                                  Id unambiguousName = new Id(in_span, "FN$"+in_span.toString())) 
    408                                 implements Applicable, GenericDecl; 
     381                            = Collections.<Modifier>emptyList(), 
     382                        IdOrOpOrAnonymousName name, 
     383                        List<StaticParam> staticParams 
     384                            = Collections.<StaticParam>emptyList(), 
     385                        List<Param> params 
     386                            = Collections.<Param>emptyList(), 
     387                        Option<Type> returnType 
     388                            = Option.<Type>none(), 
     389                        Option<List<BaseType>> throwsClause 
     390                            = Option.<List<BaseType>>none(), 
     391                        Option<WhereClause> where 
     392                            = Option.<WhereClause>none(), 
     393                        Option<Contract> contract 
     394                            = Option.<Contract>none(), 
     395                        Id unambiguousName = new Id(in_span, "FN$"+in_span.toString())) 
     396                       implements Applicable, GenericDecl; 
    409397            /** 
    410398             * functional declaration in components or APIs 
     
    424412             * e.g.) swap (x: Object, y: Object): (Object, Object) 
    425413             */ 
    426             AbsFnDecl() implements AbsDecl; 
     414            AbsFnDecl() implements Decl; 
    427415            /** 
    428416             * functional declaration in components 
     
    466454         *               | (unit | SI_unit) Id+ (: Type)? (= Expr)? 
    467455         */ 
    468         abstract DimUnitDecl() implements Decl, AbsDecl; 
     456        abstract DimUnitDecl() implements Decl; 
    469457            /** 
    470458             * dimension declaration 
     
    490478         */ 
    491479        TestDecl(Id name, List<GeneratorClause> gens, Expr expr) 
    492                 implements Decl, AbsDecl; 
     480                implements Decl; 
    493481        /** 
    494482         * property declaration 
     
    498486         */ 
    499487        PropertyDecl(Option<Id> name = Option.<Id>none(), List<Param> params, 
    500                      Expr expr) implements Decl, AbsDecl; 
     488                     Expr expr) implements Decl; 
    501489        /** 
    502490         * grammar declaration 
    503491         * Names (but not extends elements) must be unqualified. 
    504492         */ 
    505         abstract GrammarDecl(Id name, List<Id> extends) implements AbsDecl; 
     493        abstract GrammarDecl(Id name, List<Id> extends) implements Decl; 
    506494            /** 
    507495             * grammar definition 
     
    513501         * Names and params must be unqualified. 
    514502         */ 
    515         abstract GrammarMemberDecl(Id name) implements AbsDecl; 
     503        abstract GrammarMemberDecl(Id name) implements Decl; 
    516504            /** 
    517505             * nonterminal declaration 
     
    547535         * syntax declaration 
    548536         */ 
    549         abstract SyntaxDecl(Option<String> modifier) implements AbsDecl; 
     537        abstract SyntaxDecl(Option<String> modifier) implements Decl; 
    550538            /** 
    551539             * syntax definition in syntax declarations 
     
    559547          * Transformation declaration 
    560548          */ 
    561         abstract TransformerDecl() implements AbsDecl; 
     549        abstract TransformerDecl() implements Decl; 
    562550            /** 
    563551             * pre transformer definition in transformer declarations 
     
    17221710                          = Collections.<StaticParam>emptyList(), 
    17231711                      Type type) 
    1724                      implements Decl, AbsDecl; 
     1712                     implements Decl; 
    17251713            /** 
    17261714             * coercion constraint declared in where clauses 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/IndexBuilder.java

    r3082 r3093  
    180180            } 
    181181        }; 
    182         for (AbsDecl decl : ast.getDecls()) { 
     182        for (Decl decl : ast.getDecls()) { 
    183183            decl.accept(handleDecl); 
    184184        } 
     
    295295            } 
    296296        }; 
    297         for (AbsDeclOrDecl decl : ast.getDecls()) { 
     297        for (Decl decl : ast.getDecls()) { 
    298298            decl.accept(handleDecl); 
    299299        } 
     
    371371            } 
    372372        }; 
    373         for (AbsDeclOrDecl decl : ast.getDecls()) { 
     373        for (Decl decl : ast.getDecls()) { 
    374374            decl.accept(handleDecl); 
    375375        } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/PreDisambiguationDesugaringVisitor.java

    r3071 r3093  
    8383                                        List<BaseType> excludes, 
    8484                                        Option<List<BaseType>> comprises, 
    85                                         List<AbsDecl> decls) { 
     85                                        List<Decl> decls) { 
    8686        if (!that.getName().equals(anyTypeId)) { 
    8787            extendsClause = rewriteExtendsClause(that, extendsClause); 
     
    118118                                         Option<List<BaseType>> throwsClause, 
    119119                                         Option<Contract> contract, 
    120                                          List<AbsDecl> decls) { 
     120                                         List<Decl> decls) { 
    121121        extendsClause = rewriteExtendsClause(that, extendsClause); 
    122122        return super.forAbsObjectDeclOnly(that, mods, name, staticParams, extendsClause, 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/ExprDisambiguator.java

    r3092 r3093  
    3030import com.sun.fortress.exceptions.StaticError; 
    3131import com.sun.fortress.nodes.APIName; 
    32 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     32import com.sun.fortress.nodes.Decl; 
    3333import com.sun.fortress.nodes.AbsFnDecl; 
    3434import com.sun.fortress.nodes.AbsObjectDecl; 
     
    399399 
    400400    private Triple<Set<Id>, Set<IdOrOpOrAnonymousName>, Set<IdOrOpOrAnonymousName>> 
    401         extractDeclNames(List<? extends AbsDeclOrDecl> decls) { 
     401        extractDeclNames(List<Decl> decls) { 
    402402        final Set<IdOrOpOrAnonymousName> accessors = new HashSet<IdOrOpOrAnonymousName>(); 
    403403 
     
    466466 
    467467        Set<Id> vars = new HashSet<Id>(); 
    468         for (AbsDeclOrDecl decl : decls) { 
     468        for (Decl decl : decls) { 
    469469            vars.addAll(decl.accept(var_finder)); 
    470470        } 
    471471 
    472472        Set<IdOrOpOrAnonymousName> fns = new HashSet<IdOrOpOrAnonymousName>(); 
    473         for (AbsDeclOrDecl decl : decls) { 
     473        for (Decl decl : decls) { 
    474474            fns.addAll(decl.accept(fn_finder)); 
    475475        } 
     
    603603                                   v.recurOnListOfBaseType(that.getExcludes()), 
    604604                                   v.recurOnOptionOfListOfBaseType(that.getComprises()), 
    605                                    v.recurOnListOfAbsDecl(that.getDecls())); 
     605                                   v.recurOnListOfDecl(that.getDecls())); 
    606606    } 
    607607 
     
    821821                                    v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 
    822822                                    v.recurOnOptionOfContract(that.getContract()), 
    823                                     v.recurOnListOfAbsDecl(that.getDecls())); 
     823                                    v.recurOnListOfDecl(that.getDecls())); 
    824824    } 
    825825 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java

    r3077 r3093  
    147147                v.recurOnListOfBaseType(that.getExcludes()), 
    148148                v.recurOnOptionOfListOfBaseType(that.getComprises()), 
    149                 v.recurOnListOfAbsDecl(that.getDecls())); 
     149                v.recurOnListOfDecl(that.getDecls())); 
    150150    } 
    151151 
     
    185185                v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 
    186186                v.recurOnOptionOfContract(that.getContract()), 
    187                 v.recurOnListOfAbsDecl(that.getDecls())); 
     187                v.recurOnListOfDecl(that.getDecls())); 
    188188    } 
    189189 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/SubtypeCheckerJUTest.java

    r3078 r3093  
    320320     * Make an ApiIndex with the given name and traits. 
    321321     * @param name  Assumed to consist of a single part (has no '.' separators). 
    322      * @param traits  Each index is assumed to wrap an AbsDecl (not a Decl). 
     322     * @param traits  Each index is assumed to wrap an Decl (not a Decl). 
    323323     */ 
    324324    private static ApiIndex api(String name, TraitIndex... traits) { 
    325         List<AbsDecl> traitDecls = new ArrayList<AbsDecl>(traits.length); 
     325        List<Decl> traitDecls = new ArrayList<Decl>(traits.length); 
    326326        Map<Id, TypeConsIndex> traitMap = new HashMap<Id, TypeConsIndex>(); 
    327327        for (TraitIndex t : traits) { 
    328             traitDecls.add((AbsDecl) t.ast()); 
     328            traitDecls.add((Decl) t.ast()); 
    329329            traitMap.put(t.ast().getName(), t); 
    330330        } 
     
    345345     * Make a ComponentIndex with the given name and traits. 
    346346     * @param name  Assumed to consist of a single part (has no '.' separators). 
    347      * @param traits  Each index is assumed to wrap a Decl (not an AbsDecl). 
     347     * @param traits  Each index is assumed to wrap a Decl (not an Decl). 
    348348     */ 
    349349    private static ComponentIndex component(String name, TraitIndex... traits) { 
     
    378378 
    379379    /** 
    380      * Make a ProperTraitIndex with the given name and supertypes.  Wrapped AST is an AbsDecl. 
     380     * Make a ProperTraitIndex with the given name and supertypes.  Wrapped AST is an Decl. 
    381381     * @param name  A simple name. 
    382382     * @param supers  Type strings (parsed by parseType()); must parse to TraitTypes. 
     
    397397            ast = new AbsTraitDecl(span, NodeFactory.makeId(span, name), sparams, 
    398398                                   extendsClause, 
    399                                    Collections.<AbsDecl>emptyList()); 
     399                                   Collections.<Decl>emptyList()); 
    400400        } 
    401401        else { 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerJUTest.java

    r3078 r3093  
    393393     * Make an ApiIndex with the given name and traits. 
    394394     * @param name  Assumed to consist of a single part (has no '.' separators). 
    395      * @param traits  Each index is assumed to wrap an AbsDecl (not a Decl). 
     395     * @param traits  Each index is assumed to wrap an Decl (not a Decl). 
    396396     */ 
    397397    private static ApiIndex api(String name, TraitIndex... traits) { 
    398         List<AbsDecl> traitDecls = new ArrayList<AbsDecl>(traits.length); 
     398        List<Decl> traitDecls = new ArrayList<Decl>(traits.length); 
    399399        Map<Id, TypeConsIndex> traitMap = new HashMap<Id, TypeConsIndex>(); 
    400400        for (TraitIndex t : traits) { 
    401             traitDecls.add((AbsDecl) t.ast()); 
     401            traitDecls.add((Decl) t.ast()); 
    402402            traitMap.put(t.ast().getName(), t); 
    403403        } 
     
    418418     * Make a ComponentIndex with the given name and traits. 
    419419     * @param name  Assumed to consist of a single part (has no '.' separators). 
    420      * @param traits  Each index is assumed to wrap a Decl (not an AbsDecl). 
     420     * @param traits  Each index is assumed to wrap a Decl (not an Decl). 
    421421     */ 
    422422    private static ComponentIndex component(String name, TraitIndex... traits) { 
     
    451451 
    452452    /** 
    453      * Make a ProperTraitIndex with the given name and supertypes.  Wrapped AST is an AbsDecl. 
     453     * Make a ProperTraitIndex with the given name and supertypes.  Wrapped AST is an Decl. 
    454454     * @param name  A simple name. 
    455455     * @param supers  Type strings (parsed by parseType()); must parse to TraitTypes. 
     
    470470                                   Collections.<StaticParam>emptyList(), 
    471471                                   extendsClause, 
    472                                    Collections.<AbsDecl>emptyList()); 
     472                                   Collections.<Decl>emptyList()); 
    473473        } 
    474474        else { 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/Driver.java

    r3082 r3093  
    5858import com.sun.fortress.interpreter.glue.WellKnownNames; 
    5959import com.sun.fortress.nodes.APIName; 
    60 import com.sun.fortress.nodes.AbsDecl; 
    6160import com.sun.fortress.nodes.AbsFnDecl; 
    6261import com.sun.fortress.nodes.AbsObjectDecl; 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildApiEnvironment.java

    r3082 r3093  
    2626import com.sun.fortress.interpreter.rewrite.ArrowOrFunctional; 
    2727import com.sun.fortress.interpreter.rewrite.IsAnArrowName; 
    28 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     28import com.sun.fortress.nodes.Decl; 
    2929import com.sun.fortress.nodes.AbsFnDecl; 
    3030import com.sun.fortress.nodes.AbsObjectDecl; 
     
    162162    } 
    163163 
    164     private void handlePossibleFM(List<? extends AbsDeclOrDecl> tdecls) { 
    165         for (AbsDeclOrDecl adod : tdecls) { 
     164    private void handlePossibleFM(List<Decl> tdecls) { 
     165        for (Decl adod : tdecls) { 
    166166            ArrowOrFunctional aof = adod 
    167167                    .accept(IsAnArrowName.isAnArrowName); 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildEnvironments.java

    r3082 r3093  
    173173 
    174174 
    175      protected static void doDefs(BuildEnvironments inner, List<? extends AbsDeclOrDecl> defs) { 
    176         for (AbsDeclOrDecl def : defs) { 
     175     protected static void doDefs(BuildEnvironments inner, List<Decl> defs) { 
     176        for (Decl def : defs) { 
    177177            def.accept(inner); 
    178178        } 
    179179    } 
    180180 
    181     protected void doDefs(List<? extends AbsDeclOrDecl> defs) { 
    182         for (AbsDeclOrDecl def : defs) { 
     181    protected void doDefs(List<Decl> defs) { 
     182        for (Decl def : defs) { 
    183183            def.accept(this); 
    184184        } 
     
    196196//        BetterEnv into = ftt.getMembers(); 
    197197//        BetterEnv forTraitMethods = ftt.getMethodExecutionEnv(); 
    198 //        List<? extends AbsDeclOrDecl> defs = ftt.getASTmembers(); 
     198//        List<Decl> defs = ftt.getASTmembers(); 
    199199// 
    200200//        BuildTraitEnvironment inner = new BuildTraitEnvironment(into, 
     
    205205//    } 
    206206// 
    207     public void doDefs1234(List<? extends AbsDeclOrDecl> defs) { 
     207    public void doDefs1234(List<Decl> defs) { 
    208208        doDefs(defs); 
    209209        doDefs234(defs); 
    210210    } 
    211211 
    212     public void doDefs234(List<? extends AbsDeclOrDecl> defs) { 
     212    public void doDefs234(List<Decl> defs) { 
    213213        secondPass(); 
    214214        doDefs(defs); 
     
    528528    public void scanForFunctionalMethodNames( 
    529529            FTraitOrObjectOrGeneric x, 
    530             List<? extends AbsDeclOrDecl> defs) { 
     530            List<Decl> defs) { 
    531531        scanForFunctionalMethodNames(x, defs, false); 
    532532    } 
    533533 
    534534    public void scanForFunctionalMethodNames(FTraitOrObjectOrGeneric x, 
    535             List<? extends AbsDeclOrDecl> defs, boolean bogus) { 
     535            List<Decl> defs, boolean bogus) { 
    536536        // This is probably going away. 
    537537        Environment topLevel = containing; 
     
    891891            ftt.setComprises(Useful.<FType>set(c)); 
    892892        } 
    893         List<? extends AbsDeclOrDecl> fns = x.getDecls(); 
     893        List<Decl> fns = x.getDecls(); 
    894894 
    895895        // doTraitMethodDefs(ftt, null); /* NOTICE THE DIFFERENT ENVIRONMENT! */ 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildTopLevelEnvironments.java

    r3053 r3093  
    3030import com.sun.fortress.interpreter.evaluator.values.SingleFcn; 
    3131import com.sun.fortress.nodes.APIName; 
    32 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     32import com.sun.fortress.nodes.Decl; 
    3333import com.sun.fortress.nodes.AbsTraitDecl; 
    3434import com.sun.fortress.nodes.AliasedAPIName; 
     
    6767     */ 
    6868    public Set<String> typeNames = new HashSet<String>(); 
    69      
     69 
    7070    /** 
    7171     * Used for mapping API Names to their environments 
     
    130130    @Override 
    131131    public Boolean forApi(Api x) { 
    132         List<? extends AbsDeclOrDecl> decls = x.getDecls(); 
     132        List<Decl> decls = x.getDecls(); 
    133133 
    134134        switch (getPass()) { 
     
    141141 
    142142    } 
    143      
     143 
    144144    public Boolean for_RewriteFnOverloadDecl(_RewriteFnOverloadDecl x) { 
    145145        switch (getPass()) { 
     
    150150        } 
    151151        break; 
    152          
     152 
    153153        case 3: { 
    154154            String s = x.getName().stringName(); 
     
    157157                Option<APIName> oapi = fn.getApi(); 
    158158                FValue oapi_val = null; 
    159                  
     159 
    160160                if (fn instanceof Id) { 
    161161                    oapi_val = bindInto.getValueNull((Id) fn, Environment.TOP_LEVEL); // top-level reference 
     
    165165                    bug("Unexpected change to AST node hierarchy"); 
    166166                } 
    167                  
     167 
    168168                if (oapi_val == null) { 
    169169                    bug("Failed to find overload member " + fn + " for " + x); 
    170170                } 
    171                  
     171 
    172172                if (oapi_val instanceof SingleFcn) { 
    173173                    of.addOverload((SingleFcn) oapi_val, true); 
     
    177177                    bug("Unexpected function binding for " + fn +" , value is " + oapi_val); 
    178178                } 
    179                  
    180             } 
    181              
     179 
     180            } 
     181 
    182182            of.finishInitializing(); 
    183              
    184         } 
    185          
     183 
     184        } 
     185 
    186186        } 
    187187        return null; 
     
    195195    @Override 
    196196    public Boolean forComponent(Component x) { 
    197         List<? extends AbsDeclOrDecl> defs = x.getDecls(); 
     197        List<Decl> defs = x.getDecls(); 
    198198        switch (getPass()) { 
    199199        case 1: forComponent1(x); break; 
    200200 
    201         case 2: doDefs(this, defs);  
     201        case 2: doDefs(this, defs); 
    202202        break; 
    203203        case 3: { 
    204204            ForceTraitFinish v = new ForceTraitFinish() ; 
    205             for (AbsDeclOrDecl def : defs) { 
     205            for (Decl def : defs) { 
    206206                v.visit(def); 
    207207            } 
     
    214214 
    215215    public Boolean forComponentDefs(Component x) { 
    216         List<? extends AbsDeclOrDecl> defs = x.getDecls(); 
     216        List<Decl> defs = x.getDecls(); 
    217217        doDefs(this, defs); 
    218218        return null; 
     
    223223        List<Import> imports = x.getImports(); 
    224224        // List<Export> exports = x.getExports(); 
    225         List<? extends AbsDeclOrDecl> defs = x.getDecls(); 
     225        List<Decl> defs = x.getDecls(); 
    226226 
    227227        // SComponent comp = new SComponent(BetterEnv.primitive(x), x); 
     
    229229 
    230230        forComponentDefs(x); 
    231          
     231 
    232232        for (Import imp : imports) { 
    233233            imp.accept(this); 
     
    280280        } 
    281281 
    282         void visit(AbsDeclOrDecl def) { 
     282        void visit(Decl def) { 
    283283            def.accept(this); 
    284284        } 
    285285    } 
    286      
     286 
    287287    public void setExporterAndApi(CUWrapper exporter, CUWrapper api) { 
    288288        bug("Can only set exporter of API environment builder."); 
    289289    } 
    290      
     290 
    291291 
    292292} 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTraitOrObject.java

    r3077 r3093  
    3737import com.sun.fortress.interpreter.evaluator.values.Overload; 
    3838import com.sun.fortress.interpreter.evaluator.values.OverloadedFunction; 
    39 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     39import com.sun.fortress.nodes.Decl; 
    4040import com.sun.fortress.nodes.AbstractNode; 
    4141import com.sun.fortress.nodes.FnDecl; 
     
    225225    } 
    226226 
    227     public FTraitOrObject(String name, Environment env, HasAt at, List<? extends AbsDeclOrDecl> members, AbstractNode def) { 
     227    public FTraitOrObject(String name, Environment env, HasAt at, List<Decl> members, AbstractNode def) { 
    228228        super(name, env, def); 
    229229        this.members = members; 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTraitOrObjectOrGeneric.java

    r2969 r3093  
    2828import com.sun.fortress.interpreter.evaluator.values.FunctionalMethod; 
    2929import com.sun.fortress.interpreter.evaluator.values.GenericFunctionalMethod; 
    30 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     30import com.sun.fortress.nodes.Decl; 
    3131import com.sun.fortress.nodes.AbstractNode; 
    3232import com.sun.fortress.nodes.FnAbsDeclOrDecl; 
     
    5555    } 
    5656 
    57     List<? extends AbsDeclOrDecl> members; 
     57    List<Decl> members; 
    5858 
    5959    Environment env; 
     
    6969    } 
    7070 
    71     public List<? extends AbsDeclOrDecl> getASTmembers() { 
     71    public List<Decl> getASTmembers() { 
    7272        return members; 
    7373    } 
     
    9090            return; 
    9191        FTraitOrObjectOrGeneric x = this; 
    92         // List<? extends AbsDeclOrDecl> defs = members; 
     92        // List<Decl> defs = members; 
    9393 
    9494        SortedSet<FnAbsDeclOrDecl> defs = Useful 
    95                 .<AbsDeclOrDecl, FnAbsDeclOrDecl> filteredSortedSet(members, 
    96                         new Fn<AbsDeclOrDecl, FnAbsDeclOrDecl>() { 
     95                .<Decl, FnAbsDeclOrDecl> filteredSortedSet(members, 
     96                        new Fn<Decl, FnAbsDeclOrDecl>() { 
    9797                            @Override 
    98                             public FnAbsDeclOrDecl apply(AbsDeclOrDecl x) { 
     98                            public FnAbsDeclOrDecl apply(Decl x) { 
    9999                                if (x instanceof FnAbsDeclOrDecl) 
    100100                                    return (FnAbsDeclOrDecl) x; 
     
    163163 
    164164        topLevel = topLevel.getTopLevel(); 
    165          
    166         List<? extends AbsDeclOrDecl> defs = members; 
    167165 
    168         for (AbsDeclOrDecl dod : defs) { 
     166        List<Decl> defs = members; 
     167 
     168        for (Decl dod : defs) { 
    169169            // Filter out non-functions. 
    170170            if (dod instanceof FnAbsDeclOrDecl) { 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeGeneric.java

    r3071 r3093  
    3232import com.sun.fortress.interpreter.evaluator.InstantiationLock; 
    3333import com.sun.fortress.interpreter.rewrite.OprInstantiaterVisitor; 
    34 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     34import com.sun.fortress.nodes.Decl; 
    3535import com.sun.fortress.nodes.AbstractNode; 
    3636import com.sun.fortress.nodes.BoolParam; 
     
    9292        pendingFunctionalMethodFinishes = new ArrayList<FTraitOrObjectOrGeneric>(); 
    9393    } 
    94      
     94 
    9595    private final Generic def; 
    9696    private final FTypeGeneric original; 
    9797 
    98     public FTypeGeneric(Environment e, Generic d, List<? extends AbsDeclOrDecl> members, AbstractNode decl) { 
     98    public FTypeGeneric(Environment e, Generic d, List<Decl> members, AbstractNode decl) { 
    9999        super(NodeUtil.stringName(d), e, decl); 
    100100        def = d; 
     
    346346            rval = bug( within, errorMsg("The use of generic type is " + 
    347347                        "found at unexpected place; it needs to be either " + 
    348                         "within a trait, an object, or an object " +  
     348                        "within a trait, an object, or an object " + 
    349349                        "expression type, but found: " + gen.def) ); 
    350350       } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeObject.java

    r3082 r3093  
    2626import com.sun.fortress.interpreter.evaluator.BuildObjectEnvironment; 
    2727import com.sun.fortress.interpreter.evaluator.Environment; 
    28 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     28import com.sun.fortress.nodes.Decl; 
    2929import com.sun.fortress.nodes.AbstractNode; 
    3030import com.sun.fortress.nodes.FnAbsDeclOrDecl; 
     
    6161    public FTypeObject(String name, Environment env, HasAt at, 
    6262                       Option<List<Param>> params, 
    63                        List<? extends AbsDeclOrDecl> members, AbstractNode def) { 
     63                       List<Decl> members, AbstractNode def) { 
    6464        super(name, env, at, members, def); 
    6565        this.declaredMembersOf = new BetterEnv(at); 
    66         for(AbsDeclOrDecl v : members) { 
     66        for(Decl v : members) { 
    6767            if (v instanceof VarAbsDeclOrDecl) { 
    6868                for (LValue lhs : ((VarAbsDeclOrDecl)v).getLhs()) { 
     
    109109               return; 
    110110        BetterEnv into = getMembersInternal(); 
    111          List<? extends AbsDeclOrDecl> defs = getASTmembers(); 
     111         List<Decl> defs = getASTmembers(); 
    112112 
    113113        /* The parameters to BuildObjectEnvironment are 
     
    124124 
    125125        // This is a minor hack to deal with messed-up object environments. 
    126         for(AbsDeclOrDecl v : members) { 
     126        for(Decl v : members) { 
    127127            if (v instanceof FnAbsDeclOrDecl) { 
    128128                String s = NodeUtil.nameAsMethod((FnAbsDeclOrDecl)v);//.getName().stringName(); 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeObjectInstance.java

    r2973 r3093  
    2222 
    2323import com.sun.fortress.interpreter.evaluator.Environment; 
    24 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     24import com.sun.fortress.nodes.Decl; 
    2525import com.sun.fortress.nodes.Param; 
    2626import com.sun.fortress.nodes.Type; 
     
    3737                               List<FType> bind_args, List<FType> name_args, 
    3838                               Option<List<Param>> params, 
    39                                List<? extends AbsDeclOrDecl> members) { 
     39                               List<Decl> members) { 
    4040        super(name, interior, interior.getAt(), params, members, generic.getDecl()); 
    4141        this.generic = generic; 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTop.java

    r1895 r3093  
    2525 
    2626import com.sun.fortress.interpreter.env.BetterEnv; 
    27 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     27import com.sun.fortress.nodes.Decl; 
    2828import com.sun.fortress.useful.HasAt; 
    2929import com.sun.fortress.useful.Useful; 
     
    3636    private FTypeTop() { 
    3737        super("Any",BetterEnv.blessedEmpty(),new HasAt.FromString("Built in"), 
    38                 Collections.<AbsDeclOrDecl>emptyList(), null); // HACK need a token here. 
     38                Collections.<Decl>emptyList(), null); // HACK need a token here. 
    3939        membersInitialized = true; 
    4040    } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTrait.java

    r2767 r3093  
    2727import com.sun.fortress.interpreter.evaluator.BuildTraitEnvironment; 
    2828import com.sun.fortress.interpreter.evaluator.Environment; 
    29 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     29import com.sun.fortress.nodes.Decl; 
    3030import com.sun.fortress.nodes.AbstractNode; 
    3131import com.sun.fortress.useful.BASet; 
     
    4949    protected volatile Set<FType> transitiveComprises; 
    5050 
    51     public FTypeTrait(String name, Environment interior, HasAt at, List<? extends AbsDeclOrDecl> members, AbstractNode decl) { 
     51    public FTypeTrait(String name, Environment interior, HasAt at, List<Decl> members, AbstractNode decl) { 
    5252        super(name, interior, at, members, decl); 
    5353        this.declaredMembersOf = new BetterEnv(at); 
     
    103103        Environment into = getMembersInternal(); 
    104104        Environment forTraitMethods = getMethodExecutionEnv(); 
    105         List<? extends AbsDeclOrDecl> defs = getASTmembers(); 
     105        List<Decl> defs = getASTmembers(); 
    106106 
    107107        BuildTraitEnvironment inner = new BuildTraitEnvironment(into, 
     
    126126        return declaredMembersOf; 
    127127    } 
    128   
     128 
    129129} 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTraitInstance.java

    r2984 r3093  
    2222 
    2323import com.sun.fortress.interpreter.evaluator.Environment; 
    24 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     24import com.sun.fortress.nodes.Decl; 
    2525import com.sun.fortress.nodes.Type; 
    2626import com.sun.fortress.useful.BoundingMap; 
     
    4747    public FTypeTraitInstance(String name, Environment interior, 
    4848            FTypeGeneric generic, List<FType> bind_args, List<FType> name_args, 
    49             List<? extends AbsDeclOrDecl> members) { 
     49            List<Decl> members) { 
    5050        super(name, interior, interior.getAt(), members, generic.getDecl()); 
    5151        this.generic = generic; 
     
    6767                throw new Error("Badly layered environment"); 
    6868            } 
    69              
     69 
    7070        } 
    7171    } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicInstantiatedType.java

    r1826 r3093  
    2121 
    2222import com.sun.fortress.interpreter.evaluator.Environment; 
    23 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     23import com.sun.fortress.nodes.Decl; 
    2424import com.sun.fortress.nodes.AbstractNode; 
    2525 
     
    3131     */ 
    3232    public SymbolicInstantiatedType(String name, Environment interior, AbstractNode decl) { 
    33         super(name, interior, Collections.<AbsDeclOrDecl>emptyList(), decl); 
     33        super(name, interior, Collections.<Decl>emptyList(), decl); 
    3434        isSymbolic = true; 
    3535    } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicOprType.java

    r1826 r3093  
    2020 
    2121import com.sun.fortress.interpreter.evaluator.Environment; 
    22 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     22import com.sun.fortress.nodes.Decl; 
    2323import com.sun.fortress.nodes.AbstractNode; 
    2424 
     
    2626 
    2727    public SymbolicOprType(String name, Environment interior, AbstractNode decl) { 
    28         super(name, interior, Collections.<AbsDeclOrDecl>emptyList(), decl); 
     28        super(name, interior, Collections.<Decl>emptyList(), decl); 
    2929        isSymbolic = true; 
    3030    } 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicType.java

    r1895 r3093  
    2828import com.sun.fortress.interpreter.evaluator.Environment; 
    2929import com.sun.fortress.interpreter.evaluator.values.FValue; 
    30 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     30import com.sun.fortress.nodes.Decl; 
    3131import com.sun.fortress.nodes.AbstractNode; 
    3232 
     
    4242    } 
    4343 
    44     public SymbolicType(String name, Environment interior, List<? extends AbsDeclOrDecl> members, AbstractNode decl) { 
     44    public SymbolicType(String name, Environment interior, List<Decl> members, AbstractNode decl) { 
    4545        super(name, interior, interior.getAt(), members, decl); 
    4646        membersInitialized = true; 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicWhereType.java

    r1826 r3093  
    2222 
    2323import com.sun.fortress.interpreter.evaluator.Environment; 
    24 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     24import com.sun.fortress.nodes.Decl; 
    2525import com.sun.fortress.nodes.AbstractNode; 
    2626import com.sun.fortress.useful.NI; 
     
    3333     */ 
    3434    public SymbolicWhereType(String name, Environment interior, AbstractNode decl) { 
    35         super(name, interior, Collections.<AbsDeclOrDecl>emptyList(), decl); 
     35        super(name, interior, Collections.<Decl>emptyList(), decl); 
    3636        NI.nyi("Where clauses cause a stack overflow error"); 
    3737        // TODO Auto-generated constructor stub 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/values/Constructor.java

    r3077 r3093  
    4141import com.sun.fortress.interpreter.glue.NativeApp; 
    4242import com.sun.fortress.interpreter.glue.WellKnownNames; 
    43 import com.sun.fortress.nodes.AbsDeclOrDecl; 
     43import com.sun.fortress.nodes.Decl; 
    4444import com.sun.fortress.nodes.FnDecl; 
    4545import com.sun.fortress.nodes.GenericWithParams; 
     
    7979 
    8080    IdOrOpOrAnonymousName cfn; 
    81     List<? extends AbsDeclOrDecl> defs; 
     81    List<Decl> defs; 
    8282    Option<List<Param>> params; 
    8383 
     
    174174 
    175175    public Constructor(Environment env, FTypeObject selfType, HasAt def, 
    176                 IdOrOpOrAnonymousName name, List<? extends AbsDeclOrDecl> defs, 
     176                IdOrOpOrAnonymousName name, List<Decl> defs, 
    177177                Option<List<Param>> params) { 
    178178        super(env); // TODO verify that this is the proper env. 
  • trunk/ProjectFortress/src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java

    r3089 r3093  
    4646import com.sun.fortress.nodes_util.Span; 
    4747import com.sun.fortress.nodes.APIName; 
    48 import com.sun.fortress.nodes.AbsDecl; 
    49 import com.sun.fortress.nodes.AbsDeclOrDecl; 
    5048import com.sun.fortress.nodes.AbsFnDecl; 
    5149import com.sun.fortress.nodes.AbsTraitDecl; 
     
    273271        return rewrites.put(k, d); 
    274272    } 
    275      
     273 
    276274    public Thing obj_rewrites_put(String k, Thing d) { 
    277275        return rewrites.put(k, d); 
    278276    } 
    279      
     277 
    280278    public Thing rewrites_put(String k, Thing d) { 
    281279        return rewrites.put(k, d); 
    282280    } 
    283      
     281 
    284282    public Thing type_rewrites_put(String k, Thing d) { 
    285283        return rewrites.put(k, d); 
     
    491489            // circular dependences between type names. See above. 
    492490            Component com = (Component) tlnode; 
    493             List<? extends AbsDeclOrDecl> defs = com.getDecls(); 
     491            List<Decl> defs = com.getDecls(); 
    494492            defsToLocals(defs); 
    495493            functionalMethodsOfDefsToLocals(defs); 
     
    500498            // circular dependences between type names. See above. 
    501499            Api com = (Api) tlnode; 
    502             List<? extends AbsDeclOrDecl> defs = com.getDecls(); 
     500            List<Decl> defs = com.getDecls(); 
    503501            defsToLocals(defs); 
    504502            functionalMethodsOfDefsToLocals(defs); 
     
    664662    @Override 
    665663    public Node forComponent(Component com) { 
    666         List<? extends AbsDeclOrDecl> defs = com.getDecls(); 
     664        List<Decl> defs = com.getDecls(); 
    667665        defsToLocals(defs); 
    668666 
     
    701699    @Override 
    702700    public Node forApi(Api com) { 
    703         List<? extends AbsDeclOrDecl> defs = com.getDecls(); 
     701        List<Decl> defs = com.getDecls(); 
    704702        defsToLocals(defs); 
    705703        return visitNode(com); 
     
    804802            boolean change = false; 
    805803            List<WhereBinding> lwb = wc.getBindings(); 
    806              
     804 
    807805            for (WhereBinding wb : lwb) { 
    808806                type_rewrites_put(wb.getName().getText(), new Local()); 
    809807            } 
    810              
     808 
    811809            /* Handcoded visit to avoid a "recur" visit on the WhereClause 
    812810              The binding action of a WhereClause in a TraitTypeWhere seems 
    813811              to be different. 
    814812            */ 
    815              
     813 
    816814            WhereClause nwc = (WhereClause) visitNode(wc); 
    817815            BaseType t = vre.getType(); 
     
    824822            return visitNode(vre); 
    825823        } 
    826          
    827          
     824 
     825 
    828826    } 
    829827 
     
    831829  public Node forWhereClause(WhereClause wc) { 
    832830      lexicalNestingDepth++; 
    833        
     831 
    834832          List<WhereBinding> lwb = wc.getBindings(); 
    835833          for (WhereBinding wb : lwb) { 
    836834              type_rewrites_put(wb.getName().getText(), new Local()); 
    837835          } 
    838        
     836 
    839837      return visitNode(wc); 
    840838  } 
     
    966964 
    967965 
    968     
     966 
    969967 
    970968    @Override 
    971969    public Node for_RewriteObjectExpr(_RewriteObjectExpr oe) { 
    972         List<? extends AbsDeclOrDecl> defs = oe.getDecls(); 
     970        List<Decl> defs = oe.getDecls(); 
    973971        List<BaseType> xtends = NodeUtil.getTypes(oe.getExtendsClause()); 
    974972        objectNestingDepth++; 
     
    980978        return n; 
    981979    } 
    982      
     980 
    983981    @Override 
    984982    public Node forObjectExpr(ObjectExpr oe) { 
     
    10161014        lexicalNestingDepth++; 
    10171015        // defined var is no longer eligible for rewrite. 
    1018         List<FnDecl> defs = lf.getFns(); 
     1016        List<Decl> defs = new ArrayList<Decl>(); 
     1017        for (FnDecl d : lf.getFns()) { 
     1018            defs.add((Decl)d); 
     1019        } 
    10191020        defsToLocals(defs); 
    10201021        // All the function names are in scope in the function 
     
    10441045        // extended traits 
    10451046        // are mapped to "self". 
    1046         List<? extends AbsDeclOrDecl> defs = od.getDecls(); 
     1047        List<Decl> defs = od.getDecls(); 
    10471048        Option<List<Param>> params = od.getParams(); 
    10481049        List<StaticParam> tparams = od.getStaticParams(); 
     
    10671068    @Override 
    10681069    public Node forAbsTraitDecl(AbsTraitDecl td) { 
    1069         List<? extends AbsDecl> defs = td.getDecls(); 
     1070        List<Decl> defs = td.getDecls(); 
    10701071        List<StaticParam> tparams = td.getStaticParams(); 
    10711072        // TODO wip 
     
    10861087    @Override 
    10871088    public Node forTraitDecl(TraitDecl td) { 
    1088         List<? extends Decl> defs = td.getDecls(); 
     1089        List<Decl> defs = td.getDecls(); 
    10891090        List<StaticParam> tparams = td.getStaticParams(); 
    10901091        // TODO wip 
     
    13331334     * @param defs 
    13341335     */ 
    1335     private void defsToLocals(List<? extends AbsDeclOrDecl> defs) { 
    1336         for (AbsDeclOrDecl d : defs) { 
     1336    private void defsToLocals(List<Decl> defs) { 
     1337        for (Decl d : defs) { 
    13371338            if (d instanceof TraitAbsDeclOrDecl) { 
    13381339                String s = d.stringName(); 
     
    13671368     * @param defs 
    13681369     */ 
    1369     private void functionalMethodsOfDefsToLocals(List<? extends AbsDeclOrDecl> defs) { 
    1370         for (AbsDeclOrDecl d : defs) { 
     1370    private void functionalMethodsOfDefsToLocals(List<Decl> defs) { 
     1371        for (Decl d : defs) { 
    13711372            if (d instanceof TraitObjectAbsDeclOrDecl) { 
    13721373                TraitObjectAbsDeclOrDecl dod = (TraitObjectAbsDeclOrDecl) d; 
    1373                 List <? extends AbsDeclOrDecl> tdecls = dod.getDecls(); 
     1374                List <Decl> tdecls = dod.getDecls(); 
    13741375                handlePossibleFM(tdecls); 
    13751376            } else { 
     
    13791380    } 
    13801381 
    1381     private void handlePossibleFM(List<? extends AbsDeclOrDecl> tdecls) { 
    1382         for (AbsDeclOrDecl adod : tdecls) { 
     1382    private void handlePossibleFM(List<Decl> tdecls) { 
     1383        for (Decl adod : tdecls) { 
    13831384            ArrowOrFunctional aof = adod.accept(IsAnArrowName.isAnArrowName); 
    13841385                if (aof == ArrowOrFunctional.FUNCTIONAL) { 
     
    14751476     * @param defs 
    14761477     */ 
    1477     private void defsToMembers(List<? extends AbsDeclOrDecl> defs) { 
    1478         for (AbsDeclOrDecl dd : defs) { 
     1478    private void defsToMembers(List<Decl> defs) { 
     1479        for (Decl dd : defs) { 
    14791480 
    14801481            if (dd instanceof VarDecl) { 
     
    16021603                            // types.add(s); // The trait is known by this 
    16031604                            // name. 
    1604                             for (AbsDeclOrDecl dd : tdod.getDecls()) { 
     1605                            for (Decl dd : tdod.getDecls()) { 
    16051606                                String sdd = dd.stringName(); 
    16061607                                if (dd instanceof VarDecl) { 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ApiMaker.java

    r3082 r3093  
    9090    } 
    9191 
    92     private List<AbsDecl> declsToAbsDecls(final List<Decl> that) { 
     92    private List<Decl> declsToDecls(final List<Decl> that) { 
    9393        boolean changed = false; 
    94         List<AbsDecl> result = new java.util.ArrayList<AbsDecl>(0); 
     94        List<Decl> result = new java.util.ArrayList<Decl>(0); 
    9595        for (Decl elt : that) { 
    9696            Option<Node> elt_result = elt.accept(this); 
    9797            if ( elt_result.isSome() ) 
    98                 result.add((AbsDecl)elt_result.unwrap()); 
     98                result.add((Decl)elt_result.unwrap()); 
    9999        } 
    100100        return result; 
     
    105105                              that.getName(), 
    106106                              that.getImports(), 
    107                               declsToAbsDecls(that.getDecls())); 
     107                              declsToDecls(that.getDecls())); 
    108108        try { 
    109109            writer.close(); 
     
    117117        if ( ! isPrivate(that) ) { 
    118118            inTrait = true; 
    119             List<AbsDecl> absDecls = declsToAbsDecls(that.getDecls()); 
     119            List<Decl> absDecls = declsToDecls(that.getDecls()); 
    120120            inTrait = false; 
    121121            return Option.<Node>some(new AbsTraitDecl(that.getSpan(), 
     
    134134        if ( ! isPrivate(that) ) { 
    135135            inObject = true; 
    136             List<AbsDecl> absDecls = declsToAbsDecls(that.getDecls()); 
     136            List<Decl> absDecls = declsToDecls(that.getDecls()); 
    137137            inObject = false; 
    138138            return Option.<Node>some(new AbsObjectDecl(that.getSpan(), 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeUtil.java

    r3082 r3093  
    425425    } 
    426426 
    427     public static IterableOnce<String> stringNames(AbsDeclOrDecl decl) { 
     427    public static IterableOnce<String> stringNames(Decl decl) { 
    428428        return decl.accept(new NodeAbstractVisitor<IterableOnce<String>>() { 
    429429            public IterableOnce<String> forDimDecl(DimDecl d) { 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Compilation.rats

    r3078 r3093  
    7171     } 
    7272   / a1:Imports w semicolon? a2:(w yyValue:AbsDecls w semicolon?)? 
    73      { if (a2 == null) a2 = Collections.<AbsDecl>emptyList(); 
     73     { if (a2 == null) a2 = Collections.<Decl>emptyList(); 
    7474       Span span = createSpan(yyStart,yyCount); 
    7575       String file = span.begin.getFileName(); 
     
    143143                                 " has the different name " + a4 + " at the end."); 
    144144       if (a2 == null) a2 = Collections.<Import>emptyList(); 
    145        if (a3 == null) a3 = Collections.<AbsDecl>emptyList(); 
     145       if (a3 == null) a3 = Collections.<Decl>emptyList(); 
    146146       yyValue = new Api(span, a1, a2, a3); 
    147147     }; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Declaration.rats

    r3012 r3093  
    5858 
    5959/* AbsDecls ::= AbsDecl (br AbsDecl)* */ 
    60 List<AbsDecl> AbsDecls = a1:AbsDecl a2s:(br AbsDecl)* 
    61      { for (List<AbsDecl> ds : a2s.list()) { 
     60List<Decl> AbsDecls = a1:AbsDecl a2s:(br AbsDecl)* 
     61     { for (List<Decl> ds : a2s.list()) { 
    6262         a1.addAll(ds); 
    6363       } 
     
    7676   | GrammarDef 
    7777 */ 
    78 List<AbsDecl> AbsDecl = 
    79      a1:AbsTraitDecl  { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
    80    / a1:AbsObjectDecl { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
    81    / a1:AbsVarDecl    { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
    82    / a1:AbsFnDecl     { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
     78List<Decl> AbsDecl = 
     79     a1:AbsTraitDecl  { yyValue = FortressUtil.mkList((Decl)a1); } 
     80   / a1:AbsObjectDecl { yyValue = FortressUtil.mkList((Decl)a1); } 
     81   / a1:AbsVarDecl    { yyValue = FortressUtil.mkList((Decl)a1); } 
     82   / a1:AbsFnDecl     { yyValue = FortressUtil.mkList((Decl)a1); } 
    8383   / DimUnitDecl 
    84    / a1:TypeAlias     { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
    85    / a1:TestDecl      { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
    86    / a1:PropertyDecl  { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
    87    / a1:GrammarDef    { yyValue = FortressUtil.mkList((AbsDecl)a1); } 
     84   / a1:TypeAlias     { yyValue = FortressUtil.mkList((Decl)a1); } 
     85   / a1:TestDecl      { yyValue = FortressUtil.mkList((Decl)a1); } 
     86   / a1:PropertyDecl  { yyValue = FortressUtil.mkList((Decl)a1); } 
     87   / a1:GrammarDef    { yyValue = FortressUtil.mkList((Decl)a1); } 
    8888   ; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Method.rats

    r3067 r3093  
    165165   coerce (w StaticParams)? w ( w BindId w IsType w ) CoercionClauses (w widens)? 
    166166 */ 
    167 AbsDecl AbsCoercion = 
     167Decl AbsCoercion = 
    168168     coerce a1:(w StaticParams)? w openparen w a2:BindId w a3:IsType w closeparen 
    169169     a4:CoercionClauses a5:(w widens)? 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/TraitObject.rats

    r3032 r3093  
    317317                                 " has the different name " + a5 + " at the end."); 
    318318       if (a1 == null) a1 = FortressUtil.emptyModifiers(); 
    319        if (a4 == null) a4 = Collections.<AbsDecl>emptyList(); 
     319       if (a4 == null) a4 = Collections.<Decl>emptyList(); 
    320320       yyValue = new AbsTraitDecl 
    321321           (span, a1, a2.getName(), 
     
    356356   | AbsCoercions 
    357357 */ 
    358 private List<AbsDecl> AbsGoInATrait = 
     358private List<Decl> AbsGoInATrait = 
    359359     a1:AbsCoercions 
    360      { yyValue = new ArrayList<AbsDecl>(); 
     360     { yyValue = new ArrayList<Decl>(); 
    361361       yyValue.addAll(a1); 
    362362     } 
     
    382382     } 
    383383   / a1:(AbsCoercions br)? a2:AbsGoFrontInATrait a3:(br AbsGoBackInATrait)? 
    384      { yyValue = new ArrayList<AbsDecl>(); 
     384     { yyValue = new ArrayList<Decl>(); 
    385385       if (a1 != null) yyValue.addAll(a1); 
    386386       yyValue.addAll(a2); 
     
    388388     } 
    389389   / a1:(AbsCoercions br)? a2:AbsGoBackInATrait 
    390      { yyValue = new ArrayList<AbsDecl>(); 
     390     { yyValue = new ArrayList<Decl>(); 
    391391       if (a1 != null) yyValue.addAll(a1); 
    392392       yyValue.addAll(a2); 
     
    394394 
    395395/* AbsCoercions ::= AbsCoercion (br AbsCoercion)* */ 
    396 private List<AbsDecl> AbsCoercions = a1:AbsCoercion a2s:(br AbsCoercion)* 
     396private List<Decl> AbsCoercions = a1:AbsCoercion a2s:(br AbsCoercion)* 
    397397     { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 
    398398 
    399399/* AbsGoFrontInATrait ::= AbsGoesFrontInATrait (br AbsGoesFrontInATrait)* */ 
    400 private List<AbsDecl> AbsGoFrontInATrait = 
     400private List<Decl> AbsGoFrontInATrait = 
    401401     a1:AbsGoesFrontInATrait a2s:(br AbsGoesFrontInATrait)* 
    402402     { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 
    403403 
    404404/* AbsGoesFrontInATrait ::= ApiFldDecl | AbsGetterSetterDecl | PropertyDecl */ 
    405 private AbsDecl AbsGoesFrontInATrait = 
     405private Decl AbsGoesFrontInATrait = 
    406406     ApiFldDecl 
    407407   / AbsGetterSetterDecl 
     
    409409 
    410410/* AbsGoBackInATrait ::= AbsGoesBackInATrait (br AbsGoesBackInATrait)* */ 
    411 private List<AbsDecl> AbsGoBackInATrait = 
     411private List<Decl> AbsGoBackInATrait = 
    412412     a1:AbsGoesBackInATrait a2s:(br AbsGoesBackInATrait)* 
    413413     { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 
    414414 
    415415/* AbsGoesBackInATrait ::= AbsMdDecl | PropertyDecl */ 
    416 private AbsDecl AbsGoesBackInATrait = 
     416private Decl AbsGoesBackInATrait = 
    417417     AbsMdDecl 
    418418   / PropertyDecl ; 
     
    429429                                 " has the different name " + a4 + " at the end."); 
    430430       if (a1 == null) a1 = FortressUtil.emptyModifiers(); 
    431        if (a3 == null) a3 = Collections.<AbsDecl>emptyList(); 
     431       if (a3 == null) a3 = Collections.<Decl>emptyList(); 
    432432       FnHeaderClause fhc = a2.getFnHeaderClause(); 
    433433       Option<Contract> contract = fhc.getContractClause(); 
     
    445445   | AbsCoercions 
    446446 */ 
    447 List<AbsDecl> AbsGoInAnObject = 
     447List<Decl> AbsGoInAnObject = 
    448448     a1:AbsCoercions 
    449      { yyValue = new ArrayList<AbsDecl>(); 
     449     { yyValue = new ArrayList<Decl>(); 
    450450       yyValue.addAll(a1); 
    451451     } 
     
    471471     } 
    472472   / a1:(AbsCoercions br)? a2:AbsGoFrontInAnObject a3:(br AbsGoBackInAnObject)? 
    473      { yyValue = new ArrayList<AbsDecl>(); 
     473     { yyValue = new ArrayList<Decl>(); 
    474474       if (a1 != null) yyValue.addAll(a1); 
    475475       yyValue.addAll(a2); 
     
    477477     } 
    478478   / a1:(AbsCoercions br)? a2:AbsGoBackInAnObject 
    479      { yyValue = new ArrayList<AbsDecl>(); 
     479     { yyValue = new ArrayList<Decl>(); 
    480480       if (a1 != null) yyValue.addAll(a1); 
    481481       yyValue.addAll(a2); 
     
    485485     AbsGoesFrontInAnObject (br AbsGoesFrontInAnObject)* 
    486486 */ 
    487 private List<AbsDecl> AbsGoFrontInAnObject = 
     487private List<Decl> AbsGoFrontInAnObject = 
    488488     a1:AbsGoesFrontInAnObject a2s:(br AbsGoesFrontInAnObject)* 
    489489     { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 
    490490 
    491491/* AbsGoesFrontInAnObject ::= ApiFldDecl | AbsGetterSetterDecl | PropertyDecl */ 
    492 private AbsDecl AbsGoesFrontInAnObject = 
     492private Decl AbsGoesFrontInAnObject = 
    493493     ApiFldDecl 
    494494   / AbsGetterSetterDecl 
     
    496496 
    497497/* AbsGoBackInAnObject ::= AbsGoesBackInAnObject (br AbsGoesBackInAnObject)* */ 
    498 private List<AbsDecl> AbsGoBackInAnObject = 
     498private List<Decl> AbsGoBackInAnObject = 
    499499     a1:AbsGoesBackInAnObject a2s:(br AbsGoesBackInAnObject)* 
    500500     { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 
    501501 
    502502/* AbsGoesBackInAnObject ::= AbsMdDecl | PropertyDecl */ 
    503 private AbsDecl AbsGoesBackInAnObject = 
     503private Decl AbsGoesBackInAnObject = 
    504504     AbsMdDecl 
    505505   / PropertyDecl ; 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/preparser/PreCompilation.rats

    r3078 r3093  
    5050   / w a1:Imports w semicolon? w (_)* 
    5151     { if (a1 == null) a1 = Collections.<Import>emptyList(); 
    52        List<AbsDecl> a2 = Collections.<AbsDecl>emptyList(); 
     52       List<Decl> a2 = Collections.<Decl>emptyList(); 
    5353       Span span = createSpan(yyStart,yyCount); 
    5454       String file = span.begin.getFileName(); 
     
    6969       APIName name = NodeFactory.makeAPINameFromPath(span, file, "\\."); 
    7070       yyValue = new Api(span, name, Collections.<Import>emptyList(), 
    71                          Collections.<AbsDecl>emptyList()); 
     71                         Collections.<Decl>emptyList()); 
    7272     }; 
    7373 
     
    109109   / api w a1:APIName a2:(w yyValue:Imports w semicolon?)? w (_)* 
    110110     { if (a2 == null) a2 = Collections.<Import>emptyList(); 
    111        List<AbsDecl> a3 = Collections.<AbsDecl>emptyList(); 
     111       List<Decl> a3 = Collections.<Decl>emptyList(); 
    112112       Span span = createSpan(yyStart,yyCount); 
    113113       yyValue = new Api(span, a1, a2, a3); 
  • trunk/ProjectFortress/src/com/sun/fortress/tools/FortressAstToConcrete.java

    r3092 r3093  
    418418    } 
    419419 
    420     public List<String> myRecurOnListOfAbsDecl(List<AbsDecl> that) { 
     420    public List<String> myRecurOnListOfDecl(List<Decl> that) { 
    421421        boolean sawField = false; 
    422422        boolean sawGetterSetter = false; 
    423423        List<String> accum = new java.util.ArrayList<String>(that.size()); 
    424         for (AbsDecl elt : that) { 
     424        for (Decl elt : that) { 
    425425            if ( elt instanceof AbsVarDecl ) { 
    426426                sawField = true; 
     
    452452        List<String> excludes_result = recurOnListOfBaseType(that.getExcludes()); 
    453453        Option<List<String>> comprises_result = recurOnOptionOfListOfBaseType(that.getComprises()); 
    454         List<String> decls_result = myRecurOnListOfAbsDecl(that.getDecls()); 
     454        List<String> decls_result = myRecurOnListOfDecl(that.getDecls()); 
    455455        return forAbsTraitDeclOnly(that, mods_result, name_result, 
    456456                                   staticParams_result, extendsClause_result, 
     
    544544        Option<List<String>> throwsClause_result = recurOnOptionOfListOfBaseType(that.getThrowsClause()); 
    545545        Option<String> contract_result = recurOnOptionOfContract(that.getContract()); 
    546         List<String> decls_result = myRecurOnListOfAbsDecl(that.getDecls()); 
     546        List<String> decls_result = myRecurOnListOfDecl(that.getDecls()); 
    547547        return forAbsObjectDeclOnly(that, mods_result, name_result, 
    548548                                    staticParams_result, extendsClause_result,