Search in sources :

Example 6 with PropertyBuilder

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

the class LayoutParser method parseShapeConstructor.

private void parseShapeConstructor(ExecutableElement methodElement) {
    List<? extends VariableElement> parameters = methodElement.getParameters();
    if (!parameters.isEmpty()) {
        hasShapeProperties = true;
    }
    if (superLayout != null) {
        final List<PropertyModel> superShapeProperties = superLayout.getAllShapeProperties();
        checkSharedParameters(methodElement, parameters, superShapeProperties);
        parameters = parameters.subList(superShapeProperties.size(), parameters.size());
    }
    for (VariableElement element : parameters) {
        final String parameterName = element.getSimpleName().toString();
        constructorProperties.add(parameterName);
        final PropertyBuilder property = getProperty(parameterName);
        setPropertyType(element, property, element.asType());
        parseConstructorParameterAnnotations(property, element);
        property.setIsShapeProperty(true);
    }
}
Also used : PropertyModel(com.oracle.truffle.object.dsl.processor.model.PropertyModel) VariableElement(javax.lang.model.element.VariableElement) PropertyBuilder(com.oracle.truffle.object.dsl.processor.model.PropertyBuilder)

Example 7 with PropertyBuilder

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

the class LayoutParser method getProperty.

private PropertyBuilder getProperty(String propertyName) {
    PropertyBuilder builder = properties.get(propertyName);
    if (builder == null) {
        builder = new PropertyBuilder(propertyName);
        properties.put(propertyName, builder);
    }
    return builder;
}
Also used : PropertyBuilder(com.oracle.truffle.object.dsl.processor.model.PropertyBuilder)

Aggregations

PropertyBuilder (com.oracle.truffle.object.dsl.processor.model.PropertyBuilder)7 VariableElement (javax.lang.model.element.VariableElement)6 DynamicObject (com.oracle.truffle.api.object.DynamicObject)2 DynamicObjectFactory (com.oracle.truffle.api.object.DynamicObjectFactory)2 PropertyModel (com.oracle.truffle.object.dsl.processor.model.PropertyModel)2 TypeMirror (javax.lang.model.type.TypeMirror)2