public void completeCharacterClassAtom_Character(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(18)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(19)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(20)), context, acceptor); }
private boolean isAlternativeWithEmptyPath(AbstractElement abstractElement) { if (abstractElement instanceof Alternatives) { Alternatives alternatives = (Alternatives) abstractElement; for (AbstractElement path : alternatives.getElements()) { if (GrammarUtil.isOptionalCardinality(path)) return true; } } return false; }
public void completePatternCharacter_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(0)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(1)), context, acceptor); completeRuleCall(((RuleCall)((Alternatives)assignment.getTerminal()).getElements().get(2)), context, acceptor); // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override // subclasses may override }
/** * Returns the first keyword with the given value, or null if no such keyword is found. */ private ILeafNode doFindLeafWithKeyword(EObject semanticElement, String stopAtKeyword, ICompositeNode node, String keyWord, boolean commaAlternative, int hitNumber) { EObject grammarElement; int foundHits = 0; for (BidiTreeIterator<INode> iter = node.getAsTreeIterable().iterator(); iter.hasNext();) { INode child = iter.next(); EObject childSemElement = child.getSemanticElement(); if (child != node && childSemElement != null && childSemElement != semanticElement) { iter.prune(); } else if (child instanceof ILeafNode) { ILeafNode leaf = (ILeafNode) child; grammarElement = leaf.getGrammarElement(); if (grammarElement instanceof Keyword) { String value = ((Keyword) grammarElement).getValue(); if (stopAtKeyword.equals(value)) { return null; } if (keyWord.equals(value)) { if (grammarElement.eContainer() instanceof Alternatives) { AbstractElement first = ((Alternatives) (grammarElement.eContainer())).getElements().get(0); boolean inCommaAlternative = (first instanceof Keyword && ",".equals(((Keyword) first) .getValue())); if (inCommaAlternative == commaAlternative) { foundHits++; if (foundHits >= hitNumber) { return leaf; } } } else { if (!commaAlternative) { foundHits++; if (foundHits >= hitNumber) { return leaf; } } } } } } } return null; }
public Alternatives getAlternatives() { return cAlternatives; }
public Alternatives getAlternatives_1() { return cAlternatives_1; }
public Alternatives getAlternatives_7() { return cAlternatives_7; }
public Alternatives getAlternatives_1_1_0() { return cAlternatives_1_1_0; }
public Alternatives getAlternatives_0_0_1() { return cAlternatives_0_0_1; }
public Alternatives getAlternatives_0_0_3() { return cAlternatives_0_0_3; }
public Alternatives getAlternatives_0_1() { return cAlternatives_0_1; }