Changeset 3098

Show
Ignore:
Timestamp:
11/25/08 04:49:00 (12 months ago)
Author:
sukyoungryu
Message:

[ast refactoring] Reshuffled some node fields: TraitDecl? and ObjectDecl?

Location:
trunk/ProjectFortress
Files:
13 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/astgen/Fortress.ast

    r3097 r3098  
    132132     */ 
    133133    abstract AbstractNode() extends UIDObject; 
    134  
    135  
    136134        /** 
    137135         * compilation unit declaration 
     
    139137         */ 
    140138        abstract CompilationUnit(APIName name, List<Import> imports); 
    141  
    142  
    143139            /** 
    144140             * component declaration 
     
    273269                TraitDecl(List<BaseType> excludes = Collections.<BaseType>emptyList(), 
    274270                          Option<List<BaseType>> comprises 
    275                               = Option.<List<BaseType>>none(), 
    276                           List<Decl> decls) implements GenericDecl; 
     271                              = Option.<List<BaseType>>none()) implements GenericDecl; 
    277272                /** 
    278273                 * object declaration in components or APIs 
     
    317312                           Option<List<BaseType>> throwsClause 
    318313                               = Option.<List<BaseType>>none(), 
    319                            Option<Contract> contract = Option.<Contract>none(), 
    320                            List<Decl> decls) 
     314                           Option<Contract> contract = Option.<Contract>none()) 
    321315                          implements GenericDeclWithParams; 
    322316            /** 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/DesugaringVisitor.java

    r3095 r3098  
    578578        return forObjectDeclOnly(that, that.getMods(), that.getName(), 
    579579                                 that.getStaticParams(), that.getExtendsClause(), 
    580                                  that.getWhere(), params_result, 
    581                                  that.getThrowsClause(), contract_result, 
    582                                  gettersAndDecls); 
     580                                 that.getWhere(), gettersAndDecls, params_result, 
     581                                 that.getThrowsClause(), contract_result); 
    583582    } 
    584583 
     
    601600        return forTraitDeclOnly(that, that.getMods(), that.getName(), 
    602601                                that.getStaticParams(), that.getExtendsClause(), 
    603                                 that.getWhere(), that.getExcludes(), 
    604                                 that.getComprises(), gettersAndDecls); 
     602                                that.getWhere(), gettersAndDecls, 
     603                                that.getExcludes(), that.getComprises()); 
    605604    } 
    606605 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/DottedMethodRewriteVisitor.java

    r2550 r3098  
    5252                                       that.getStaticParams(), 
    5353                                       that.getExtendsClause(), that.getWhere(), 
    54                                        that.getParams(), that.getThrowsClause(), 
    55                                        that.getContract(), decls_result); 
     54                                       decls_result, that.getParams(), 
     55                                       that.getThrowsClause(), that.getContract()); 
    5656    } 
    5757 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/MutableVarRefRewriteVisitor.java

    r3082 r3098  
    9191                                       that.getStaticParams(), 
    9292                                       that.getExtendsClause(), that.getWhere(), 
    93                                        that.getParams(), that.getThrowsClause(), 
    94                                        that.getContract(), decls_result); 
     93                                       decls_result, that.getParams(), 
     94                                       that.getThrowsClause(), that.getContract()); 
    9595    } 
    9696 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/ObjectExpressionVisitor.java

    r3082 r3098  
    657657        ObjectDecl lifted = new ObjectDecl(span, liftedObjId, staticParams, 
    658658                                           extendsClauses, 
    659                                            Option.<WhereClause>none(), 
    660                                            params, decls); 
     659                                           Option.<WhereClause>none(), decls, 
     660                                           params); 
    661661 
    662662        if(enclosingSelf != null) { 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/PreDisambiguationDesugaringVisitor.java

    r3096 r3098  
    8181                                     List<TraitTypeWhere> extendsClause, 
    8282                                     Option<WhereClause> where, 
     83                                     List<Decl> decls, 
    8384                                     List<BaseType> excludes, 
    84                                      Option<List<BaseType>> comprises, 
    85                                      List<Decl> decls) { 
     85                                     Option<List<BaseType>> comprises) { 
    8686        if (!that.getName().equals(anyTypeId)) { 
    8787            extendsClause = rewriteExtendsClause(that, extendsClause); 
    8888        } 
    8989        return super.forTraitDeclOnly(that, mods, name, staticParams, extendsClause, 
    90                                       where, excludes, comprises, decls); 
     90                                      where, decls, excludes, comprises); 
    9191    } 
    9292 
     
    9898                                      List<TraitTypeWhere> extendsClause, 
    9999                                      Option<WhereClause> where, 
     100                                      List<Decl> decls, 
    100101                                      Option<List<Param>> params, 
    101102                                      Option<List<BaseType>> throwsClause, 
    102                                       Option<Contract> contract, 
    103                                       List<Decl> decls) { 
     103                                      Option<Contract> contract) { 
    104104        extendsClause = rewriteExtendsClause(that, extendsClause); 
    105105        return super.forObjectDeclOnly(that, mods, name, staticParams, extendsClause, 
    106                                        where, params, throwsClause, contract, decls); 
     106                                       where, decls, params, throwsClause, contract); 
    107107    } 
    108108 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/VarRefContainer.java

    r3094 r3098  
    100100                            Collections.<TraitTypeWhere>emptyList(), 
    101101                            Option.<WhereClause>none(), 
    102                             Option.<List<Param>>some(params), 
    103                             Collections.<Decl>emptyList() ); 
     102                            Collections.<Decl>emptyList(), 
     103                            Option.<List<Param>>some(params) ); 
    104104 
    105105        return container; 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/ExprDisambiguator.java

    r3096 r3098  
    671671                                extendsClause, 
    672672                                v.recurOnOptionOfWhereClause(that.getWhere()), 
     673                                v.recurOnListOfDecl(that.getDecls()), 
    673674                                v.recurOnListOfBaseType(that.getExcludes()), 
    674                                 v.recurOnOptionOfListOfBaseType(that.getComprises()), 
    675                                 v.recurOnListOfDecl(that.getDecls())); 
     675                                v.recurOnOptionOfListOfBaseType(that.getComprises())); 
    676676    } 
    677677 
     
    719719                                 extendsClause, 
    720720                                 v.recurOnOptionOfWhereClause(that.getWhere()), 
     721                                 v.recurOnListOfDecl(that.getDecls()), 
    721722                                 v.recurOnOptionOfListOfParam(that.getParams()), 
    722723                                 v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 
    723                                  v.recurOnOptionOfContract(that.getContract()), 
    724                                  v.recurOnListOfDecl(that.getDecls())); 
     724                                 v.recurOnOptionOfContract(that.getContract())); 
    725725    } 
    726726 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java

    r3096 r3098  
    143143                v.recurOnListOfTraitTypeWhere(that.getExtendsClause()), 
    144144                v.recurOnOptionOfWhereClause(that.getWhere()), 
     145                v.recurOnListOfDecl(that.getDecls()), 
    145146                v.recurOnListOfBaseType(that.getExcludes()), 
    146                 v.recurOnOptionOfListOfBaseType(that.getComprises()), 
    147                 v.recurOnListOfDecl(that.getDecls())); 
     147                v.recurOnOptionOfListOfBaseType(that.getComprises())); 
    148148    } 
    149149 
     
    161161                v.recurOnListOfTraitTypeWhere(that.getExtendsClause()), 
    162162                v.recurOnOptionOfWhereClause(that.getWhere()), 
     163                v.recurOnListOfDecl(that.getDecls()), 
    163164                v.recurOnOptionOfListOfParam(that.getParams()), 
    164165                v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 
    165                 v.recurOnOptionOfContract(that.getContract()), 
    166                 v.recurOnListOfDecl(that.getDecls())); 
     166                v.recurOnOptionOfContract(that.getContract())); 
    167167    } 
    168168 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeChecker.java

    r3095 r3098  
    34433443                                (List<TraitTypeWhere>)TypeCheckerResult.astFromResults(extendsClauseResult), 
    34443444                                where, 
     3445                                (List<Decl>)TypeCheckerResult.astFromResults(decls_result), 
    34453446                                (Option<List<Param>>)TypeCheckerResult.astFromResults(paramsResult), 
    34463447                                (Option<List<BaseType>>)TypeCheckerResult.astFromResults(throwsClauseResult), 
    3447                                 contract, 
    3448                                 (List<Decl>)TypeCheckerResult.astFromResults(decls_result)); 
     3448                                contract); 
    34493449 
    34503450                return TypeCheckerResult.compose(new_node, checker_with_sparams.subtypeChecker, 
     
    40064006                                        (List<TraitTypeWhere>)TypeCheckerResult.astFromResults(extendsClauseResult), 
    40074007                                        where, 
     4008                                        (List<Decl>)TypeCheckerResult.astFromResults(decls_result), 
    40084009                                        (List<BaseType>)TypeCheckerResult.astFromResults(excludesResult), 
    4009                                         (Option<List<BaseType>>)TypeCheckerResult.astFromResults(comprisesResult), 
    4010                                         (List<Decl>)TypeCheckerResult.astFromResults(decls_result)); 
     4010                                        (Option<List<BaseType>>)TypeCheckerResult.astFromResults(comprisesResult)); 
    40114011 
    40124012                return TypeCheckerResult.compose(new_node, checker_with_sparams.subtypeChecker, 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ApiMaker.java

    r3096 r3098  
    125125                                                   that.getExtendsClause(), 
    126126                                                   that.getWhere(), 
     127                                                   absDecls, 
    127128                                                   that.getExcludes(), 
    128                                                    that.getComprises(), 
    129                                                    absDecls)); 
     129                                                   that.getComprises())); 
    130130        } else return Option.<Node>none(); 
    131131    } 
     
    142142                                                    that.getExtendsClause(), 
    143143                                                    that.getWhere(), 
     144                                                    absDecls, 
    144145                                                    that.getParams(), 
    145146                                                    that.getThrowsClause(), 
    146                                                     that.getContract(), 
    147                                                     absDecls)); 
     147                                                    that.getContract())); 
    148148        } else return Option.<Node>none(); 
    149149    } 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/TraitObject.rats

    r3096 r3098  
    4949         new TraitDecl(span, a1, a2.getName(), 
    5050                       a2.getStaticParams(), a2.getExtendsClause(), a3.getWhere(), 
    51                        a3.getExcludes(), a3.getComprises(), a4); 
     51                       a4, a3.getExcludes(), a3.getComprises()); 
    5252     }; 
    5353 
     
    177177           (span, a1, a2.getName(), 
    178178            a2.getStaticParams(), a2.getExtendsClause(), fhc.getWhereClause(), 
    179             a2.getParams(), fhc.getThrowsClause(), contract, a3); 
     179            a3, a2.getParams(), fhc.getThrowsClause(), contract); 
    180180     }; 
    181181 
     
    321321           (span, a1, a2.getName(), 
    322322            a2.getStaticParams(), a2.getExtendsClause(), a3.getWhere(), 
    323             a3.getExcludes(), a3.getComprises(), a4); 
     323            a4, a3.getExcludes(), a3.getComprises()); 
    324324     }; 
    325325 
     
    437437           (span, a1, a2.getName(), 
    438438            a2.getStaticParams(), a2.getExtendsClause(), fhc.getWhereClause(), 
    439             params, fhc.getThrowsClause(), contract, a3); 
     439            a3, params, fhc.getThrowsClause(), contract); 
    440440     }; 
    441441 
  • trunk/ProjectFortress/src/com/sun/fortress/tools/FortressAstToConcrete.java

    r3096 r3098  
    420420            return forTraitDeclOnly(that, mods_result, name_result, 
    421421                                    staticParams_result, extendsClause_result, 
    422                                     where_result, excludes_result, comprises_result, 
    423                                     decls_result); 
     422                                    where_result, decls_result, 
     423                                    excludes_result, comprises_result); 
    424424        } 
    425425    } 
     
    431431                                             List<String> extendsClause_result, 
    432432                                             Option<String> where_result, 
     433                                             List<String> decls_result, 
    433434                                             List<String> excludes_result, 
    434                                              Option<List<String>> comprises_result, 
    435                                              List<String> decls_result) { 
     435                                             Option<List<String>> comprises_result) { 
    436436        StringBuilder s = new StringBuilder(); 
    437437 
     
    485485            return forObjectDeclOnly(that, mods_result, name_result, 
    486486                                     staticParams_result, extendsClause_result, 
    487                                      where_result, params_result, 
    488                                      throwsClause_result, contract_result, 
    489                                      decls_result); 
     487                                     where_result, decls_result, params_result, 
     488                                     throwsClause_result, contract_result); 
    490489        } 
    491490    } 
     
    497496                                              List<String> extendsClause_result, 
    498497                                              Option<String> where_result, 
     498                                              List<String> decls_result, 
    499499                                              Option<List<String>> params_result, 
    500500                                              Option<List<String>> throwsClause_result, 
    501                                               Option<String> contract_result, 
    502                                               List<String> decls_result) { 
     501                                              Option<String> contract_result) { 
    503502        StringBuilder s = new StringBuilder(); 
    504503