use of com.oracle.truffle.dsl.processor.java.model.CodeTypeParameterElement in project graal by oracle.
the class FlatNodeGenFactory method createInsertAccessor.
private CodeExecutableElement createInsertAccessor(boolean array) {
CodeTypeParameterElement tVar = new CodeTypeParameterElement("T", context.getType(Node.class));
TypeMirror type = tVar.createMirror(null, null);
if (array) {
type = new ArrayCodeTypeMirror(type);
}
CodeExecutableElement insertAccessor = new CodeExecutableElement(modifiers(FINAL), type, INSERT_ACCESSOR_NAME);
insertAccessor.getParameters().add(new CodeVariableElement(type, "node"));
insertAccessor.getTypeParameters().add(tVar);
insertAccessor.createBuilder().startReturn().string("super.insert(node)").end();
return insertAccessor;
}
Aggregations