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

项目:n4js    文件:TokenTypeRewriter.java   
private static void rewriteIdentifiers(N4JSGrammarAccess ga,
        ImmutableMap.Builder<AbstractElement, Integer> builder) {
    ImmutableSet<AbstractRule> identifierRules = ImmutableSet.of(
            ga.getBindingIdentifierRule(),
            ga.getIdentifierNameRule(),
            ga.getIDENTIFIERRule());
    for (ParserRule rule : GrammarUtil.allParserRules(ga.getGrammar())) {
        for (EObject obj : EcoreUtil2.eAllContents(rule.getAlternatives())) {
            if (obj instanceof Assignment) {
                Assignment assignment = (Assignment) obj;
                AbstractElement terminal = assignment.getTerminal();
                int type = InternalN4JSParser.RULE_IDENTIFIER;
                if (terminal instanceof CrossReference) {
                    terminal = ((CrossReference) terminal).getTerminal();
                    type = IDENTIFIER_REF_TOKEN;
                }
                if (terminal instanceof RuleCall) {
                    AbstractRule calledRule = ((RuleCall) terminal).getRule();
                    if (identifierRules.contains(calledRule)) {
                        builder.put(assignment, type);
                    }
                }
            }
        }
    }
}
项目:pokemon-tcgo-deck-generator    文件:PkmntcgoSemanticSequencer.java   
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == PkmntcgoPackage.eINSTANCE)
        switch (semanticObject.eClass().getClassifierID()) {
        case PkmntcgoPackage.CARD:
            sequence_Card(context, (Card) semanticObject); 
            return; 
        case PkmntcgoPackage.DECK:
            sequence_Deck(context, (Deck) semanticObject); 
            return; 
        case PkmntcgoPackage.DECKS:
            sequence_Decks(context, (Decks) semanticObject); 
            return; 
        case PkmntcgoPackage.ENERGY:
            sequence_Energy(context, (Energy) semanticObject); 
            return; 
        case PkmntcgoPackage.POKEMON:
            sequence_Pokemon(context, (Pokemon) semanticObject); 
            return; 
        case PkmntcgoPackage.TRAINER:
            sequence_Trainer(context, (Trainer) semanticObject); 
            return; 
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
项目:n4js    文件:TypesGrammarAccess.java   
public ParserRule getTypeAndTypeArgumentsRule() {
    return getTypeAndTypeArgumentsAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getFeatureCallIDRule() {
    return getFeatureCallIDAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getLogicalANDExpressionRule() {
    return getLogicalANDExpressionAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getPropertyGetterDeclarationRule() {
    return getPropertyGetterDeclarationAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getXCastedExpressionRule() {
    return getXCastedExpressionAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getParameterizedPropertyAccessExpressionTailRule() {
    return getParameterizedPropertyAccessExpressionTailAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getParameterizedTypeRefNominalRule() {
    return getParameterizedTypeRefNominalAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getXBlockExpressionRule() {
    return getXBlockExpressionAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getXMemberFeatureCallRule() {
    return getXMemberFeatureCallAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getXImportDeclarationRule() {
    return getXImportDeclarationAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getArrowFunctionTypeExpressionRule() {
    return getArrowFunctionTypeExpressionAccess().getRule();
}
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public ParserRule getTypeArgInTypeTypeRefRule() {
    return getTypeArgInTypeTypeRefAccess().getRule();
}
项目:org.xtext.dsl.restaurante    文件:RestauranteGrammarAccess.java   
public ParserRule getProductoORule() {
    return getProductoOAccess().getRule();
}
项目:n4js    文件:TypesGrammarAccess.java   
public ParserRule getIntersectionTypeExpressionOLDRule() {
    return getIntersectionTypeExpressionOLDAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getArrayBindingPatternRule() {
    return getArrayBindingPatternAccess().getRule();
}
项目:n4js    文件:TypesGrammarAccess.java   
public ParserRule getReservedWordRule() {
    return getReservedWordAccess().getRule();
}
项目:OCCI-Studio    文件:OCCIGrammarAccess.java   
public ParserRule getExtensionRule() {
    return getExtensionAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getTypingStrategyDefSiteOperatorRule() {
    return getTypingStrategyDefSiteOperatorAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getPercentRule() {
    return getPercentAccess().getRule();
}
项目:n4js    文件:TypesGrammarAccess.java   
public ParserRule getParameterizedTypeRefStructuralRule() {
    return getParameterizedTypeRefStructuralAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getScientificIntLiteralRule() {
    return getScientificIntLiteralAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getXAdditiveExpressionRule() {
    return getXAdditiveExpressionAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getConditionalExpressionRule() {
    return getConditionalExpressionAccess().getRule();
}
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public ParserRule getTStructSetterRule() {
    return getTStructSetterAccess().getRule();
}
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public ParserRule getBindingIdentifierRule() {
    return getBindingIdentifierAccess().getRule();
}
项目:bromium    文件:BromiumGrammarAccess.java   
public ParserRule getTextOfElementWithCssSelectorToBeRule() {
    return getTextOfElementWithCssSelectorToBeAccess().getRule();
}
项目:n4js    文件:TypeExpressionsGrammarAccess.java   
public ParserRule getColonSepTypeRefRule() {
    return getColonSepTypeRefAccess().getRule();
}
项目:org.xtext.dsl.restaurante    文件:RestauranteGrammarAccess.java   
public ParserRule getProductoYRule() {
    return getProductoYAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getPropertyMethodDeclarationRule() {
    return getPropertyMethodDeclarationAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getExportDeclarationImplRule() {
    return getExportDeclarationImplAccess().getRule();
}
项目:gw4e.project    文件:DSLPoliciesGrammarAccess.java   
public ParserRule getNumberRule() {
    return getNumberAccess().getRule();
}
项目:OCCI-Studio    文件:OCCIGrammarAccess.java   
public ParserRule getTypeIDRule() {
    return getTypeIDAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getVariableDeclarationRule() {
    return getVariableDeclarationAccess().getRule();
}
项目:n4js    文件:TypesGrammarAccess.java   
public ParserRule getNullTypeRule() {
    return getNullTypeAccess().getRule();
}
项目:n4js    文件:TypesGrammarAccess.java   
public ParserRule getBindingTypesIdentifierRule() {
    return getBindingTypesIdentifierAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getAnnotationRule() {
    return getAnnotationAccess().getRule();
}
项目:bromium    文件:BromiumGrammarAccess.java   
public ParserRule getVersionRule() {
    return getVersionAccess().getRule();
}
项目:n4js    文件:N4JSGrammarAccess.java   
public ParserRule getTemplateExpressionEndRule() {
    return getTemplateExpressionEndAccess().getRule();
}