Search in sources :

Example 11 with ParameterSpec

use of com.oracle.truffle.dsl.processor.model.ParameterSpec in project graal by oracle.

the class NodeMethodParser method addDefaultFieldMethodSpec.

protected void addDefaultFieldMethodSpec(MethodSpec methodSpec) {
    for (NodeFieldData field : getNode().getFields()) {
        if (field.getGetter() == null) {
            ParameterSpec spec = new ParameterSpec(field.getName(), field.getType());
            spec.setLocal(true);
            methodSpec.addOptional(spec);
        }
    }
}
Also used : NodeFieldData(com.oracle.truffle.dsl.processor.model.NodeFieldData) ParameterSpec(com.oracle.truffle.dsl.processor.model.ParameterSpec)

Aggregations

ParameterSpec (com.oracle.truffle.dsl.processor.model.ParameterSpec)11 MethodSpec (com.oracle.truffle.dsl.processor.model.MethodSpec)5 CodeVariableElement (com.oracle.truffle.dsl.processor.java.model.CodeVariableElement)3 TypeMirror (javax.lang.model.type.TypeMirror)3 Parameter (com.oracle.truffle.dsl.processor.model.Parameter)2 ArrayList (java.util.ArrayList)2 VariableElement (javax.lang.model.element.VariableElement)2 ArrayCodeTypeMirror (com.oracle.truffle.dsl.processor.java.model.CodeTypeMirror.ArrayCodeTypeMirror)1 NodeChildData (com.oracle.truffle.dsl.processor.model.NodeChildData)1 NodeFieldData (com.oracle.truffle.dsl.processor.model.NodeFieldData)1 SpecializationData (com.oracle.truffle.dsl.processor.model.SpecializationData)1 TemplateMethod (com.oracle.truffle.dsl.processor.model.TemplateMethod)1