org.eclipse.xtext.Parameter Java Examples

The following examples show how to use org.eclipse.xtext.Parameter. 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: EncodingTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == EncodingTestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case EncodingTestPackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		case EncodingTestPackage.WORD:
			sequence_Word(context, (Word) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #2
Source File: GrammarAccessTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == AsubpackagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case AsubpackagePackage.AMODEL:
			sequence_Root(context, (AModel) semanticObject); 
			return; 
		case AsubpackagePackage.ATYPE:
			sequence_AType(context, (AType) semanticObject); 
			return; 
		}
	else if (epackage == SubsubpackagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case SubsubpackagePackage.ANOTHER_TYPE:
			sequence_AnotherType(context, (AnotherType) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #3
Source File: RefactoringTestLanguage1SemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == RefactoringTestLanguagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case RefactoringTestLanguagePackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		case RefactoringTestLanguagePackage.REFERENCE_HOLDER:
			sequence_ReferenceHolder(context, (ReferenceHolder) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #4
Source File: ContentAssistTestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == ContentAssistTestLanguagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case ContentAssistTestLanguagePackage.GENERATE_DIRECTIVE:
			sequence_GenerateDirective(context, (GenerateDirective) semanticObject); 
			return; 
		case ContentAssistTestLanguagePackage.IMPORT:
			sequence_Import(context, (Import) semanticObject); 
			return; 
		case ContentAssistTestLanguagePackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		case ContentAssistTestLanguagePackage.REFERENCE_HOLDER:
			sequence_ReferenceHolder(context, (ReferenceHolder) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #5
Source File: GrammarAccessTestLanguageSemanticSequencer.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@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 == AsubpackagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case AsubpackagePackage.AMODEL:
			sequence_Root(context, (AModel) semanticObject); 
			return; 
		case AsubpackagePackage.ATYPE:
			sequence_AType(context, (AType) semanticObject); 
			return; 
		}
	else if (epackage == SubsubpackagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case SubsubpackagePackage.ANOTHER_TYPE:
			sequence_AnotherType(context, (AnotherType) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #6
Source File: BuilderTestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == BuilderTestLanguagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case BuilderTestLanguagePackage.ELEMENT:
			sequence_Element(context, (Element) semanticObject); 
			return; 
		case BuilderTestLanguagePackage.IMPORT:
			sequence_Import(context, (Import) semanticObject); 
			return; 
		case BuilderTestLanguagePackage.NAMESPACE:
			sequence_Namespace(context, (Namespace) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #7
Source File: AbstractSuperTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == SuperPackagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case SuperPackagePackage.ANOTHER_SUPER_MAIN:
			sequence_AnotherSuperMain(context, (AnotherSuperMain) semanticObject); 
			return; 
		case SuperPackagePackage.SUPER_MAIN:
			sequence_SuperMain(context, (SuperMain) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #8
Source File: AbstractTestLanguageSemanticSequencer.java    From dsl-devkit with Eclipse Public License 1.0 6 votes vote down vote up
@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 == TestLanguagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case TestLanguagePackage.GREETING:
			sequence_Greeting(context, (Greeting) semanticObject); 
			return; 
		case TestLanguagePackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #9
Source File: SerializationErrorTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == SerializationerrorPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case SerializationerrorPackage.INDENT:
			sequence_Indent(context, (Indent) semanticObject); 
			return; 
		case SerializationerrorPackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		case SerializationerrorPackage.TWO_OPTIONS:
			sequence_TwoOptions(context, (TwoOptions) semanticObject); 
			return; 
		case SerializationerrorPackage.TWO_REQUIRED:
			sequence_TwoRequired(context, (TwoRequired) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #10
Source File: NestedRefsTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == NestedRefsPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case NestedRefsPackage.DOC:
			sequence_Doc(context, (Doc) semanticObject); 
			return; 
		case NestedRefsPackage.SELF_REFERING_DECL:
			sequence_SelfReferingDecl(context, (SelfReferingDecl) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #11
Source File: TransientValuesTestSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == TransientvaluestestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case TransientvaluestestPackage.TEST_LIST:
			sequence_TestList(context, (TestList) semanticObject); 
			return; 
		case TransientvaluestestPackage.TEST_OPTIONAL:
			sequence_TestOptional(context, (TestOptional) semanticObject); 
			return; 
		case TransientvaluestestPackage.TEST_REQUIRED:
			sequence_TestRequired(context, (TestRequired) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #12
Source File: XmlSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == SimplexmlPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case SimplexmlPackage.ATTRIBUTE:
			sequence_Attribute(context, (Attribute) semanticObject); 
			return; 
		case SimplexmlPackage.CONTENT:
			sequence_Content(context, (Content) semanticObject); 
			return; 
		case SimplexmlPackage.TAG:
			sequence_Tag(context, (Tag) semanticObject); 
			return; 
		case SimplexmlPackage.XML_DOCUMENT:
			sequence_XmlDocument(context, (XmlDocument) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #13
Source File: Bug250313SemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == Bug250313Package.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case Bug250313Package.CHILD1:
			sequence_Child1(context, (Child1) semanticObject); 
			return; 
		case Bug250313Package.CHILD2:
			sequence_Child2(context, (Child2) semanticObject); 
			return; 
		case Bug250313Package.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #14
Source File: Ecore2XtextTestSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == Ecore2xtextPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case Ecore2xtextPackage.CONCRETE0:
			sequence_Concrete0_Impl(context, (Concrete0) semanticObject); 
			return; 
		case Ecore2xtextPackage.CONCRETE1:
			sequence_Concrete1_Impl(context, (Concrete1) semanticObject); 
			return; 
		case Ecore2xtextPackage.DIAMOND_INHERITANCE:
			sequence_DiamondInheritance(context, (DiamondInheritance) semanticObject); 
			return; 
		case Ecore2xtextPackage.ROOT:
			sequence_Root(context, (Root) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #15
Source File: RequiredRuleNameComputer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * @since 2.14
 */
protected String[][] getRequiredRuleNames(Param param, AbstractElement elementToParse) {
	if (elementToParse instanceof RuleCall) {
		RuleCall call = (RuleCall) elementToParse;
		if (call.getRule() instanceof ParserRule) {
			String antlrRuleName = ruleNames.getAntlrRuleName(call.getRule());
			if (!call.getArguments().isEmpty()) {
				Set<Parameter> context = param.getAssignedParametes();
				Set<Parameter> arguments = getAssignedArguments(call, context);
				int config = getParameterConfig(arguments);
				antlrRuleName = ruleNames.getAntlrRuleName(call.getRule(), config);
			}
			return new String[][] { { antlrRuleName } };
		}
	}
	return EMPTY_ARRAY;
}
 
Example #16
Source File: AntlrGrammarGenUtil.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * @since 2.9
 */
public static String getParameterList(ParserRule rule, Boolean skipCurrent, String currentType) {
	boolean currentAsParam = rule.isFragment() && !GrammarUtil.isDatatypeRule(getOriginalElement(rule));
	if ((skipCurrent || !currentAsParam) && rule.getParameters().isEmpty()) {
		return "";
	}
	StringBuilder result = new StringBuilder();
	result.append("[");
	if (!skipCurrent) {
		if (currentAsParam) {
			result.append(currentType).append(" in_current");
			if (!rule.getParameters().isEmpty()) {
				result.append(", ");
			}
		}
	}
	Joiner.on(", ").appendTo(result, Iterables.transform(rule.getParameters(), new Function<Parameter, String>() {
		@Override
		public String apply(Parameter input) {
			return "boolean p_" + input.getName();
		}
	}));
	result.append("] ");
	return result.toString();
}
 
Example #17
Source File: ImportUriUiTestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == ImportUriUiPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case ImportUriUiPackage.IMPORT:
			sequence_Import(context, (Import) semanticObject); 
			return; 
		case ImportUriUiPackage.MAIN:
			sequence_Main(context, (Main) semanticObject); 
			return; 
		case ImportUriUiPackage.TYPE:
			sequence_Type(context, (Type) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #18
Source File: HiddenTokenSequencerTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == HiddentokensequencertestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case HiddentokensequencertestPackage.DOMAIN_MODEL:
			sequence_DomainModel(context, (DomainModel) semanticObject); 
			return; 
		case HiddentokensequencertestPackage.ENTITY:
			sequence_Entity(context, (Entity) semanticObject); 
			return; 
		case HiddentokensequencertestPackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #19
Source File: InheritanceTest3LanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == InheritanceTestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case InheritanceTestPackage.ELEMENT:
			if (rule == grammarAccess.getInheritanceTestLanguageElementRule()) {
				sequence_Element(context, (Element) semanticObject); 
				return; 
			}
			else if (rule == grammarAccess.getElementRule()) {
				sequence_Element_Element(context, (Element) semanticObject); 
				return; 
			}
			else break;
		case InheritanceTestPackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #20
Source File: AbstractInheritanceTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == InheritanceTestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case InheritanceTestPackage.ELEMENT:
			sequence_Element(context, (Element) semanticObject); 
			return; 
		case InheritanceTestPackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #21
Source File: BmTestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == BracketmatchingPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case BracketmatchingPackage.ATOM:
			sequence_Atom(context, (Atom) semanticObject); 
			return; 
		case BracketmatchingPackage.FILE:
			sequence_File(context, (File) semanticObject); 
			return; 
		case BracketmatchingPackage.SEXPRESSION:
			sequence_SExpression(context, (SExpression) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #22
Source File: ActionTestLanguage2SemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == ActionLang2Package.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case ActionLang2Package.ORING:
			sequence_ORing(context, (ORing) semanticObject); 
			return; 
		case ActionLang2Package.VALUE:
			sequence_Value(context, (Value) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #23
Source File: CrossReferenceProposalTestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == CrossReferenceProposalTestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case CrossReferenceProposalTestPackage.CLASS:
			sequence_Class(context, (org.eclipse.xtext.ui.tests.editor.contentassist.crossReferenceProposalTest.Class) semanticObject); 
			return; 
		case CrossReferenceProposalTestPackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #24
Source File: ParserRuleImpl.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
	switch (featureID) {
		case XtextPackage.PARSER_RULE__DEFINES_HIDDEN_TOKENS:
			setDefinesHiddenTokens((Boolean)newValue);
			return;
		case XtextPackage.PARSER_RULE__HIDDEN_TOKENS:
			getHiddenTokens().clear();
			getHiddenTokens().addAll((Collection<? extends AbstractRule>)newValue);
			return;
		case XtextPackage.PARSER_RULE__PARAMETERS:
			getParameters().clear();
			getParameters().addAll((Collection<? extends Parameter>)newValue);
			return;
		case XtextPackage.PARSER_RULE__FRAGMENT:
			setFragment((Boolean)newValue);
			return;
		case XtextPackage.PARSER_RULE__WILDCARD:
			setWildcard((Boolean)newValue);
			return;
	}
	super.eSet(featureID, newValue);
}
 
Example #25
Source File: Bug377311TestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == Bug377311Package.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case Bug377311Package.CHILD:
			sequence_Child(context, (Child) semanticObject); 
			return; 
		case Bug377311Package.ROOT:
			sequence_Root(context, (Root) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #26
Source File: Bug291022TestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == Bug291022TestLanguagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case Bug291022TestLanguagePackage.ATTRIBUTE:
			sequence_Attribute(context, (Attribute) semanticObject); 
			return; 
		case Bug291022TestLanguagePackage.MODEL_ELEMENT:
			sequence_ModelElement(context, (ModelElement) semanticObject); 
			return; 
		case Bug291022TestLanguagePackage.ROOT_MODEL:
			sequence_RootModel(context, (RootModel) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #27
Source File: NamedArgumentImpl.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eUnset(int featureID) {
	switch (featureID) {
		case XtextPackage.NAMED_ARGUMENT__PARAMETER:
			setParameter((Parameter)null);
			return;
		case XtextPackage.NAMED_ARGUMENT__VALUE:
			setValue((Condition)null);
			return;
		case XtextPackage.NAMED_ARGUMENT__CALLED_BY_NAME:
			setCalledByName(CALLED_BY_NAME_EDEFAULT);
			return;
	}
	super.eUnset(featureID);
}
 
Example #28
Source File: IgnoreCaseImportsTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == IgnoreCaseImportsTestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case IgnoreCaseImportsTestPackage.IMPORT:
			sequence_Import(context, (Import) semanticObject); 
			return; 
		case IgnoreCaseImportsTestPackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	else if (epackage == IgnoreCaseLinkingTestPackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case IgnoreCaseLinkingTestPackage.ELEMENT:
			sequence_Element(context, (Element) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #29
Source File: FormatterTestLanguageSemanticSequencer.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@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 == FormattertestlanguagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case FormattertestlanguagePackage.ID_LIST:
			sequence_IDList(context, (IDList) semanticObject); 
			return; 
		case FormattertestlanguagePackage.KW_LIST:
			sequence_KWList(context, (KWList) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
 
Example #30
Source File: Bug381381TestLanguageSemanticSequencer.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@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 == Bug381381TestLanguagePackage.eINSTANCE)
		switch (semanticObject.eClass().getClassifierID()) {
		case Bug381381TestLanguagePackage.COPY_FIELD_NAME_TO_VARIABLE_STMT:
			sequence_CopyFieldNameToVariableStmt(context, (CopyFieldNameToVariableStmt) semanticObject); 
			return; 
		case Bug381381TestLanguagePackage.MODEL:
			sequence_Model(context, (Model) semanticObject); 
			return; 
		}
	if (errorAcceptor != null)
		errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}