本文整理汇总了Java中org.eclipse.xtext.ParserRule类的典型用法代码示例。如果您正苦于以下问题:Java ParserRule类的具体用法?Java ParserRule怎么用?Java ParserRule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParserRule类属于org.eclipse.xtext包,在下文中一共展示了ParserRule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rewriteIdentifiers
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
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);
}
}
}
}
}
}
示例2: sequence
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
@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));
}
示例3: getTypeAndTypeArgumentsRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getTypeAndTypeArgumentsRule() {
return getTypeAndTypeArgumentsAccess().getRule();
}
示例4: getFeatureCallIDRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getFeatureCallIDRule() {
return getFeatureCallIDAccess().getRule();
}
示例5: getLogicalANDExpressionRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getLogicalANDExpressionRule() {
return getLogicalANDExpressionAccess().getRule();
}
示例6: getPropertyGetterDeclarationRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getPropertyGetterDeclarationRule() {
return getPropertyGetterDeclarationAccess().getRule();
}
示例7: getXCastedExpressionRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXCastedExpressionRule() {
return getXCastedExpressionAccess().getRule();
}
示例8: getParameterizedPropertyAccessExpressionTailRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getParameterizedPropertyAccessExpressionTailRule() {
return getParameterizedPropertyAccessExpressionTailAccess().getRule();
}
示例9: getParameterizedTypeRefNominalRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getParameterizedTypeRefNominalRule() {
return getParameterizedTypeRefNominalAccess().getRule();
}
示例10: getXBlockExpressionRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXBlockExpressionRule() {
return getXBlockExpressionAccess().getRule();
}
示例11: getXMemberFeatureCallRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXMemberFeatureCallRule() {
return getXMemberFeatureCallAccess().getRule();
}
示例12: getXImportDeclarationRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXImportDeclarationRule() {
return getXImportDeclarationAccess().getRule();
}
示例13: getArrowFunctionTypeExpressionRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getArrowFunctionTypeExpressionRule() {
return getArrowFunctionTypeExpressionAccess().getRule();
}
示例14: getTypeArgInTypeTypeRefRule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getTypeArgInTypeTypeRefRule() {
return getTypeArgInTypeTypeRefAccess().getRule();
}
示例15: getProductoORule
import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getProductoORule() {
return getProductoOAccess().getRule();
}