All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.contextmapper.dsl.ide.contentassist.antlr.PartialContextMappingDSLContentAssistParser Maven / Gradle / Ivy

Go to download

Use the ContextMapper language server (LSP) to integrate the ContextMapper DSL within your IDE.

The newest version!
/*
 * generated by Xtext 2.32.0
 */
package org.contextmapper.dsl.ide.contentassist.antlr;

import java.util.Collection;
import java.util.Collections;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.ide.editor.contentassist.antlr.FollowElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
import org.eclipse.xtext.util.PolymorphicDispatcher;

public class PartialContextMappingDSLContentAssistParser extends ContextMappingDSLParser {

	private AbstractRule rule;

	@Override
	public void initializeFor(AbstractRule rule) {
		this.rule = rule;
	}

	@Override
	protected Collection getFollowElements(AbstractInternalContentAssistParser parser) {
		if (rule == null || rule.eIsProxy())
			return Collections.emptyList();
		String methodName = "entryRule" + rule.getName();
		PolymorphicDispatcher> dispatcher = 
			new PolymorphicDispatcher>(methodName, 0, 0, Collections.singletonList(parser));
		dispatcher.invoke();
		return parser.getFollowElements();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy