$search
00001 /* 00002 * generated by Xtext 00003 */ 00004 package org.best.of.robotics.ui.contentassist.antlr; 00005 00006 import java.util.Collection; 00007 import java.util.Collections; 00008 00009 import org.eclipse.xtext.AbstractRule; 00010 import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser; 00011 import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; 00012 import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; 00013 import org.eclipse.xtext.util.PolymorphicDispatcher; 00014 00018 public class PartialSmachDSLContentAssistParser extends SmachDSLParser implements IPartialContentAssistParser { 00019 00020 private AbstractRule rule; 00021 00022 public void initializeFor(AbstractRule rule) { 00023 this.rule = rule; 00024 } 00025 00026 @Override 00027 protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { 00028 if (rule == null || rule.eIsProxy()) 00029 return Collections.emptyList(); 00030 String methodName = "entryRule" + rule.getName(); 00031 PolymorphicDispatcher<Collection<FollowElement>> dispatcher = 00032 new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); 00033 dispatcher.invoke(); 00034 return parser.getFollowElements(); 00035 } 00036 00037 }