Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/AbstractParser.java @ 8252:0905d796944a
Refactored codegen error model to make error redirection a lot easier.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 13 Mar 2013 19:58:28 +0100 |
parents | 5e3d1a68664e |
children | 160f088e40db |
comparison
equal
deleted
inserted
replaced
8251:cb70ed101b5f | 8252:0905d796944a |
---|---|
56 } | 56 } |
57 | 57 |
58 if (!context.getTruffleTypes().verify(context, element, mirror)) { | 58 if (!context.getTruffleTypes().verify(context, element, mirror)) { |
59 return null; | 59 return null; |
60 } | 60 } |
61 return parse(element, mirror); | 61 M model = parse(element, mirror); |
62 if (model == null) { | |
63 return null; | |
64 } | |
65 | |
66 model.emitMessages((TypeElement) element, log); | |
67 return filterErrorElements(model); | |
62 } finally { | 68 } finally { |
63 this.roundEnv = null; | 69 this.roundEnv = null; |
64 } | 70 } |
71 } | |
72 | |
73 protected M filterErrorElements(M model) { | |
74 return model.hasErrors() ? null : model; | |
65 } | 75 } |
66 | 76 |
67 protected abstract M parse(Element element, AnnotationMirror mirror); | 77 protected abstract M parse(Element element, AnnotationMirror mirror); |
68 | 78 |
69 public abstract Class<? extends Annotation> getAnnotationType(); | 79 public abstract Class<? extends Annotation> getAnnotationType(); |