Changeset 3093
- Timestamp:
- 11/24/08 18:09:59 (12 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 34 modified
-
Library/FortressSyntax.fsi (modified) (1 diff)
-
ProjectFortress/astgen/Fortress.ast (modified) (19 diffs)
-
ProjectFortress/compiler_tests (added)
-
ProjectFortress/src/com/sun/fortress/compiler/IndexBuilder.java (modified) (3 diffs)
-
ProjectFortress/src/com/sun/fortress/compiler/desugarer/PreDisambiguationDesugaringVisitor.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/compiler/disambiguator/ExprDisambiguator.java (modified) (5 diffs)
-
ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/compiler/typechecker/SubtypeCheckerJUTest.java (modified) (4 diffs)
-
ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerJUTest.java (modified) (4 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/Driver.java (modified) (1 diff)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildApiEnvironment.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildEnvironments.java (modified) (5 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildTopLevelEnvironments.java (modified) (13 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTraitOrObject.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTraitOrObjectOrGeneric.java (modified) (5 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeGeneric.java (modified) (3 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeObject.java (modified) (4 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeObjectInstance.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTop.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTrait.java (modified) (4 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTraitInstance.java (modified) (3 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicInstantiatedType.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicOprType.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicType.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicWhereType.java (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/evaluator/values/Constructor.java (modified) (3 diffs)
-
ProjectFortress/src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java (modified) (20 diffs)
-
ProjectFortress/src/com/sun/fortress/nodes_util/ApiMaker.java (modified) (4 diffs)
-
ProjectFortress/src/com/sun/fortress/nodes_util/NodeUtil.java (modified) (1 diff)
-
ProjectFortress/src/com/sun/fortress/parser/Compilation.rats (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/parser/Declaration.rats (modified) (2 diffs)
-
ProjectFortress/src/com/sun/fortress/parser/Method.rats (modified) (1 diff)
-
ProjectFortress/src/com/sun/fortress/parser/TraitObject.rats (modified) (12 diffs)
-
ProjectFortress/src/com/sun/fortress/parser/preparser/PreCompilation.rats (modified) (3 diffs)
-
ProjectFortress/src/com/sun/fortress/tools/FortressAstToConcrete.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Library/FortressSyntax.fsi
r3078 r3093 39 39 Decls : List[\Decl\] 40 40 Decl : List[\Decl\] 41 AbsDecls : List[\ AbsDecl\]42 AbsDecl : AbsDecl41 AbsDecls : List[\Decl\] 42 AbsDecl : Decl 43 43 end 44 44 -
trunk/ProjectFortress/astgen/Fortress.ast
r3092 r3093 76 76 * declaration in components or APIs 77 77 */ 78 interface AbsDeclOrDecl(); 79 /** 80 * declaration in APIs 81 */ 82 interface AbsDecl(); 83 /** 84 * declaration in components 85 */ 86 interface Decl(); 78 interface Decl(); 87 79 /** 88 80 * left-hand-side of assignments, local variable declarations, or … … 108 100 */ 109 101 interface HasParams(Option<List<Param>> params, 110 List< ? extends AbsDeclOrDecl> decls);102 List<Decl> decls); 111 103 /** 112 104 * with a where clause … … 135 127 */ 136 128 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; 142 131 143 132 /** … … 183 172 * end 184 173 */ 185 Api(List< AbsDecl> decls);174 Api(List<Decl> decls); 186 175 /** 187 176 * import statement … … 232 221 */ 233 222 abstract TraitObjectAbsDeclOrDecl(List<Modifier> mods 234 = Collections.<Modifier>emptyList(),235 Id name,236 List<StaticParam> staticParams237 = Collections.<StaticParam>emptyList(),238 List<TraitTypeWhere> extendsClause239 = Collections.<TraitTypeWhere>emptyList(),240 Option<WhereClause> where241 = 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; 244 233 /** 245 234 * trait declaration in components or APIs 246 235 */ 247 236 abstract TraitAbsDeclOrDecl(List<BaseType> excludes 248 = Collections.<BaseType>emptyList(),249 Option<List<BaseType>> comprises250 = 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); 252 241 /** 253 242 * trait declaration in APIs … … 274 263 * end 275 264 */ 276 AbsTraitDecl(List< AbsDecl> decls) implements AbsDecl;265 AbsTraitDecl(List<Decl> decls) implements Decl; 277 266 /** 278 267 * trait declaration in components … … 298 287 */ 299 288 abstract ObjectAbsDeclOrDecl(Option<List<Param>> params 300 = Option.<List<Param>>none(),301 Option<List<BaseType>> throwsClause302 = Option.<List<BaseType>>none(),303 Option<Contract> contract304 = 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; 307 296 /** 308 297 * object declaration in APIs … … 328 317 * e.g.) object Empty[\alph\]() extends List[\alpha\] end 329 318 */ 330 AbsObjectDecl(List< AbsDecl> decls) implements AbsDecl;319 AbsObjectDecl(List<Decl> decls) implements Decl; 331 320 /** 332 321 * object declaration in components … … 344 333 * end 345 334 */ 346 ObjectDecl(List<Decl> decls) 347 implements GenericDeclWithParams; 335 ObjectDecl(List<Decl> decls) implements GenericDeclWithParams; 348 336 /** 349 337 * variable declaration in components or APIs 350 338 */ 351 abstract VarAbsDeclOrDecl(List<LValue> lhs) implements AbsDeclOrDecl;339 abstract VarAbsDeclOrDecl(List<LValue> lhs) implements Decl; 352 340 /** 353 341 * variable declaration in APIs … … 362 350 * e.g.) var (x, y): ZZ64... 363 351 */ 364 AbsVarDecl() implements AbsDecl,Decl;352 AbsVarDecl() implements Decl; 365 353 /** 366 354 * variable declaration in components … … 391 379 */ 392 380 abstract FnAbsDeclOrDecl(List<Modifier> mods 393 = Collections.<Modifier>emptyList(),394 IdOrOpOrAnonymousName name,395 List<StaticParam> staticParams396 = Collections.<StaticParam>emptyList(),397 List<Param> params398 = Collections.<Param>emptyList(),399 Option<Type> returnType400 = Option.<Type>none(),401 Option<List<BaseType>> throwsClause402 = Option.<List<BaseType>>none(),403 Option<WhereClause> where404 = Option.<WhereClause>none(),405 Option<Contract> contract406 = 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; 409 397 /** 410 398 * functional declaration in components or APIs … … 424 412 * e.g.) swap (x: Object, y: Object): (Object, Object) 425 413 */ 426 AbsFnDecl() implements AbsDecl;414 AbsFnDecl() implements Decl; 427 415 /** 428 416 * functional declaration in components … … 466 454 * | (unit | SI_unit) Id+ (: Type)? (= Expr)? 467 455 */ 468 abstract DimUnitDecl() implements Decl , AbsDecl;456 abstract DimUnitDecl() implements Decl; 469 457 /** 470 458 * dimension declaration … … 490 478 */ 491 479 TestDecl(Id name, List<GeneratorClause> gens, Expr expr) 492 implements Decl , AbsDecl;480 implements Decl; 493 481 /** 494 482 * property declaration … … 498 486 */ 499 487 PropertyDecl(Option<Id> name = Option.<Id>none(), List<Param> params, 500 Expr expr) implements Decl , AbsDecl;488 Expr expr) implements Decl; 501 489 /** 502 490 * grammar declaration 503 491 * Names (but not extends elements) must be unqualified. 504 492 */ 505 abstract GrammarDecl(Id name, List<Id> extends) implements AbsDecl;493 abstract GrammarDecl(Id name, List<Id> extends) implements Decl; 506 494 /** 507 495 * grammar definition … … 513 501 * Names and params must be unqualified. 514 502 */ 515 abstract GrammarMemberDecl(Id name) implements AbsDecl;503 abstract GrammarMemberDecl(Id name) implements Decl; 516 504 /** 517 505 * nonterminal declaration … … 547 535 * syntax declaration 548 536 */ 549 abstract SyntaxDecl(Option<String> modifier) implements AbsDecl;537 abstract SyntaxDecl(Option<String> modifier) implements Decl; 550 538 /** 551 539 * syntax definition in syntax declarations … … 559 547 * Transformation declaration 560 548 */ 561 abstract TransformerDecl() implements AbsDecl;549 abstract TransformerDecl() implements Decl; 562 550 /** 563 551 * pre transformer definition in transformer declarations … … 1722 1710 = Collections.<StaticParam>emptyList(), 1723 1711 Type type) 1724 implements Decl , AbsDecl;1712 implements Decl; 1725 1713 /** 1726 1714 * coercion constraint declared in where clauses -
trunk/ProjectFortress/src/com/sun/fortress/compiler/IndexBuilder.java
r3082 r3093 180 180 } 181 181 }; 182 for ( AbsDecl decl : ast.getDecls()) {182 for (Decl decl : ast.getDecls()) { 183 183 decl.accept(handleDecl); 184 184 } … … 295 295 } 296 296 }; 297 for ( AbsDeclOrDecl decl : ast.getDecls()) {297 for (Decl decl : ast.getDecls()) { 298 298 decl.accept(handleDecl); 299 299 } … … 371 371 } 372 372 }; 373 for ( AbsDeclOrDecl decl : ast.getDecls()) {373 for (Decl decl : ast.getDecls()) { 374 374 decl.accept(handleDecl); 375 375 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/PreDisambiguationDesugaringVisitor.java
r3071 r3093 83 83 List<BaseType> excludes, 84 84 Option<List<BaseType>> comprises, 85 List< AbsDecl> decls) {85 List<Decl> decls) { 86 86 if (!that.getName().equals(anyTypeId)) { 87 87 extendsClause = rewriteExtendsClause(that, extendsClause); … … 118 118 Option<List<BaseType>> throwsClause, 119 119 Option<Contract> contract, 120 List< AbsDecl> decls) {120 List<Decl> decls) { 121 121 extendsClause = rewriteExtendsClause(that, extendsClause); 122 122 return super.forAbsObjectDeclOnly(that, mods, name, staticParams, extendsClause, -
trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/ExprDisambiguator.java
r3092 r3093 30 30 import com.sun.fortress.exceptions.StaticError; 31 31 import com.sun.fortress.nodes.APIName; 32 import com.sun.fortress.nodes. AbsDeclOrDecl;32 import com.sun.fortress.nodes.Decl; 33 33 import com.sun.fortress.nodes.AbsFnDecl; 34 34 import com.sun.fortress.nodes.AbsObjectDecl; … … 399 399 400 400 private Triple<Set<Id>, Set<IdOrOpOrAnonymousName>, Set<IdOrOpOrAnonymousName>> 401 extractDeclNames(List< ? extends AbsDeclOrDecl> decls) {401 extractDeclNames(List<Decl> decls) { 402 402 final Set<IdOrOpOrAnonymousName> accessors = new HashSet<IdOrOpOrAnonymousName>(); 403 403 … … 466 466 467 467 Set<Id> vars = new HashSet<Id>(); 468 for ( AbsDeclOrDecl decl : decls) {468 for (Decl decl : decls) { 469 469 vars.addAll(decl.accept(var_finder)); 470 470 } 471 471 472 472 Set<IdOrOpOrAnonymousName> fns = new HashSet<IdOrOpOrAnonymousName>(); 473 for ( AbsDeclOrDecl decl : decls) {473 for (Decl decl : decls) { 474 474 fns.addAll(decl.accept(fn_finder)); 475 475 } … … 603 603 v.recurOnListOfBaseType(that.getExcludes()), 604 604 v.recurOnOptionOfListOfBaseType(that.getComprises()), 605 v.recurOnListOf AbsDecl(that.getDecls()));605 v.recurOnListOfDecl(that.getDecls())); 606 606 } 607 607 … … 821 821 v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 822 822 v.recurOnOptionOfContract(that.getContract()), 823 v.recurOnListOf AbsDecl(that.getDecls()));823 v.recurOnListOfDecl(that.getDecls())); 824 824 } 825 825 -
trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java
r3077 r3093 147 147 v.recurOnListOfBaseType(that.getExcludes()), 148 148 v.recurOnOptionOfListOfBaseType(that.getComprises()), 149 v.recurOnListOf AbsDecl(that.getDecls()));149 v.recurOnListOfDecl(that.getDecls())); 150 150 } 151 151 … … 185 185 v.recurOnOptionOfListOfBaseType(that.getThrowsClause()), 186 186 v.recurOnOptionOfContract(that.getContract()), 187 v.recurOnListOf AbsDecl(that.getDecls()));187 v.recurOnListOfDecl(that.getDecls())); 188 188 } 189 189 -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/SubtypeCheckerJUTest.java
r3078 r3093 320 320 * Make an ApiIndex with the given name and traits. 321 321 * @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). 323 323 */ 324 324 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); 326 326 Map<Id, TypeConsIndex> traitMap = new HashMap<Id, TypeConsIndex>(); 327 327 for (TraitIndex t : traits) { 328 traitDecls.add(( AbsDecl) t.ast());328 traitDecls.add((Decl) t.ast()); 329 329 traitMap.put(t.ast().getName(), t); 330 330 } … … 345 345 * Make a ComponentIndex with the given name and traits. 346 346 * @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). 348 348 */ 349 349 private static ComponentIndex component(String name, TraitIndex... traits) { … … 378 378 379 379 /** 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. 381 381 * @param name A simple name. 382 382 * @param supers Type strings (parsed by parseType()); must parse to TraitTypes. … … 397 397 ast = new AbsTraitDecl(span, NodeFactory.makeId(span, name), sparams, 398 398 extendsClause, 399 Collections.< AbsDecl>emptyList());399 Collections.<Decl>emptyList()); 400 400 } 401 401 else { -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerJUTest.java
r3078 r3093 393 393 * Make an ApiIndex with the given name and traits. 394 394 * @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). 396 396 */ 397 397 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); 399 399 Map<Id, TypeConsIndex> traitMap = new HashMap<Id, TypeConsIndex>(); 400 400 for (TraitIndex t : traits) { 401 traitDecls.add(( AbsDecl) t.ast());401 traitDecls.add((Decl) t.ast()); 402 402 traitMap.put(t.ast().getName(), t); 403 403 } … … 418 418 * Make a ComponentIndex with the given name and traits. 419 419 * @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). 421 421 */ 422 422 private static ComponentIndex component(String name, TraitIndex... traits) { … … 451 451 452 452 /** 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. 454 454 * @param name A simple name. 455 455 * @param supers Type strings (parsed by parseType()); must parse to TraitTypes. … … 470 470 Collections.<StaticParam>emptyList(), 471 471 extendsClause, 472 Collections.< AbsDecl>emptyList());472 Collections.<Decl>emptyList()); 473 473 } 474 474 else { -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/Driver.java
r3082 r3093 58 58 import com.sun.fortress.interpreter.glue.WellKnownNames; 59 59 import com.sun.fortress.nodes.APIName; 60 import com.sun.fortress.nodes.AbsDecl;61 60 import com.sun.fortress.nodes.AbsFnDecl; 62 61 import com.sun.fortress.nodes.AbsObjectDecl; -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildApiEnvironment.java
r3082 r3093 26 26 import com.sun.fortress.interpreter.rewrite.ArrowOrFunctional; 27 27 import com.sun.fortress.interpreter.rewrite.IsAnArrowName; 28 import com.sun.fortress.nodes. AbsDeclOrDecl;28 import com.sun.fortress.nodes.Decl; 29 29 import com.sun.fortress.nodes.AbsFnDecl; 30 30 import com.sun.fortress.nodes.AbsObjectDecl; … … 162 162 } 163 163 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) { 166 166 ArrowOrFunctional aof = adod 167 167 .accept(IsAnArrowName.isAnArrowName); -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildEnvironments.java
r3082 r3093 173 173 174 174 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) { 177 177 def.accept(inner); 178 178 } 179 179 } 180 180 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) { 183 183 def.accept(this); 184 184 } … … 196 196 // BetterEnv into = ftt.getMembers(); 197 197 // BetterEnv forTraitMethods = ftt.getMethodExecutionEnv(); 198 // List< ? extends AbsDeclOrDecl> defs = ftt.getASTmembers();198 // List<Decl> defs = ftt.getASTmembers(); 199 199 // 200 200 // BuildTraitEnvironment inner = new BuildTraitEnvironment(into, … … 205 205 // } 206 206 // 207 public void doDefs1234(List< ? extends AbsDeclOrDecl> defs) {207 public void doDefs1234(List<Decl> defs) { 208 208 doDefs(defs); 209 209 doDefs234(defs); 210 210 } 211 211 212 public void doDefs234(List< ? extends AbsDeclOrDecl> defs) {212 public void doDefs234(List<Decl> defs) { 213 213 secondPass(); 214 214 doDefs(defs); … … 528 528 public void scanForFunctionalMethodNames( 529 529 FTraitOrObjectOrGeneric x, 530 List< ? extends AbsDeclOrDecl> defs) {530 List<Decl> defs) { 531 531 scanForFunctionalMethodNames(x, defs, false); 532 532 } 533 533 534 534 public void scanForFunctionalMethodNames(FTraitOrObjectOrGeneric x, 535 List< ? extends AbsDeclOrDecl> defs, boolean bogus) {535 List<Decl> defs, boolean bogus) { 536 536 // This is probably going away. 537 537 Environment topLevel = containing; … … 891 891 ftt.setComprises(Useful.<FType>set(c)); 892 892 } 893 List< ? extends AbsDeclOrDecl> fns = x.getDecls();893 List<Decl> fns = x.getDecls(); 894 894 895 895 // doTraitMethodDefs(ftt, null); /* NOTICE THE DIFFERENT ENVIRONMENT! */ -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/BuildTopLevelEnvironments.java
r3053 r3093 30 30 import com.sun.fortress.interpreter.evaluator.values.SingleFcn; 31 31 import com.sun.fortress.nodes.APIName; 32 import com.sun.fortress.nodes. AbsDeclOrDecl;32 import com.sun.fortress.nodes.Decl; 33 33 import com.sun.fortress.nodes.AbsTraitDecl; 34 34 import com.sun.fortress.nodes.AliasedAPIName; … … 67 67 */ 68 68 public Set<String> typeNames = new HashSet<String>(); 69 69 70 70 /** 71 71 * Used for mapping API Names to their environments … … 130 130 @Override 131 131 public Boolean forApi(Api x) { 132 List< ? extends AbsDeclOrDecl> decls = x.getDecls();132 List<Decl> decls = x.getDecls(); 133 133 134 134 switch (getPass()) { … … 141 141 142 142 } 143 143 144 144 public Boolean for_RewriteFnOverloadDecl(_RewriteFnOverloadDecl x) { 145 145 switch (getPass()) { … … 150 150 } 151 151 break; 152 152 153 153 case 3: { 154 154 String s = x.getName().stringName(); … … 157 157 Option<APIName> oapi = fn.getApi(); 158 158 FValue oapi_val = null; 159 159 160 160 if (fn instanceof Id) { 161 161 oapi_val = bindInto.getValueNull((Id) fn, Environment.TOP_LEVEL); // top-level reference … … 165 165 bug("Unexpected change to AST node hierarchy"); 166 166 } 167 167 168 168 if (oapi_val == null) { 169 169 bug("Failed to find overload member " + fn + " for " + x); 170 170 } 171 171 172 172 if (oapi_val instanceof SingleFcn) { 173 173 of.addOverload((SingleFcn) oapi_val, true); … … 177 177 bug("Unexpected function binding for " + fn +" , value is " + oapi_val); 178 178 } 179 180 } 181 179 180 } 181 182 182 of.finishInitializing(); 183 184 } 185 183 184 } 185 186 186 } 187 187 return null; … … 195 195 @Override 196 196 public Boolean forComponent(Component x) { 197 List< ? extends AbsDeclOrDecl> defs = x.getDecls();197 List<Decl> defs = x.getDecls(); 198 198 switch (getPass()) { 199 199 case 1: forComponent1(x); break; 200 200 201 case 2: doDefs(this, defs); 201 case 2: doDefs(this, defs); 202 202 break; 203 203 case 3: { 204 204 ForceTraitFinish v = new ForceTraitFinish() ; 205 for ( AbsDeclOrDecl def : defs) {205 for (Decl def : defs) { 206 206 v.visit(def); 207 207 } … … 214 214 215 215 public Boolean forComponentDefs(Component x) { 216 List< ? extends AbsDeclOrDecl> defs = x.getDecls();216 List<Decl> defs = x.getDecls(); 217 217 doDefs(this, defs); 218 218 return null; … … 223 223 List<Import> imports = x.getImports(); 224 224 // List<Export> exports = x.getExports(); 225 List< ? extends AbsDeclOrDecl> defs = x.getDecls();225 List<Decl> defs = x.getDecls(); 226 226 227 227 // SComponent comp = new SComponent(BetterEnv.primitive(x), x); … … 229 229 230 230 forComponentDefs(x); 231 231 232 232 for (Import imp : imports) { 233 233 imp.accept(this); … … 280 280 } 281 281 282 void visit( AbsDeclOrDecl def) {282 void visit(Decl def) { 283 283 def.accept(this); 284 284 } 285 285 } 286 286 287 287 public void setExporterAndApi(CUWrapper exporter, CUWrapper api) { 288 288 bug("Can only set exporter of API environment builder."); 289 289 } 290 290 291 291 292 292 } -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTraitOrObject.java
r3077 r3093 37 37 import com.sun.fortress.interpreter.evaluator.values.Overload; 38 38 import com.sun.fortress.interpreter.evaluator.values.OverloadedFunction; 39 import com.sun.fortress.nodes. AbsDeclOrDecl;39 import com.sun.fortress.nodes.Decl; 40 40 import com.sun.fortress.nodes.AbstractNode; 41 41 import com.sun.fortress.nodes.FnDecl; … … 225 225 } 226 226 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) { 228 228 super(name, env, def); 229 229 this.members = members; -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTraitOrObjectOrGeneric.java
r2969 r3093 28 28 import com.sun.fortress.interpreter.evaluator.values.FunctionalMethod; 29 29 import com.sun.fortress.interpreter.evaluator.values.GenericFunctionalMethod; 30 import com.sun.fortress.nodes. AbsDeclOrDecl;30 import com.sun.fortress.nodes.Decl; 31 31 import com.sun.fortress.nodes.AbstractNode; 32 32 import com.sun.fortress.nodes.FnAbsDeclOrDecl; … … 55 55 } 56 56 57 List< ? extends AbsDeclOrDecl> members;57 List<Decl> members; 58 58 59 59 Environment env; … … 69 69 } 70 70 71 public List< ? extends AbsDeclOrDecl> getASTmembers() {71 public List<Decl> getASTmembers() { 72 72 return members; 73 73 } … … 90 90 return; 91 91 FTraitOrObjectOrGeneric x = this; 92 // List< ? extends AbsDeclOrDecl> defs = members;92 // List<Decl> defs = members; 93 93 94 94 SortedSet<FnAbsDeclOrDecl> defs = Useful 95 .< AbsDeclOrDecl, FnAbsDeclOrDecl> filteredSortedSet(members,96 new Fn< AbsDeclOrDecl, FnAbsDeclOrDecl>() {95 .<Decl, FnAbsDeclOrDecl> filteredSortedSet(members, 96 new Fn<Decl, FnAbsDeclOrDecl>() { 97 97 @Override 98 public FnAbsDeclOrDecl apply( AbsDeclOrDecl x) {98 public FnAbsDeclOrDecl apply(Decl x) { 99 99 if (x instanceof FnAbsDeclOrDecl) 100 100 return (FnAbsDeclOrDecl) x; … … 163 163 164 164 topLevel = topLevel.getTopLevel(); 165 166 List<? extends AbsDeclOrDecl> defs = members;167 165 168 for (AbsDeclOrDecl dod : defs) { 166 List<Decl> defs = members; 167 168 for (Decl dod : defs) { 169 169 // Filter out non-functions. 170 170 if (dod instanceof FnAbsDeclOrDecl) { -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeGeneric.java
r3071 r3093 32 32 import com.sun.fortress.interpreter.evaluator.InstantiationLock; 33 33 import com.sun.fortress.interpreter.rewrite.OprInstantiaterVisitor; 34 import com.sun.fortress.nodes. AbsDeclOrDecl;34 import com.sun.fortress.nodes.Decl; 35 35 import com.sun.fortress.nodes.AbstractNode; 36 36 import com.sun.fortress.nodes.BoolParam; … … 92 92 pendingFunctionalMethodFinishes = new ArrayList<FTraitOrObjectOrGeneric>(); 93 93 } 94 94 95 95 private final Generic def; 96 96 private final FTypeGeneric original; 97 97 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) { 99 99 super(NodeUtil.stringName(d), e, decl); 100 100 def = d; … … 346 346 rval = bug( within, errorMsg("The use of generic type is " + 347 347 "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 " + 349 349 "expression type, but found: " + gen.def) ); 350 350 } -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeObject.java
r3082 r3093 26 26 import com.sun.fortress.interpreter.evaluator.BuildObjectEnvironment; 27 27 import com.sun.fortress.interpreter.evaluator.Environment; 28 import com.sun.fortress.nodes. AbsDeclOrDecl;28 import com.sun.fortress.nodes.Decl; 29 29 import com.sun.fortress.nodes.AbstractNode; 30 30 import com.sun.fortress.nodes.FnAbsDeclOrDecl; … … 61 61 public FTypeObject(String name, Environment env, HasAt at, 62 62 Option<List<Param>> params, 63 List< ? extends AbsDeclOrDecl> members, AbstractNode def) {63 List<Decl> members, AbstractNode def) { 64 64 super(name, env, at, members, def); 65 65 this.declaredMembersOf = new BetterEnv(at); 66 for( AbsDeclOrDecl v : members) {66 for(Decl v : members) { 67 67 if (v instanceof VarAbsDeclOrDecl) { 68 68 for (LValue lhs : ((VarAbsDeclOrDecl)v).getLhs()) { … … 109 109 return; 110 110 BetterEnv into = getMembersInternal(); 111 List< ? extends AbsDeclOrDecl> defs = getASTmembers();111 List<Decl> defs = getASTmembers(); 112 112 113 113 /* The parameters to BuildObjectEnvironment are … … 124 124 125 125 // This is a minor hack to deal with messed-up object environments. 126 for( AbsDeclOrDecl v : members) {126 for(Decl v : members) { 127 127 if (v instanceof FnAbsDeclOrDecl) { 128 128 String s = NodeUtil.nameAsMethod((FnAbsDeclOrDecl)v);//.getName().stringName(); -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeObjectInstance.java
r2973 r3093 22 22 23 23 import com.sun.fortress.interpreter.evaluator.Environment; 24 import com.sun.fortress.nodes. AbsDeclOrDecl;24 import com.sun.fortress.nodes.Decl; 25 25 import com.sun.fortress.nodes.Param; 26 26 import com.sun.fortress.nodes.Type; … … 37 37 List<FType> bind_args, List<FType> name_args, 38 38 Option<List<Param>> params, 39 List< ? extends AbsDeclOrDecl> members) {39 List<Decl> members) { 40 40 super(name, interior, interior.getAt(), params, members, generic.getDecl()); 41 41 this.generic = generic; -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTop.java
r1895 r3093 25 25 26 26 import com.sun.fortress.interpreter.env.BetterEnv; 27 import com.sun.fortress.nodes. AbsDeclOrDecl;27 import com.sun.fortress.nodes.Decl; 28 28 import com.sun.fortress.useful.HasAt; 29 29 import com.sun.fortress.useful.Useful; … … 36 36 private FTypeTop() { 37 37 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. 39 39 membersInitialized = true; 40 40 } -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTrait.java
r2767 r3093 27 27 import com.sun.fortress.interpreter.evaluator.BuildTraitEnvironment; 28 28 import com.sun.fortress.interpreter.evaluator.Environment; 29 import com.sun.fortress.nodes. AbsDeclOrDecl;29 import com.sun.fortress.nodes.Decl; 30 30 import com.sun.fortress.nodes.AbstractNode; 31 31 import com.sun.fortress.useful.BASet; … … 49 49 protected volatile Set<FType> transitiveComprises; 50 50 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) { 52 52 super(name, interior, at, members, decl); 53 53 this.declaredMembersOf = new BetterEnv(at); … … 103 103 Environment into = getMembersInternal(); 104 104 Environment forTraitMethods = getMethodExecutionEnv(); 105 List< ? extends AbsDeclOrDecl> defs = getASTmembers();105 List<Decl> defs = getASTmembers(); 106 106 107 107 BuildTraitEnvironment inner = new BuildTraitEnvironment(into, … … 126 126 return declaredMembersOf; 127 127 } 128 128 129 129 } -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/FTypeTraitInstance.java
r2984 r3093 22 22 23 23 import com.sun.fortress.interpreter.evaluator.Environment; 24 import com.sun.fortress.nodes. AbsDeclOrDecl;24 import com.sun.fortress.nodes.Decl; 25 25 import com.sun.fortress.nodes.Type; 26 26 import com.sun.fortress.useful.BoundingMap; … … 47 47 public FTypeTraitInstance(String name, Environment interior, 48 48 FTypeGeneric generic, List<FType> bind_args, List<FType> name_args, 49 List< ? extends AbsDeclOrDecl> members) {49 List<Decl> members) { 50 50 super(name, interior, interior.getAt(), members, generic.getDecl()); 51 51 this.generic = generic; … … 67 67 throw new Error("Badly layered environment"); 68 68 } 69 69 70 70 } 71 71 } -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicInstantiatedType.java
r1826 r3093 21 21 22 22 import com.sun.fortress.interpreter.evaluator.Environment; 23 import com.sun.fortress.nodes. AbsDeclOrDecl;23 import com.sun.fortress.nodes.Decl; 24 24 import com.sun.fortress.nodes.AbstractNode; 25 25 … … 31 31 */ 32 32 public SymbolicInstantiatedType(String name, Environment interior, AbstractNode decl) { 33 super(name, interior, Collections.< AbsDeclOrDecl>emptyList(), decl);33 super(name, interior, Collections.<Decl>emptyList(), decl); 34 34 isSymbolic = true; 35 35 } -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicOprType.java
r1826 r3093 20 20 21 21 import com.sun.fortress.interpreter.evaluator.Environment; 22 import com.sun.fortress.nodes. AbsDeclOrDecl;22 import com.sun.fortress.nodes.Decl; 23 23 import com.sun.fortress.nodes.AbstractNode; 24 24 … … 26 26 27 27 public SymbolicOprType(String name, Environment interior, AbstractNode decl) { 28 super(name, interior, Collections.< AbsDeclOrDecl>emptyList(), decl);28 super(name, interior, Collections.<Decl>emptyList(), decl); 29 29 isSymbolic = true; 30 30 } -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicType.java
r1895 r3093 28 28 import com.sun.fortress.interpreter.evaluator.Environment; 29 29 import com.sun.fortress.interpreter.evaluator.values.FValue; 30 import com.sun.fortress.nodes. AbsDeclOrDecl;30 import com.sun.fortress.nodes.Decl; 31 31 import com.sun.fortress.nodes.AbstractNode; 32 32 … … 42 42 } 43 43 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) { 45 45 super(name, interior, interior.getAt(), members, decl); 46 46 membersInitialized = true; -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/types/SymbolicWhereType.java
r1826 r3093 22 22 23 23 import com.sun.fortress.interpreter.evaluator.Environment; 24 import com.sun.fortress.nodes. AbsDeclOrDecl;24 import com.sun.fortress.nodes.Decl; 25 25 import com.sun.fortress.nodes.AbstractNode; 26 26 import com.sun.fortress.useful.NI; … … 33 33 */ 34 34 public SymbolicWhereType(String name, Environment interior, AbstractNode decl) { 35 super(name, interior, Collections.< AbsDeclOrDecl>emptyList(), decl);35 super(name, interior, Collections.<Decl>emptyList(), decl); 36 36 NI.nyi("Where clauses cause a stack overflow error"); 37 37 // TODO Auto-generated constructor stub -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/evaluator/values/Constructor.java
r3077 r3093 41 41 import com.sun.fortress.interpreter.glue.NativeApp; 42 42 import com.sun.fortress.interpreter.glue.WellKnownNames; 43 import com.sun.fortress.nodes. AbsDeclOrDecl;43 import com.sun.fortress.nodes.Decl; 44 44 import com.sun.fortress.nodes.FnDecl; 45 45 import com.sun.fortress.nodes.GenericWithParams; … … 79 79 80 80 IdOrOpOrAnonymousName cfn; 81 List< ? extends AbsDeclOrDecl> defs;81 List<Decl> defs; 82 82 Option<List<Param>> params; 83 83 … … 174 174 175 175 public Constructor(Environment env, FTypeObject selfType, HasAt def, 176 IdOrOpOrAnonymousName name, List< ? extends AbsDeclOrDecl> defs,176 IdOrOpOrAnonymousName name, List<Decl> defs, 177 177 Option<List<Param>> params) { 178 178 super(env); // TODO verify that this is the proper env. -
trunk/ProjectFortress/src/com/sun/fortress/interpreter/rewrite/DesugarerVisitor.java
r3089 r3093 46 46 import com.sun.fortress.nodes_util.Span; 47 47 import com.sun.fortress.nodes.APIName; 48 import com.sun.fortress.nodes.AbsDecl;49 import com.sun.fortress.nodes.AbsDeclOrDecl;50 48 import com.sun.fortress.nodes.AbsFnDecl; 51 49 import com.sun.fortress.nodes.AbsTraitDecl; … … 273 271 return rewrites.put(k, d); 274 272 } 275 273 276 274 public Thing obj_rewrites_put(String k, Thing d) { 277 275 return rewrites.put(k, d); 278 276 } 279 277 280 278 public Thing rewrites_put(String k, Thing d) { 281 279 return rewrites.put(k, d); 282 280 } 283 281 284 282 public Thing type_rewrites_put(String k, Thing d) { 285 283 return rewrites.put(k, d); … … 491 489 // circular dependences between type names. See above. 492 490 Component com = (Component) tlnode; 493 List< ? extends AbsDeclOrDecl> defs = com.getDecls();491 List<Decl> defs = com.getDecls(); 494 492 defsToLocals(defs); 495 493 functionalMethodsOfDefsToLocals(defs); … … 500 498 // circular dependences between type names. See above. 501 499 Api com = (Api) tlnode; 502 List< ? extends AbsDeclOrDecl> defs = com.getDecls();500 List<Decl> defs = com.getDecls(); 503 501 defsToLocals(defs); 504 502 functionalMethodsOfDefsToLocals(defs); … … 664 662 @Override 665 663 public Node forComponent(Component com) { 666 List< ? extends AbsDeclOrDecl> defs = com.getDecls();664 List<Decl> defs = com.getDecls(); 667 665 defsToLocals(defs); 668 666 … … 701 699 @Override 702 700 public Node forApi(Api com) { 703 List< ? extends AbsDeclOrDecl> defs = com.getDecls();701 List<Decl> defs = com.getDecls(); 704 702 defsToLocals(defs); 705 703 return visitNode(com); … … 804 802 boolean change = false; 805 803 List<WhereBinding> lwb = wc.getBindings(); 806 804 807 805 for (WhereBinding wb : lwb) { 808 806 type_rewrites_put(wb.getName().getText(), new Local()); 809 807 } 810 808 811 809 /* Handcoded visit to avoid a "recur" visit on the WhereClause 812 810 The binding action of a WhereClause in a TraitTypeWhere seems 813 811 to be different. 814 812 */ 815 813 816 814 WhereClause nwc = (WhereClause) visitNode(wc); 817 815 BaseType t = vre.getType(); … … 824 822 return visitNode(vre); 825 823 } 826 827 824 825 828 826 } 829 827 … … 831 829 public Node forWhereClause(WhereClause wc) { 832 830 lexicalNestingDepth++; 833 831 834 832 List<WhereBinding> lwb = wc.getBindings(); 835 833 for (WhereBinding wb : lwb) { 836 834 type_rewrites_put(wb.getName().getText(), new Local()); 837 835 } 838 836 839 837 return visitNode(wc); 840 838 } … … 966 964 967 965 968 966 969 967 970 968 @Override 971 969 public Node for_RewriteObjectExpr(_RewriteObjectExpr oe) { 972 List< ? extends AbsDeclOrDecl> defs = oe.getDecls();970 List<Decl> defs = oe.getDecls(); 973 971 List<BaseType> xtends = NodeUtil.getTypes(oe.getExtendsClause()); 974 972 objectNestingDepth++; … … 980 978 return n; 981 979 } 982 980 983 981 @Override 984 982 public Node forObjectExpr(ObjectExpr oe) { … … 1016 1014 lexicalNestingDepth++; 1017 1015 // 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 } 1019 1020 defsToLocals(defs); 1020 1021 // All the function names are in scope in the function … … 1044 1045 // extended traits 1045 1046 // are mapped to "self". 1046 List< ? extends AbsDeclOrDecl> defs = od.getDecls();1047 List<Decl> defs = od.getDecls(); 1047 1048 Option<List<Param>> params = od.getParams(); 1048 1049 List<StaticParam> tparams = od.getStaticParams(); … … 1067 1068 @Override 1068 1069 public Node forAbsTraitDecl(AbsTraitDecl td) { 1069 List< ? extends AbsDecl> defs = td.getDecls();1070 List<Decl> defs = td.getDecls(); 1070 1071 List<StaticParam> tparams = td.getStaticParams(); 1071 1072 // TODO wip … … 1086 1087 @Override 1087 1088 public Node forTraitDecl(TraitDecl td) { 1088 List< ? extendsDecl> defs = td.getDecls();1089 List<Decl> defs = td.getDecls(); 1089 1090 List<StaticParam> tparams = td.getStaticParams(); 1090 1091 // TODO wip … … 1333 1334 * @param defs 1334 1335 */ 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) { 1337 1338 if (d instanceof TraitAbsDeclOrDecl) { 1338 1339 String s = d.stringName(); … … 1367 1368 * @param defs 1368 1369 */ 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) { 1371 1372 if (d instanceof TraitObjectAbsDeclOrDecl) { 1372 1373 TraitObjectAbsDeclOrDecl dod = (TraitObjectAbsDeclOrDecl) d; 1373 List < ? extends AbsDeclOrDecl> tdecls = dod.getDecls();1374 List <Decl> tdecls = dod.getDecls(); 1374 1375 handlePossibleFM(tdecls); 1375 1376 } else { … … 1379 1380 } 1380 1381 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) { 1383 1384 ArrowOrFunctional aof = adod.accept(IsAnArrowName.isAnArrowName); 1384 1385 if (aof == ArrowOrFunctional.FUNCTIONAL) { … … 1475 1476 * @param defs 1476 1477 */ 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) { 1479 1480 1480 1481 if (dd instanceof VarDecl) { … … 1602 1603 // types.add(s); // The trait is known by this 1603 1604 // name. 1604 for ( AbsDeclOrDecl dd : tdod.getDecls()) {1605 for (Decl dd : tdod.getDecls()) { 1605 1606 String sdd = dd.stringName(); 1606 1607 if (dd instanceof VarDecl) { -
trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ApiMaker.java
r3082 r3093 90 90 } 91 91 92 private List< AbsDecl> declsToAbsDecls(final List<Decl> that) {92 private List<Decl> declsToDecls(final List<Decl> that) { 93 93 boolean changed = false; 94 List< AbsDecl> result = new java.util.ArrayList<AbsDecl>(0);94 List<Decl> result = new java.util.ArrayList<Decl>(0); 95 95 for (Decl elt : that) { 96 96 Option<Node> elt_result = elt.accept(this); 97 97 if ( elt_result.isSome() ) 98 result.add(( AbsDecl)elt_result.unwrap());98 result.add((Decl)elt_result.unwrap()); 99 99 } 100 100 return result; … … 105 105 that.getName(), 106 106 that.getImports(), 107 declsTo AbsDecls(that.getDecls()));107 declsToDecls(that.getDecls())); 108 108 try { 109 109 writer.close(); … … 117 117 if ( ! isPrivate(that) ) { 118 118 inTrait = true; 119 List< AbsDecl> absDecls = declsToAbsDecls(that.getDecls());119 List<Decl> absDecls = declsToDecls(that.getDecls()); 120 120 inTrait = false; 121 121 return Option.<Node>some(new AbsTraitDecl(that.getSpan(), … … 134 134 if ( ! isPrivate(that) ) { 135 135 inObject = true; 136 List< AbsDecl> absDecls = declsToAbsDecls(that.getDecls());136 List<Decl> absDecls = declsToDecls(that.getDecls()); 137 137 inObject = false; 138 138 return Option.<Node>some(new AbsObjectDecl(that.getSpan(), -
trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeUtil.java
r3082 r3093 425 425 } 426 426 427 public static IterableOnce<String> stringNames( AbsDeclOrDecl decl) {427 public static IterableOnce<String> stringNames(Decl decl) { 428 428 return decl.accept(new NodeAbstractVisitor<IterableOnce<String>>() { 429 429 public IterableOnce<String> forDimDecl(DimDecl d) { -
trunk/ProjectFortress/src/com/sun/fortress/parser/Compilation.rats
r3078 r3093 71 71 } 72 72 / 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(); 74 74 Span span = createSpan(yyStart,yyCount); 75 75 String file = span.begin.getFileName(); … … 143 143 " has the different name " + a4 + " at the end."); 144 144 if (a2 == null) a2 = Collections.<Import>emptyList(); 145 if (a3 == null) a3 = Collections.< AbsDecl>emptyList();145 if (a3 == null) a3 = Collections.<Decl>emptyList(); 146 146 yyValue = new Api(span, a1, a2, a3); 147 147 }; -
trunk/ProjectFortress/src/com/sun/fortress/parser/Declaration.rats
r3012 r3093 58 58 59 59 /* AbsDecls ::= AbsDecl (br AbsDecl)* */ 60 List< AbsDecl> AbsDecls = a1:AbsDecl a2s:(br AbsDecl)*61 { for (List< AbsDecl> ds : a2s.list()) {60 List<Decl> AbsDecls = a1:AbsDecl a2s:(br AbsDecl)* 61 { for (List<Decl> ds : a2s.list()) { 62 62 a1.addAll(ds); 63 63 } … … 76 76 | GrammarDef 77 77 */ 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); }78 List<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); } 83 83 / 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); } 88 88 ; -
trunk/ProjectFortress/src/com/sun/fortress/parser/Method.rats
r3067 r3093 165 165 coerce (w StaticParams)? w ( w BindId w IsType w ) CoercionClauses (w widens)? 166 166 */ 167 AbsDecl AbsCoercion =167 Decl AbsCoercion = 168 168 coerce a1:(w StaticParams)? w openparen w a2:BindId w a3:IsType w closeparen 169 169 a4:CoercionClauses a5:(w widens)? -
trunk/ProjectFortress/src/com/sun/fortress/parser/TraitObject.rats
r3032 r3093 317 317 " has the different name " + a5 + " at the end."); 318 318 if (a1 == null) a1 = FortressUtil.emptyModifiers(); 319 if (a4 == null) a4 = Collections.< AbsDecl>emptyList();319 if (a4 == null) a4 = Collections.<Decl>emptyList(); 320 320 yyValue = new AbsTraitDecl 321 321 (span, a1, a2.getName(), … … 356 356 | AbsCoercions 357 357 */ 358 private List< AbsDecl> AbsGoInATrait =358 private List<Decl> AbsGoInATrait = 359 359 a1:AbsCoercions 360 { yyValue = new ArrayList< AbsDecl>();360 { yyValue = new ArrayList<Decl>(); 361 361 yyValue.addAll(a1); 362 362 } … … 382 382 } 383 383 / a1:(AbsCoercions br)? a2:AbsGoFrontInATrait a3:(br AbsGoBackInATrait)? 384 { yyValue = new ArrayList< AbsDecl>();384 { yyValue = new ArrayList<Decl>(); 385 385 if (a1 != null) yyValue.addAll(a1); 386 386 yyValue.addAll(a2); … … 388 388 } 389 389 / a1:(AbsCoercions br)? a2:AbsGoBackInATrait 390 { yyValue = new ArrayList< AbsDecl>();390 { yyValue = new ArrayList<Decl>(); 391 391 if (a1 != null) yyValue.addAll(a1); 392 392 yyValue.addAll(a2); … … 394 394 395 395 /* AbsCoercions ::= AbsCoercion (br AbsCoercion)* */ 396 private List< AbsDecl> AbsCoercions = a1:AbsCoercion a2s:(br AbsCoercion)*396 private List<Decl> AbsCoercions = a1:AbsCoercion a2s:(br AbsCoercion)* 397 397 { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 398 398 399 399 /* AbsGoFrontInATrait ::= AbsGoesFrontInATrait (br AbsGoesFrontInATrait)* */ 400 private List< AbsDecl> AbsGoFrontInATrait =400 private List<Decl> AbsGoFrontInATrait = 401 401 a1:AbsGoesFrontInATrait a2s:(br AbsGoesFrontInATrait)* 402 402 { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 403 403 404 404 /* AbsGoesFrontInATrait ::= ApiFldDecl | AbsGetterSetterDecl | PropertyDecl */ 405 private AbsDecl AbsGoesFrontInATrait =405 private Decl AbsGoesFrontInATrait = 406 406 ApiFldDecl 407 407 / AbsGetterSetterDecl … … 409 409 410 410 /* AbsGoBackInATrait ::= AbsGoesBackInATrait (br AbsGoesBackInATrait)* */ 411 private List< AbsDecl> AbsGoBackInATrait =411 private List<Decl> AbsGoBackInATrait = 412 412 a1:AbsGoesBackInATrait a2s:(br AbsGoesBackInATrait)* 413 413 { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 414 414 415 415 /* AbsGoesBackInATrait ::= AbsMdDecl | PropertyDecl */ 416 private AbsDecl AbsGoesBackInATrait =416 private Decl AbsGoesBackInATrait = 417 417 AbsMdDecl 418 418 / PropertyDecl ; … … 429 429 " has the different name " + a4 + " at the end."); 430 430 if (a1 == null) a1 = FortressUtil.emptyModifiers(); 431 if (a3 == null) a3 = Collections.< AbsDecl>emptyList();431 if (a3 == null) a3 = Collections.<Decl>emptyList(); 432 432 FnHeaderClause fhc = a2.getFnHeaderClause(); 433 433 Option<Contract> contract = fhc.getContractClause(); … … 445 445 | AbsCoercions 446 446 */ 447 List< AbsDecl> AbsGoInAnObject =447 List<Decl> AbsGoInAnObject = 448 448 a1:AbsCoercions 449 { yyValue = new ArrayList< AbsDecl>();449 { yyValue = new ArrayList<Decl>(); 450 450 yyValue.addAll(a1); 451 451 } … … 471 471 } 472 472 / a1:(AbsCoercions br)? a2:AbsGoFrontInAnObject a3:(br AbsGoBackInAnObject)? 473 { yyValue = new ArrayList< AbsDecl>();473 { yyValue = new ArrayList<Decl>(); 474 474 if (a1 != null) yyValue.addAll(a1); 475 475 yyValue.addAll(a2); … … 477 477 } 478 478 / a1:(AbsCoercions br)? a2:AbsGoBackInAnObject 479 { yyValue = new ArrayList< AbsDecl>();479 { yyValue = new ArrayList<Decl>(); 480 480 if (a1 != null) yyValue.addAll(a1); 481 481 yyValue.addAll(a2); … … 485 485 AbsGoesFrontInAnObject (br AbsGoesFrontInAnObject)* 486 486 */ 487 private List< AbsDecl> AbsGoFrontInAnObject =487 private List<Decl> AbsGoFrontInAnObject = 488 488 a1:AbsGoesFrontInAnObject a2s:(br AbsGoesFrontInAnObject)* 489 489 { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 490 490 491 491 /* AbsGoesFrontInAnObject ::= ApiFldDecl | AbsGetterSetterDecl | PropertyDecl */ 492 private AbsDecl AbsGoesFrontInAnObject =492 private Decl AbsGoesFrontInAnObject = 493 493 ApiFldDecl 494 494 / AbsGetterSetterDecl … … 496 496 497 497 /* AbsGoBackInAnObject ::= AbsGoesBackInAnObject (br AbsGoesBackInAnObject)* */ 498 private List< AbsDecl> AbsGoBackInAnObject =498 private List<Decl> AbsGoBackInAnObject = 499 499 a1:AbsGoesBackInAnObject a2s:(br AbsGoesBackInAnObject)* 500 500 { yyValue = FortressUtil.mkList(a1, a2s.list()); }; 501 501 502 502 /* AbsGoesBackInAnObject ::= AbsMdDecl | PropertyDecl */ 503 private AbsDecl AbsGoesBackInAnObject =503 private Decl AbsGoesBackInAnObject = 504 504 AbsMdDecl 505 505 / PropertyDecl ; -
trunk/ProjectFortress/src/com/sun/fortress/parser/preparser/PreCompilation.rats
r3078 r3093 50 50 / w a1:Imports w semicolon? w (_)* 51 51 { if (a1 == null) a1 = Collections.<Import>emptyList(); 52 List< AbsDecl> a2 = Collections.<AbsDecl>emptyList();52 List<Decl> a2 = Collections.<Decl>emptyList(); 53 53 Span span = createSpan(yyStart,yyCount); 54 54 String file = span.begin.getFileName(); … … 69 69 APIName name = NodeFactory.makeAPINameFromPath(span, file, "\\."); 70 70 yyValue = new Api(span, name, Collections.<Import>emptyList(), 71 Collections.< AbsDecl>emptyList());71 Collections.<Decl>emptyList()); 72 72 }; 73 73 … … 109 109 / api w a1:APIName a2:(w yyValue:Imports w semicolon?)? w (_)* 110 110 { if (a2 == null) a2 = Collections.<Import>emptyList(); 111 List< AbsDecl> a3 = Collections.<AbsDecl>emptyList();111 List<Decl> a3 = Collections.<Decl>emptyList(); 112 112 Span span = createSpan(yyStart,yyCount); 113 113 yyValue = new Api(span, a1, a2, a3); -
trunk/ProjectFortress/src/com/sun/fortress/tools/FortressAstToConcrete.java
r3092 r3093 418 418 } 419 419 420 public List<String> myRecurOnListOf AbsDecl(List<AbsDecl> that) {420 public List<String> myRecurOnListOfDecl(List<Decl> that) { 421 421 boolean sawField = false; 422 422 boolean sawGetterSetter = false; 423 423 List<String> accum = new java.util.ArrayList<String>(that.size()); 424 for ( AbsDecl elt : that) {424 for (Decl elt : that) { 425 425 if ( elt instanceof AbsVarDecl ) { 426 426 sawField = true; … … 452 452 List<String> excludes_result = recurOnListOfBaseType(that.getExcludes()); 453 453 Option<List<String>> comprises_result = recurOnOptionOfListOfBaseType(that.getComprises()); 454 List<String> decls_result = myRecurOnListOf AbsDecl(that.getDecls());454 List<String> decls_result = myRecurOnListOfDecl(that.getDecls()); 455 455 return forAbsTraitDeclOnly(that, mods_result, name_result, 456 456 staticParams_result, extendsClause_result, … … 544 544 Option<List<String>> throwsClause_result = recurOnOptionOfListOfBaseType(that.getThrowsClause()); 545 545 Option<String> contract_result = recurOnOptionOfContract(that.getContract()); 546 List<String> decls_result = myRecurOnListOf AbsDecl(that.getDecls());546 List<String> decls_result = myRecurOnListOfDecl(that.getDecls()); 547 547 return forAbsObjectDeclOnly(that, mods_result, name_result, 548 548 staticParams_result, extendsClause_result,

