source: default/v2/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src-gen/de/ugoe/cs/swe/bnftools/ui/contentassist/antlr/PartialEbnfContentAssistParser.java @ 97

Last change on this file since 97 was 61, checked in by hkaulbersch, 10 years ago

initial commit

  • Property svn:mime-type set to text/plain
File size: 1.3 KB
Line 
1/*
2 * generated by Xtext
3 */
4package de.ugoe.cs.swe.bnftools.ui.contentassist.antlr;
5
6import java.util.Collection;
7import java.util.Collections;
8
9import org.eclipse.xtext.AbstractRule;
10import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser;
11import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement;
12import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
13import org.eclipse.xtext.util.PolymorphicDispatcher;
14
15/**
16 * @author Sebastian Zarnekow - Initial contribution and API
17 */
18@SuppressWarnings("restriction")
19public class PartialEbnfContentAssistParser extends EbnfParser implements IPartialContentAssistParser {
20
21        private AbstractRule rule;
22
23        public void initializeFor(AbstractRule rule) {
24                this.rule = rule;
25        }
26       
27        @Override
28        protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
29                if (rule == null || rule.eIsProxy())
30                        return Collections.emptyList();
31                String methodName = "entryRule" + rule.getName();
32                PolymorphicDispatcher<Collection<FollowElement>> dispatcher =
33                        new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser));
34                dispatcher.invoke();
35                return parser.getFollowElements();
36        }
37
38}
Note: See TracBrowser for help on using the repository browser.