当前位置: 首页>>代码示例>>Java>>正文


Java ParserRule类代码示例

本文整理汇总了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);
					}
				}
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:27,代码来源:TokenTypeRewriter.java

示例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));
}
 
开发者ID:rehne93,项目名称:pokemon-tcgo-deck-generator,代码行数:31,代码来源:PkmntcgoSemanticSequencer.java

示例3: getTypeAndTypeArgumentsRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getTypeAndTypeArgumentsRule() {
	return getTypeAndTypeArgumentsAccess().getRule();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:TypesGrammarAccess.java

示例4: getFeatureCallIDRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getFeatureCallIDRule() {
	return getFeatureCallIDAccess().getRule();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:4,代码来源:DSLPoliciesGrammarAccess.java

示例5: getLogicalANDExpressionRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getLogicalANDExpressionRule() {
	return getLogicalANDExpressionAccess().getRule();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:N4JSGrammarAccess.java

示例6: getPropertyGetterDeclarationRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getPropertyGetterDeclarationRule() {
	return getPropertyGetterDeclarationAccess().getRule();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:N4JSGrammarAccess.java

示例7: getXCastedExpressionRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXCastedExpressionRule() {
	return getXCastedExpressionAccess().getRule();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:4,代码来源:DSLPoliciesGrammarAccess.java

示例8: getParameterizedPropertyAccessExpressionTailRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getParameterizedPropertyAccessExpressionTailRule() {
	return getParameterizedPropertyAccessExpressionTailAccess().getRule();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:N4JSGrammarAccess.java

示例9: getParameterizedTypeRefNominalRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getParameterizedTypeRefNominalRule() {
	return getParameterizedTypeRefNominalAccess().getRule();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:N4JSGrammarAccess.java

示例10: getXBlockExpressionRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXBlockExpressionRule() {
	return getXBlockExpressionAccess().getRule();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:4,代码来源:DSLPoliciesGrammarAccess.java

示例11: getXMemberFeatureCallRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXMemberFeatureCallRule() {
	return getXMemberFeatureCallAccess().getRule();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:4,代码来源:DSLPoliciesGrammarAccess.java

示例12: getXImportDeclarationRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getXImportDeclarationRule() {
	return getXImportDeclarationAccess().getRule();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:4,代码来源:DSLPoliciesGrammarAccess.java

示例13: getArrowFunctionTypeExpressionRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getArrowFunctionTypeExpressionRule() {
	return getArrowFunctionTypeExpressionAccess().getRule();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:N4JSGrammarAccess.java

示例14: getTypeArgInTypeTypeRefRule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getTypeArgInTypeTypeRefRule() {
	return getTypeArgInTypeTypeRefAccess().getRule();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:TypeExpressionsGrammarAccess.java

示例15: getProductoORule

import org.eclipse.xtext.ParserRule; //导入依赖的package包/类
public ParserRule getProductoORule() {
	return getProductoOAccess().getRule();
}
 
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:4,代码来源:RestauranteGrammarAccess.java


注:本文中的org.eclipse.xtext.ParserRule类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。