Last change
on this file was
61,
checked in by hkaulbersch, 10 years ago
|
initial commit
|
-
Property svn:mime-type set to
text/plain
|
File size:
1.3 KB
|
Rev | Line | |
---|
[61] | 1 | /* |
---|
| 2 | * generated by Xtext |
---|
| 3 | */ |
---|
| 4 | package de.ugoe.cs.swe.bnftools.ui.contentassist.antlr; |
---|
| 5 | |
---|
| 6 | import java.util.Collection; |
---|
| 7 | import java.util.Collections; |
---|
| 8 | |
---|
| 9 | import org.eclipse.xtext.AbstractRule; |
---|
| 10 | import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser; |
---|
| 11 | import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; |
---|
| 12 | import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; |
---|
| 13 | import org.eclipse.xtext.util.PolymorphicDispatcher; |
---|
| 14 | |
---|
| 15 | /** |
---|
| 16 | * @author Sebastian Zarnekow - Initial contribution and API |
---|
| 17 | */ |
---|
| 18 | @SuppressWarnings("restriction") |
---|
| 19 | public 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.