Java 类org.eclipse.xtext.Alternatives 实例源码

项目:n4js    文件:AbstractRegularExpressionProposalProvider.java   
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);
}
项目:n4js    文件:PatchedFollowElementComputer.java   
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;
}
项目:n4js    文件:AbstractRegularExpressionProposalProvider.java   
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
}
项目:n4js    文件:N4JSSyntaxValidator.java   
/**
 * 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;
}
项目:OCCI-Studio    文件:OCCIGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:pokemon-tcgo-deck-generator    文件:PkmntcgoGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:pokemon-tcgo-deck-generator    文件:PkmntcgoGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:OCCI-Studio    文件:OCCIGrammarAccess.java   
public Alternatives getAlternatives_7() { return cAlternatives_7; }
项目:gemoc-studio    文件:DslGrammarAccess.java   
public Alternatives getAlternatives_1_1_0() { return cAlternatives_1_1_0; }
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:lcdsl    文件:LcDslGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:org.xtext.dsl.restaurante    文件:RestauranteGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:n4js    文件:N4JSGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives_0_0_1() { return cAlternatives_0_0_1; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives_0_0_3() { return cAlternatives_0_0_3; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:n4js    文件:N4JSGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives_0_0_1() { return cAlternatives_0_0_1; }
项目:n4js    文件:N4MFGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:N4JSGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypesGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:N4JSGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:N4JSGrammarAccess.java   
public Alternatives getAlternatives_0_1() { return cAlternatives_0_1; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:lcdsl    文件:LcDslGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:N4JSGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:OCCI-Studio    文件:OCCIGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }
项目:n4js    文件:N4JSGrammarAccess.java   
public Alternatives getAlternatives_1() { return cAlternatives_1; }
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public Alternatives getAlternatives() { return cAlternatives; }