protected boolean doCreateProposals() { return rule != null && !rule.eIsProxy() && rule instanceof ParserRule && !GrammarUtil.isDatatypeRule((ParserRule) rule); } }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
@Override protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) { if (rule == null || rule.eIsProxy()) return Collections.emptyList(); String methodName = "entryRule" + rule.getName(); PolymorphicDispatcher<Collection<FollowElement>> dispatcher = new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser)); dispatcher.invoke(); return parser.getFollowElements(); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AbstractRule getRule() { if (rule != null && rule.eIsProxy()) { InternalEObject oldRule = (InternalEObject)rule; rule = (AbstractRule)eResolveProxy(oldRule); if (rule != oldRule) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, XtextPackage.RULE_CALL__RULE, oldRule, rule)); } } return rule; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AbstractRule getContext() { if (context != null && context.eIsProxy()) { InternalEObject oldContext = (InternalEObject)context; context = (AbstractRule)eResolveProxy(oldContext); if (context != oldContext) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, TemplatesPackage.CODETEMPLATE__CONTEXT, oldContext, context)); } } return context; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AbstractRule getContext() { if (context != null && context.eIsProxy()) { InternalEObject oldContext = (InternalEObject)context; context = (AbstractRule)eResolveProxy(oldContext); if (context != oldContext) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, TemplatesPackage.CODETEMPLATE__CONTEXT, oldContext, context)); } } return context; }
AbstractRule rule = template.getContext(); ContextTypeIdHelper helper = languageRegistry.getContextTypeIdHelper(language); if (helper != null && rule != null && !rule.eIsProxy() && rule instanceof ParserRule) { String contextTypeId = helper.getId(rule); ContextTypeRegistry contextTypeRegistry = languageRegistry.getContextTypeRegistry(language);
@Check public void checkTerminalFragmentCalledFromTerminalRule(final RuleCall call) { if (call.getRule() != null && !call.getRule().eIsProxy()) { if (call.getRule() instanceof TerminalRule && ((TerminalRule) call.getRule()).isFragment()) { AbstractRule container = EcoreUtil2.getContainerOfType(call, AbstractRule.class); if (!(container instanceof TerminalRule)) { getMessageAcceptor().acceptError( "Only terminal rules may use terminal fragments.", call, XtextPackage.Literals.RULE_CALL__RULE, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, null); } } } }
@Check public void checkRuleCallInUnorderedGroup(final RuleCall call) { if (call.getRule() == null || call.getRule().eIsProxy() || !(call.getRule() instanceof ParserRule)) return; if (GrammarUtil.isDatatypeRule((ParserRule) call.getRule())) return; if (GrammarUtil.isAssigned(call)) return; if (EcoreUtil2.getContainerOfType(call, UnorderedGroup.class) != null) error( "Unassigned rule calls may not be used in unordered groups.", call, null, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, null); }
@Check public void checkUnassignedRuleCallAllowed(final RuleCall call) { if (call.getRule() != null && !call.getRule().eIsProxy() && GrammarUtil.containingAssignment(call) == null) { AbstractRule container = EcoreUtil2.getContainerOfType(call, AbstractRule.class); if (call.getRule() instanceof ParserRule) { if (container instanceof TerminalRule) { getMessageAcceptor().acceptError( "Cannot call parser rule from terminal rule.", call, XtextPackage.Literals.RULE_CALL__RULE, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, null); } else if (!GrammarUtil.isDatatypeRule((ParserRule) call.getRule())) checkCurrentMustBeUnassigned(call); } if (call.getRule() instanceof EnumRule) { if (container instanceof TerminalRule) { getMessageAcceptor().acceptError( "Cannot call enum rule from terminal rule.", call, XtextPackage.Literals.RULE_CALL__RULE, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, null); } } } }