Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/ast/CodeElement.java @ 7502:6343a09b2ec1
Codegen operation generation is inferred from the node type hierarchy.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 18 Jan 2013 13:28:12 +0100 |
parents | a748e4d44694 |
children | 5e3d1a68664e |
comparison
equal
deleted
inserted
replaced
7497:0f8c6dbf68be | 7502:6343a09b2ec1 |
---|---|
117 public void removeAnnotationMirror(AnnotationMirror annotationMirror) { | 117 public void removeAnnotationMirror(AnnotationMirror annotationMirror) { |
118 getAnnotationMirrors().remove(annotationMirror); | 118 getAnnotationMirrors().remove(annotationMirror); |
119 } | 119 } |
120 | 120 |
121 void setEnclosingElement(Element parent) { | 121 void setEnclosingElement(Element parent) { |
122 if (this.enclosingElement != null && parent != null) { | |
123 throw new IllegalStateException("Element already added to " + parent); | |
124 } | |
125 this.enclosingElement = parent; | 122 this.enclosingElement = parent; |
126 } | 123 } |
127 | 124 |
128 public Element getEnclosingElement() { | 125 public Element getEnclosingElement() { |
129 return enclosingElement; | 126 return enclosingElement; |
159 @Override | 156 @Override |
160 protected Writer createWriter(CodeTypeElement clazz) throws IOException { | 157 protected Writer createWriter(CodeTypeElement clazz) throws IOException { |
161 return writer; | 158 return writer; |
162 } | 159 } |
163 public String getString() { | 160 public String getString() { |
164 return new String(((CharArrayWriter) writer).toCharArray()); | 161 return new String(((CharArrayWriter) writer).toCharArray()).trim(); |
165 } | 162 } |
166 | 163 |
167 } | 164 } |
168 | 165 |
169 | 166 |