Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/typesystem/TypeSystemParser.java @ 11467:43eab069ca9b
Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 29 Aug 2013 19:19:00 +0200 |
parents | 4830676526e3 |
children | 2fb276f5e3e9 |
comparison
equal
deleted
inserted
replaced
11466:4830676526e3 | 11467:43eab069ca9b |
---|---|
82 typeSystem.setVoidType(voidType); | 82 typeSystem.setVoidType(voidType); |
83 | 83 |
84 verifyExclusiveMethodAnnotation(typeSystem, TypeCast.class, TypeCheck.class); | 84 verifyExclusiveMethodAnnotation(typeSystem, TypeCast.class, TypeCheck.class); |
85 | 85 |
86 List<Element> elements = new ArrayList<>(context.getEnvironment().getElementUtils().getAllMembers(templateType)); | 86 List<Element> elements = new ArrayList<>(context.getEnvironment().getElementUtils().getAllMembers(templateType)); |
87 | 87 List<ImplicitCastData> implicitCasts = new ImplicitCastParser(context, typeSystem).parse(elements); |
88 List<TypeCastData> casts = new TypeCastParser(context, typeSystem).parse(elements); | 88 List<TypeCastData> casts = new TypeCastParser(context, typeSystem).parse(elements); |
89 List<TypeCheckData> checks = new TypeCheckParser(context, typeSystem).parse(elements); | 89 List<TypeCheckData> checks = new TypeCheckParser(context, typeSystem).parse(elements); |
90 | 90 |
91 if (casts == null || checks == null) { | 91 if (casts == null || checks == null || implicitCasts == null) { |
92 return typeSystem; | |
93 } | |
94 typeSystem.setCasts(casts); | |
95 typeSystem.setChecks(checks); | |
96 | |
97 if (typeSystem.hasErrors()) { | |
92 return typeSystem; | 98 return typeSystem; |
93 } | 99 } |
94 | 100 |
95 for (TypeCheckData check : checks) { | 101 for (TypeCheckData check : checks) { |
96 check.getCheckedType().addTypeCheck(check); | 102 check.getCheckedType().addTypeCheck(check); |