Search in sources :

Example 1 with PrimitiveTypeImpl

use of org.eclipse.xtend.core.macro.declaration.PrimitiveTypeImpl in project xtext-xtend by eclipse.

the class CompilationUnitImpl method toType.

public Type toType(final JvmType delegate) {
    final Function1<JvmType, Type> _function = (JvmType it) -> {
        Type _switchResult = null;
        boolean _matched = false;
        if (delegate instanceof JvmDeclaredType) {
            _matched = true;
            _switchResult = this.toTypeDeclaration(((JvmDeclaredType) delegate));
        }
        if (!_matched) {
            if (delegate instanceof JvmTypeParameter) {
                _matched = true;
                _switchResult = this.toTypeParameterDeclaration(((JvmTypeParameter) delegate));
            }
        }
        if (!_matched) {
            if (delegate instanceof JvmVoid) {
                _matched = true;
                VoidTypeImpl _voidTypeImpl = new VoidTypeImpl();
                final Procedure1<VoidTypeImpl> _function_1 = (VoidTypeImpl it_1) -> {
                    it_1.setDelegate(((JvmVoid) delegate));
                    it_1.setCompilationUnit(this);
                };
                _switchResult = ObjectExtensions.<VoidTypeImpl>operator_doubleArrow(_voidTypeImpl, _function_1);
            }
        }
        if (!_matched) {
            if (delegate instanceof JvmPrimitiveType) {
                _matched = true;
                PrimitiveTypeImpl _primitiveTypeImpl = new PrimitiveTypeImpl();
                final Procedure1<PrimitiveTypeImpl> _function_1 = (PrimitiveTypeImpl it_1) -> {
                    it_1.setDelegate(((JvmPrimitiveType) delegate));
                    it_1.setCompilationUnit(this);
                };
                _switchResult = ObjectExtensions.<PrimitiveTypeImpl>operator_doubleArrow(_primitiveTypeImpl, _function_1);
            }
        }
        return _switchResult;
    };
    return this.<JvmType, Type>getOrCreate(delegate, _function);
}
Also used : PrimitiveTypeImpl(org.eclipse.xtend.core.macro.declaration.PrimitiveTypeImpl) JvmArrayType(org.eclipse.xtext.common.types.JvmArrayType) JvmEnumerationType(org.eclipse.xtext.common.types.JvmEnumerationType) JvmGenericType(org.eclipse.xtext.common.types.JvmGenericType) XtendAnnotationType(org.eclipse.xtend.core.xtend.XtendAnnotationType) JvmType(org.eclipse.xtext.common.types.JvmType) JvmComponentType(org.eclipse.xtext.common.types.JvmComponentType) JvmPrimitiveType(org.eclipse.xtext.common.types.JvmPrimitiveType) AccessorType(org.eclipse.xtend.lib.annotations.AccessorType) Type(org.eclipse.xtend.lib.macro.declaration.Type) JvmAnnotationType(org.eclipse.xtext.common.types.JvmAnnotationType) JvmDeclaredType(org.eclipse.xtext.common.types.JvmDeclaredType) JvmVoid(org.eclipse.xtext.common.types.JvmVoid) JvmTypeParameter(org.eclipse.xtext.common.types.JvmTypeParameter) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) JvmPrimitiveType(org.eclipse.xtext.common.types.JvmPrimitiveType) JvmDeclaredType(org.eclipse.xtext.common.types.JvmDeclaredType) VoidTypeImpl(org.eclipse.xtend.core.macro.declaration.VoidTypeImpl) JvmType(org.eclipse.xtext.common.types.JvmType)

Aggregations

PrimitiveTypeImpl (org.eclipse.xtend.core.macro.declaration.PrimitiveTypeImpl)1 VoidTypeImpl (org.eclipse.xtend.core.macro.declaration.VoidTypeImpl)1 XtendAnnotationType (org.eclipse.xtend.core.xtend.XtendAnnotationType)1 AccessorType (org.eclipse.xtend.lib.annotations.AccessorType)1 Type (org.eclipse.xtend.lib.macro.declaration.Type)1 JvmAnnotationType (org.eclipse.xtext.common.types.JvmAnnotationType)1 JvmArrayType (org.eclipse.xtext.common.types.JvmArrayType)1 JvmComponentType (org.eclipse.xtext.common.types.JvmComponentType)1 JvmDeclaredType (org.eclipse.xtext.common.types.JvmDeclaredType)1 JvmEnumerationType (org.eclipse.xtext.common.types.JvmEnumerationType)1 JvmGenericType (org.eclipse.xtext.common.types.JvmGenericType)1 JvmPrimitiveType (org.eclipse.xtext.common.types.JvmPrimitiveType)1 JvmType (org.eclipse.xtext.common.types.JvmType)1 JvmTypeParameter (org.eclipse.xtext.common.types.JvmTypeParameter)1 JvmVoid (org.eclipse.xtext.common.types.JvmVoid)1 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)1