org.eclipse.xtext.common.types.JvmLowerBound Java Examples
The following examples show how to use
org.eclipse.xtext.common.types.JvmLowerBound.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractTypeProviderTest.java From xtext-extras with Eclipse Public License 2.0 | 6 votes |
@Test public void test_ParameterizedTypes_03() { String typeName = ParameterizedTypes.class.getName(); JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName); JvmOperation methodT = getMethodFromType(type, ParameterizedTypes.class, "methodT(T)"); JvmTypeReference listS = methodT.getReturnType(); assertFalse(listS.toString(), listS.eIsProxy()); assertEquals("java.util.List<? extends java.lang.Object & super T>", listS.getIdentifier()); JvmParameterizedTypeReference listType = (JvmParameterizedTypeReference) listS; assertEquals(1, listType.getArguments().size()); JvmTypeReference typeArgument = listType.getArguments().get(0); assertTrue(typeArgument instanceof JvmWildcardTypeReference); JvmWildcardTypeReference wildcardTypeArgument = (JvmWildcardTypeReference) typeArgument; assertEquals("? extends java.lang.Object & super T", wildcardTypeArgument.getIdentifier()); assertEquals(2, wildcardTypeArgument.getConstraints().size()); JvmUpperBound uperBound = (JvmUpperBound) wildcardTypeArgument.getConstraints().get(0); assertEquals("java.lang.Object", uperBound.getTypeReference().getIdentifier()); JvmLowerBound lowerBound = (JvmLowerBound) wildcardTypeArgument.getConstraints().get(1); JvmTypeParameter t = type.getTypeParameters().get(1); assertSame(t, lowerBound.getTypeReference().getType()); }
Example #2
Source File: AbstractTypeProviderTest.java From xtext-extras with Eclipse Public License 2.0 | 6 votes |
@Test public void test_ParameterizedTypes_05() { String typeName = ParameterizedTypes.class.getName(); JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName); JvmOperation methodZ = getMethodFromType(type, ParameterizedTypes.class, "methodZ(java.util.List)"); assertEquals(1, methodZ.getParameters().size()); assertEquals(1, methodZ.getTypeParameters().size()); assertEquals("Z", methodZ.getTypeParameters().get(0).getIdentifier()); JvmTypeReference listZ = methodZ.getReturnType(); assertFalse(listZ.toString(), listZ.getType().eIsProxy()); assertEquals("java.util.List<? extends java.lang.Object & super Z>", listZ.getIdentifier()); JvmParameterizedTypeReference listType = (JvmParameterizedTypeReference) listZ; assertEquals(1, listType.getArguments().size()); JvmTypeReference typeArgument = listType.getArguments().get(0); assertTrue(typeArgument instanceof JvmWildcardTypeReference); JvmWildcardTypeReference wildcardTypeArgument = (JvmWildcardTypeReference) typeArgument; assertEquals("? extends java.lang.Object & super Z", wildcardTypeArgument.getIdentifier()); assertEquals(2, wildcardTypeArgument.getConstraints().size()); JvmUpperBound upperBound = (JvmUpperBound) wildcardTypeArgument.getConstraints().get(0); assertEquals("java.lang.Object", upperBound.getTypeReference().getIdentifier()); JvmLowerBound lowerBound = (JvmLowerBound) wildcardTypeArgument.getConstraints().get(1); assertEquals("Z", lowerBound.getTypeReference().getIdentifier()); JvmTypeParameter z = methodZ.getTypeParameters().get(0); assertSame(z, lowerBound.getTypeReference().getType()); }
Example #3
Source File: AbstractTypeProviderTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
@Test public void test_ParameterizedTypes_05() { String typeName = ParameterizedTypes.class.getName(); JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName); JvmOperation methodZ = getMethodFromType(type, ParameterizedTypes.class, "methodZ(java.util.List)"); assertEquals(1, methodZ.getParameters().size()); assertEquals(1, methodZ.getTypeParameters().size()); assertEquals("Z", methodZ.getTypeParameters().get(0).getIdentifier()); JvmTypeReference listZ = methodZ.getReturnType(); assertFalse(listZ.toString(), listZ.getType().eIsProxy()); assertEquals("java.util.List<? extends java.lang.Object & super Z>", listZ.getIdentifier()); JvmParameterizedTypeReference listType = (JvmParameterizedTypeReference) listZ; assertEquals(1, listType.getArguments().size()); JvmTypeReference typeArgument = listType.getArguments().get(0); assertTrue(typeArgument instanceof JvmWildcardTypeReference); JvmWildcardTypeReference wildcardTypeArgument = (JvmWildcardTypeReference) typeArgument; assertEquals("? extends java.lang.Object & super Z", wildcardTypeArgument.getIdentifier()); assertEquals(2, wildcardTypeArgument.getConstraints().size()); JvmUpperBound upperBound = (JvmUpperBound) wildcardTypeArgument.getConstraints().get(0); assertEquals("java.lang.Object", upperBound.getTypeReference().getIdentifier()); JvmLowerBound lowerBound = (JvmLowerBound) wildcardTypeArgument.getConstraints().get(1); assertEquals("Z", lowerBound.getTypeReference().getIdentifier()); JvmTypeParameter z = methodZ.getTypeParameters().get(0); assertSame(z, lowerBound.getTypeReference().getType()); }
Example #4
Source File: AbstractTypeProviderTest.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
@Test public void test_ParameterizedTypes_03() { String typeName = ParameterizedTypes.class.getName(); JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName); JvmOperation methodT = getMethodFromType(type, ParameterizedTypes.class, "methodT(T)"); JvmTypeReference listS = methodT.getReturnType(); assertFalse(listS.toString(), listS.eIsProxy()); assertEquals("java.util.List<? extends java.lang.Object & super T>", listS.getIdentifier()); JvmParameterizedTypeReference listType = (JvmParameterizedTypeReference) listS; assertEquals(1, listType.getArguments().size()); JvmTypeReference typeArgument = listType.getArguments().get(0); assertTrue(typeArgument instanceof JvmWildcardTypeReference); JvmWildcardTypeReference wildcardTypeArgument = (JvmWildcardTypeReference) typeArgument; assertEquals("? extends java.lang.Object & super T", wildcardTypeArgument.getIdentifier()); assertEquals(2, wildcardTypeArgument.getConstraints().size()); JvmUpperBound uperBound = (JvmUpperBound) wildcardTypeArgument.getConstraints().get(0); assertEquals("java.lang.Object", uperBound.getTypeReference().getIdentifier()); JvmLowerBound lowerBound = (JvmLowerBound) wildcardTypeArgument.getConstraints().get(1); JvmTypeParameter t = type.getTypeParameters().get(1); assertSame(t, lowerBound.getTypeReference().getType()); }
Example #5
Source File: AbstractTypeProviderTest.java From xtext-extras with Eclipse Public License 2.0 | 6 votes |
@Test public void test_ParameterizedTypes_03() { String typeName = ParameterizedTypes.class.getName(); JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName); JvmOperation methodT = getMethodFromType(type, ParameterizedTypes.class, "methodT(T)"); JvmTypeReference listS = methodT.getReturnType(); assertFalse(listS.toString(), listS.eIsProxy()); assertEquals("java.util.List<? extends java.lang.Object & super T>", listS.getIdentifier()); JvmParameterizedTypeReference listType = (JvmParameterizedTypeReference) listS; assertEquals(1, listType.getArguments().size()); JvmTypeReference typeArgument = listType.getArguments().get(0); assertTrue(typeArgument instanceof JvmWildcardTypeReference); JvmWildcardTypeReference wildcardTypeArgument = (JvmWildcardTypeReference) typeArgument; assertEquals("? extends java.lang.Object & super T", wildcardTypeArgument.getIdentifier()); assertEquals(2, wildcardTypeArgument.getConstraints().size()); JvmUpperBound uperBound = (JvmUpperBound) wildcardTypeArgument.getConstraints().get(0); assertEquals("java.lang.Object", uperBound.getTypeReference().getIdentifier()); JvmLowerBound lowerBound = (JvmLowerBound) wildcardTypeArgument.getConstraints().get(1); JvmTypeParameter t = type.getTypeParameters().get(1); assertSame(t, lowerBound.getTypeReference().getType()); }
Example #6
Source File: AbstractTypeProviderTest.java From xtext-extras with Eclipse Public License 2.0 | 6 votes |
@Test public void test_ParameterizedTypes_05() { String typeName = ParameterizedTypes.class.getName(); JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName); JvmOperation methodZ = getMethodFromType(type, ParameterizedTypes.class, "methodZ(java.util.List)"); assertEquals(1, methodZ.getParameters().size()); assertEquals(1, methodZ.getTypeParameters().size()); assertEquals("Z", methodZ.getTypeParameters().get(0).getIdentifier()); JvmTypeReference listZ = methodZ.getReturnType(); assertFalse(listZ.toString(), listZ.getType().eIsProxy()); assertEquals("java.util.List<? extends java.lang.Object & super Z>", listZ.getIdentifier()); JvmParameterizedTypeReference listType = (JvmParameterizedTypeReference) listZ; assertEquals(1, listType.getArguments().size()); JvmTypeReference typeArgument = listType.getArguments().get(0); assertTrue(typeArgument instanceof JvmWildcardTypeReference); JvmWildcardTypeReference wildcardTypeArgument = (JvmWildcardTypeReference) typeArgument; assertEquals("? extends java.lang.Object & super Z", wildcardTypeArgument.getIdentifier()); assertEquals(2, wildcardTypeArgument.getConstraints().size()); JvmUpperBound upperBound = (JvmUpperBound) wildcardTypeArgument.getConstraints().get(0); assertEquals("java.lang.Object", upperBound.getTypeReference().getIdentifier()); JvmLowerBound lowerBound = (JvmLowerBound) wildcardTypeArgument.getConstraints().get(1); assertEquals("Z", lowerBound.getTypeReference().getIdentifier()); JvmTypeParameter z = methodZ.getTypeParameters().get(0); assertSame(z, lowerBound.getTypeReference().getType()); }
Example #7
Source File: PureXbaseSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBound returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBound(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #8
Source File: JvmTypeReferences.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
public JvmParameterizedTypeReferenceConstructor wildCardSuper(String qualifiedName) { JvmWildcardTypeReference argument = typesFactory.createJvmWildcardTypeReference(); JvmLowerBound upperBound = typesFactory.createJvmLowerBound(); argument.getConstraints().add(upperBound); JvmParameterizedTypeReferenceConstructor constructor = new JvmParameterizedTypeReferenceConstructor(qualifiedName, typesFactory, typesProvider, this); upperBound.setTypeReference(constructor.getReference()); reference.getArguments().add(argument); return constructor; }
Example #9
Source File: XImportSectionTestLangSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBound returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBound(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #10
Source File: XImportSectionTestLangSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBoundAnded returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBoundAnded(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #11
Source File: ContentAssistFragmentTestLangSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBound returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBound(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #12
Source File: ContentAssistFragmentTestLangSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBoundAnded returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBoundAnded(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #13
Source File: Bug462047LangSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBound returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBound(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #14
Source File: Bug462047LangSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBoundAnded returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBoundAnded(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #15
Source File: TypeReferences.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
public JvmWildcardTypeReference wildCardSuper(JvmTypeReference clone) { JvmWildcardTypeReference result = factory.createJvmWildcardTypeReference(); JvmLowerBound lowerBound = factory.createJvmLowerBound(); lowerBound.setTypeReference(clone); JvmUpperBound upperBound = factory.createJvmUpperBound(); upperBound.setTypeReference(getTypeForName(Object.class, clone.getType())); result.getConstraints().add(lowerBound); result.getConstraints().add(upperBound); return result; }
Example #16
Source File: JvmTypeReferenceBuilderTest.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
@Test public void testWildcard_03() { List<JvmTypeConstraint> constraints = ((JvmWildcardTypeReference) typeReferenceBuilder .wildcardSuper(typeReferenceBuilder.typeRef(CharSequence.class))).getConstraints(); Assert.assertEquals(2, constraints.size()); Assert.assertEquals("java.lang.CharSequence", Iterables.getFirst(Iterables.filter(constraints, JvmLowerBound.class), null).getTypeReference().getIdentifier()); }
Example #17
Source File: JvmTypeReferences.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
public JvmParameterizedTypeReferenceConstructor wildCardSuper(String qualifiedName) { JvmWildcardTypeReference argument = typesFactory.createJvmWildcardTypeReference(); JvmLowerBound upperBound = typesFactory.createJvmLowerBound(); argument.getConstraints().add(upperBound); JvmParameterizedTypeReferenceConstructor constructor = new JvmParameterizedTypeReferenceConstructor(qualifiedName, typesFactory, typesProvider, this); upperBound.setTypeReference(constructor.getReference()); reference.getArguments().add(argument); return constructor; }
Example #18
Source File: AbstractXtypeSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBound returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBound(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #19
Source File: AbstractXtypeSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBoundAnded returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBoundAnded(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #20
Source File: PureXbaseSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * Contexts: * JvmLowerBoundAnded returns JvmLowerBound * * Constraint: * typeReference=JvmTypeReference */ protected void sequence_JvmLowerBoundAnded(ISerializationContext context, JvmLowerBound semanticObject) { if (errorAcceptor != null) { if (transientValues.isValueTransient(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TypesPackage.Literals.JVM_TYPE_CONSTRAINT__TYPE_REFERENCE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); feeder.accept(grammarAccess.getJvmLowerBoundAndedAccess().getTypeReferenceJvmTypeReferenceParserRuleCall_1_0(), semanticObject.getTypeReference()); feeder.finish(); }
Example #21
Source File: AbstractXtypeSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 4 votes |
@Deprecated protected void sequence_JvmLowerBound(EObject context, JvmLowerBound semanticObject) { sequence_JvmLowerBound(createContext(context, semanticObject), semanticObject); }
Example #22
Source File: AbstractXtypeSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 4 votes |
@Deprecated protected void sequence_JvmLowerBoundAnded(EObject context, JvmLowerBound semanticObject) { sequence_JvmLowerBoundAnded(createContext(context, semanticObject), semanticObject); }
Example #23
Source File: AbstractXtypeSemanticSequencer.java From xtext-extras with Eclipse Public License 2.0 | 4 votes |
@Override public void sequence(ISerializationContext context, EObject semanticObject) { EPackage epackage = semanticObject.eClass().getEPackage(); ParserRule rule = context.getParserRule(); Action action = context.getAssignedAction(); Set<Parameter> parameters = context.getEnabledBooleanParameters(); if (epackage == TypesPackage.eINSTANCE) switch (semanticObject.eClass().getClassifierID()) { case TypesPackage.JVM_GENERIC_ARRAY_TYPE_REFERENCE: sequence_JvmTypeReference(context, (JvmGenericArrayTypeReference) semanticObject); return; case TypesPackage.JVM_INNER_TYPE_REFERENCE: sequence_JvmParameterizedTypeReference(context, (JvmInnerTypeReference) semanticObject); return; case TypesPackage.JVM_LOWER_BOUND: if (rule == grammarAccess.getJvmLowerBoundAndedRule()) { sequence_JvmLowerBoundAnded(context, (JvmLowerBound) semanticObject); return; } else if (rule == grammarAccess.getJvmLowerBoundRule()) { sequence_JvmLowerBound(context, (JvmLowerBound) semanticObject); return; } else break; case TypesPackage.JVM_PARAMETERIZED_TYPE_REFERENCE: if (action == grammarAccess.getJvmParameterizedTypeReferenceAccess().getJvmInnerTypeReferenceOuterAction_1_4_0_0_0()) { sequence_JvmParameterizedTypeReference_JvmInnerTypeReference_1_4_0_0_0(context, (JvmParameterizedTypeReference) semanticObject); return; } else if (rule == grammarAccess.getJvmTypeReferenceRule() || action == grammarAccess.getJvmTypeReferenceAccess().getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0() || rule == grammarAccess.getJvmParameterizedTypeReferenceRule() || rule == grammarAccess.getJvmArgumentTypeReferenceRule()) { sequence_JvmParameterizedTypeReference(context, (JvmParameterizedTypeReference) semanticObject); return; } else break; case TypesPackage.JVM_TYPE_PARAMETER: sequence_JvmTypeParameter(context, (JvmTypeParameter) semanticObject); return; case TypesPackage.JVM_UPPER_BOUND: if (rule == grammarAccess.getJvmUpperBoundAndedRule()) { sequence_JvmUpperBoundAnded(context, (JvmUpperBound) semanticObject); return; } else if (rule == grammarAccess.getJvmUpperBoundRule()) { sequence_JvmUpperBound(context, (JvmUpperBound) semanticObject); return; } else break; case TypesPackage.JVM_WILDCARD_TYPE_REFERENCE: sequence_JvmWildcardTypeReference(context, (JvmWildcardTypeReference) semanticObject); return; } else if (epackage == XtypePackage.eINSTANCE) switch (semanticObject.eClass().getClassifierID()) { case XtypePackage.XFUNCTION_TYPE_REF: sequence_XFunctionTypeRef(context, (XFunctionTypeRef) semanticObject); return; case XtypePackage.XIMPORT_DECLARATION: sequence_XImportDeclaration(context, (XImportDeclaration) semanticObject); return; case XtypePackage.XIMPORT_SECTION: sequence_XImportSection(context, (XImportSection) semanticObject); return; } if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context)); }
Example #24
Source File: TypeParameterBuilderImpl.java From sarl with Apache License 2.0 | 4 votes |
/** Add lower type bounds. * @param type the type. */ public void addLowerConstraint(String type) { final JvmLowerBound constraint = this.jvmTypesFactory.createJvmLowerBound(); constraint.setTypeReference(newTypeRef(this.context, type)); getJvmTypeParameter().getConstraints().add(constraint); }