Java Code Examples for org.eclipse.xtext.GrammarUtil#findRuleForName()

The following examples show how to use org.eclipse.xtext.GrammarUtil#findRuleForName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OverriddenValueInspectorTest.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testAssignedAction_02() throws Exception {
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("grammar org.foo with org.eclipse.xtext.common.Terminals");
  _builder.newLine();
  _builder.append("generate metamodel \'foo.sample\'");
  _builder.newLine();
  _builder.append("First : Second ({First.second=current} name=ID)*;");
  _builder.newLine();
  _builder.append("Second: name=ID;");
  _builder.newLine();
  String grammarAsString = _builder.toString();
  final Grammar grammar = this.getGrammar(grammarAsString);
  AbstractRule _findRuleForName = GrammarUtil.findRuleForName(grammar, "First");
  final ParserRule rule = ((ParserRule) _findRuleForName);
  this.validateRule(rule);
  Assert.assertTrue(this.warnings.toString(), this.warnings.isEmpty());
}
 
Example 2
Source File: ValidEntryRuleInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testUnorderedGroup_13() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"X : 'x' (x=ID & y=INT);\n";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertTrue(warnings.toString(), warnings.isEmpty());
}
 
Example 3
Source File: XtendHighlightingCalculator.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
protected void collectKeywordsFromRule(IGrammarAccess grammarAccess, String ruleName, ImmutableSet.Builder<Keyword> builder) {
	AbstractRule rule = GrammarUtil.findRuleForName(grammarAccess.getGrammar(), ruleName);
	if (!(rule instanceof TerminalRule)) { // if someone decides to override ValidID with a terminal rule
		Iterator<EObject> i = rule.eAllContents();
		while (i.hasNext()) {
			EObject o = i.next();
			if (o instanceof Keyword) {
				builder.add((Keyword) o);
			}
		}
	}
}
 
Example 4
Source File: AbstractCodeElementExtractor.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Pure
@Override
public TypeReference getLanguageTopElementType() {
	final Grammar grammar = getGrammar();
	final AbstractRule rule = GrammarUtil.findRuleForName(grammar, getCodeBuilderConfig().getTopElementRuleName());
	return newTypeReference(rule.getType().getClassifier());
}
 
Example 5
Source File: ValidEntryRuleInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testIgnoreSecondRule_01() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"Model: x=X;\n" +
			"X : ID (x+='x')*;";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertTrue(warnings.toString(), warnings.isEmpty());
}
 
Example 6
Source File: Bug377311TestLanguageGrammarAccess.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Inject
public Bug377311TestLanguageGrammarAccess(GrammarProvider grammarProvider,
		TerminalsGrammarAccess gaTerminals) {
	this.grammar = internalFindGrammar(grammarProvider);
	this.gaTerminals = gaTerminals;
	this.pRoot = new RootElements();
	this.pChild = new ChildElements();
	this.tWS = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ui.tests.editor.contentassist.Bug377311TestLanguage.WS");
	this.tNewLine = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ui.tests.editor.contentassist.Bug377311TestLanguage.NewLine");
}
 
Example 7
Source File: RuleWithoutInstantiationInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testAssignment_01() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"Model: x=X;\n" +
			"X : x='x';";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertTrue(warnings.toString(), warnings.isEmpty());
}
 
Example 8
Source File: ValidEntryRuleInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testAlternatives_03() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"X : x=ID? | y=INT*;\n";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertTrue(warnings.toString(), warnings.isEmpty());
}
 
Example 9
Source File: TerminalsGrammarAccess.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Inject
public TerminalsGrammarAccess(GrammarProvider grammarProvider) {
	this.grammar = internalFindGrammar(grammarProvider);
	this.tID = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.common.Terminals.ID");
	this.tINT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.common.Terminals.INT");
	this.tSTRING = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.common.Terminals.STRING");
	this.tML_COMMENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.common.Terminals.ML_COMMENT");
	this.tSL_COMMENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.common.Terminals.SL_COMMENT");
	this.tWS = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.common.Terminals.WS");
	this.tANY_OTHER = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.common.Terminals.ANY_OTHER");
}
 
Example 10
Source File: RuleWithoutInstantiationInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testRuleCall_01() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"Model: x=X;\n" +
			"X : Y;\n" +
			"Y : name=ID;";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertTrue(warnings.toString(), warnings.isEmpty());
}
 
Example 11
Source File: ValidEntryRuleInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testDatatypes() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"X: 'x';\n";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertTrue(warnings.toString(), warnings.isEmpty());
}
 
Example 12
Source File: ValidEntryRuleInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testUnorderedGroup_03() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"X : ('x' & x=ID? & 'x')?;\n";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertEquals(warnings.toString(), 1, warnings.size());
}
 
Example 13
Source File: RuleWithoutInstantiationInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testUnorderedGroup_02() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"Model: x=X;\n" +
			"X : value='keyword0' & 'keyword1';\n";
	Grammar grammar = getGrammar(grammarAsString);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertEquals(warnings.toString(), 0, warnings.size());
}
 
Example 14
Source File: ValidEntryRuleInspectorTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test public void testBug_287735_01() throws Exception {
	String grammarAsString = "grammar org.foo with org.eclipse.xtext.common.Terminals\n" +
			"generate metamodel 'foo.sample'\n" +
			"X : 'x' Y;\n";
	Grammar grammar = getGrammarWithErrors(grammarAsString, 1);
	ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(grammar, "X");
	validateRule(rule);
	assertTrue(warnings.toString(), warnings.isEmpty());
}
 
Example 15
Source File: IndentationAwareUiTestLanguageGrammarAccess.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Inject
public IndentationAwareUiTestLanguageGrammarAccess(GrammarProvider grammarProvider,
		TerminalsGrammarAccess gaTerminals) {
	this.grammar = internalFindGrammar(grammarProvider);
	this.gaTerminals = gaTerminals;
	this.pTree = new TreeElements();
	this.pTreeNode = new TreeNodeElements();
	this.pOtherTreeNode = new OtherTreeNodeElements();
	this.pChildList = new ChildListElements();
	this.tSL_COMMENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.IndentationAwareUiTestLanguage.SL_COMMENT");
	this.tINDENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.IndentationAwareUiTestLanguage.INDENT");
	this.tDEDENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.IndentationAwareUiTestLanguage.DEDENT");
}
 
Example 16
Source File: BeeLangTestLanguageGrammarAccess.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public BeeLangTestLanguageGrammarAccess(GrammarProvider grammarProvider,
		TerminalsGrammarAccess gaTerminals) {
	this.grammar = internalFindGrammar(grammarProvider);
	this.gaTerminals = gaTerminals;
	this.pModel = new ModelElements();
	this.pUnit = new UnitElements();
	this.pProvidedCapability = new ProvidedCapabilityElements();
	this.pAliasedRequiredCapability = new AliasedRequiredCapabilityElements();
	this.pRequiredCapability = new RequiredCapabilityElements();
	this.pPath = new PathElements();
	this.pParameterList = new ParameterListElements();
	this.pFirstParameter = new FirstParameterElements();
	this.pParameter = new ParameterElements();
	this.pClosureParameter = new ClosureParameterElements();
	this.pParameterDeclaration = new ParameterDeclarationElements();
	this.pFunction = new FunctionElements();
	this.pGuardExpression = new GuardExpressionElements();
	this.pAssignmentOperator = new AssignmentOperatorElements();
	this.pRelationalOperator = new RelationalOperatorElements();
	this.pTopLevelExpression = new TopLevelExpressionElements();
	this.pExpression = new ExpressionElements();
	this.pAssignmentExpression = new AssignmentExpressionElements();
	this.pVarDeclaration = new VarDeclarationElements();
	this.pValDeclaration = new ValDeclarationElements();
	this.pTypeRef = new TypeRefElements();
	this.pSimpleTypeRef = new SimpleTypeRefElements();
	this.pClosureTypeRef = new ClosureTypeRefElements();
	this.pCachedExpression = new CachedExpressionElements();
	this.pOrExpression = new OrExpressionElements();
	this.pAndExpression = new AndExpressionElements();
	this.pRelationalExpression = new RelationalExpressionElements();
	this.pAdditiveExpression = new AdditiveExpressionElements();
	this.pMultiplicativeExpression = new MultiplicativeExpressionElements();
	this.pSetExpression = new SetExpressionElements();
	this.pUnaryOrInfixExpression = new UnaryOrInfixExpressionElements();
	this.pUnaryExpression = new UnaryExpressionElements();
	this.pPreopExpression = new PreopExpressionElements();
	this.pPostopExpression = new PostopExpressionElements();
	this.pInfixExpression = new InfixExpressionElements();
	this.pCallExpression = new CallExpressionElements();
	this.pPrimaryExpression = new PrimaryExpressionElements();
	this.pWithExpression = new WithExpressionElements();
	this.pWithContextExpression = new WithContextExpressionElements();
	this.pBlockExpression = new BlockExpressionElements();
	this.pValue = new ValueElements();
	this.pKeywordVariables = new KeywordVariablesElements();
	this.pFeatureCall = new FeatureCallElements();
	this.pOperationCall = new OperationCallElements();
	this.pConstructorCallExpression = new ConstructorCallExpressionElements();
	this.pInitializationBlockExpression = new InitializationBlockExpressionElements();
	this.pInitializationExpression = new InitializationExpressionElements();
	this.pFeatureOfThis = new FeatureOfThisElements();
	this.pLiteral = new LiteralElements();
	this.pLiteralFunction = new LiteralFunctionElements();
	this.pClosureExpression = new ClosureExpressionElements();
	this.pOneOrManyExpressions = new OneOrManyExpressionsElements();
	this.pBlockExpressionWithoutBrackets = new BlockExpressionWithoutBracketsElements();
	this.pValueLiteral = new ValueLiteralElements();
	this.pParanthesizedExpression = new ParanthesizedExpressionElements();
	this.pQID = new QIDElements();
	this.tDOCUMENTATION = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.DOCUMENTATION");
	this.tHEX = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.testlanguages.backtracking.BeeLangTestLanguage.HEX");
}
 
Example 17
Source File: CodetemplatesPartialParsingHelper.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
private AbstractRule getTemplateRule() {
	if (templateRule == null)
		templateRule = GrammarUtil.findRuleForName(grammarAccess.getGrammar(), "Codetemplate");
	return templateRule;
}
 
Example 18
Source File: XtextTerminalsTestLanguageGrammarAccess.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public XtextTerminalsTestLanguageGrammarAccess(GrammarProvider grammarProvider) {
	this.grammar = internalFindGrammar(grammarProvider);
	this.pGrammar = new GrammarElements();
	this.pGrammarID = new GrammarIDElements();
	this.pAbstractRule = new AbstractRuleElements();
	this.pAbstractMetamodelDeclaration = new AbstractMetamodelDeclarationElements();
	this.pGeneratedMetamodel = new GeneratedMetamodelElements();
	this.pReferencedMetamodel = new ReferencedMetamodelElements();
	this.pParserRule = new ParserRuleElements();
	this.pTypeRef = new TypeRefElements();
	this.pAlternatives = new AlternativesElements();
	this.pGroup = new GroupElements();
	this.pAbstractToken = new AbstractTokenElements();
	this.pAbstractTokenWithCardinality = new AbstractTokenWithCardinalityElements();
	this.pAction = new ActionElements();
	this.pAbstractTerminal = new AbstractTerminalElements();
	this.pKeyword = new KeywordElements();
	this.pRuleCall = new RuleCallElements();
	this.pAssignment = new AssignmentElements();
	this.pAssignableTerminal = new AssignableTerminalElements();
	this.pParenthesizedAssignableElement = new ParenthesizedAssignableElementElements();
	this.pAssignableAlternatives = new AssignableAlternativesElements();
	this.pCrossReference = new CrossReferenceElements();
	this.pCrossReferenceableTerminal = new CrossReferenceableTerminalElements();
	this.pParenthesizedElement = new ParenthesizedElementElements();
	this.pTerminalRule = new TerminalRuleElements();
	this.pTerminalAlternatives = new TerminalAlternativesElements();
	this.pTerminalGroup = new TerminalGroupElements();
	this.pTerminalToken = new TerminalTokenElements();
	this.pTerminalTokenElement = new TerminalTokenElementElements();
	this.pParenthesizedTerminalElement = new ParenthesizedTerminalElementElements();
	this.pAbstractNegatedToken = new AbstractNegatedTokenElements();
	this.pNegatedToken = new NegatedTokenElements();
	this.pUntilToken = new UntilTokenElements();
	this.pWildcard = new WildcardElements();
	this.pCharacterRange = new CharacterRangeElements();
	this.pEnumRule = new EnumRuleElements();
	this.pEnumLiterals = new EnumLiteralsElements();
	this.pEnumLiteralDeclaration = new EnumLiteralDeclarationElements();
	this.tID = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage.ID");
	this.tINT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage.INT");
	this.tSTRING = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage.STRING");
	this.tML_COMMENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage.ML_COMMENT");
	this.tSL_COMMENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage.SL_COMMENT");
	this.tWS = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage.WS");
	this.tANY_OTHER = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.parser.terminalrules.XtextTerminalsTestLanguage.ANY_OTHER");
}
 
Example 19
Source File: SemverGrammarAccess.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Inject
public SemverGrammarAccess(GrammarProvider grammarProvider,
		UnicodeGrammarAccess gaUnicode) {
	this.grammar = internalFindGrammar(grammarProvider);
	this.gaUnicode = gaUnicode;
	this.pNPMVersionRequirement = new NPMVersionRequirementElements();
	this.pLocalPathVersionRequirement = new LocalPathVersionRequirementElements();
	this.pURLVersionRequirement = new URLVersionRequirementElements();
	this.pURLVersionSpecifier = new URLVersionSpecifierElements();
	this.pURLSemver = new URLSemverElements();
	this.pTagVersionRequirement = new TagVersionRequirementElements();
	this.pGitHubVersionRequirement = new GitHubVersionRequirementElements();
	this.pVersionRangeSetRequirement = new VersionRangeSetRequirementElements();
	this.pVersionRange = new VersionRangeElements();
	this.pHyphenVersionRange = new HyphenVersionRangeElements();
	this.pVersionRangeContraint = new VersionRangeContraintElements();
	this.pSimpleVersion = new SimpleVersionElements();
	this.pVersionNumber = new VersionNumberElements();
	this.pVersionPart = new VersionPartElements();
	this.pQualifier = new QualifierElements();
	this.pQualifierTag = new QualifierTagElements();
	this.pFILE_TAG = new FILE_TAGElements();
	this.pSEMVER_TAG = new SEMVER_TAGElements();
	this.pPATH = new PATHElements();
	this.pURL_PROTOCOL = new URL_PROTOCOLElements();
	this.pURL = new URLElements();
	this.pURL_NO_VX = new URL_NO_VXElements();
	this.pTAG = new TAGElements();
	this.pALPHA_NUMERIC_CHARS = new ALPHA_NUMERIC_CHARSElements();
	this.pALPHA_NUMERIC_CHARS_START_WITH_DIGITS = new ALPHA_NUMERIC_CHARS_START_WITH_DIGITSElements();
	this.pWILDCARD = new WILDCARDElements();
	this.pLETTER = new LETTERElements();
	this.pLETTER_NO_VX = new LETTER_NO_VXElements();
	this.tLETTER_S = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_S");
	this.tLETTER_M = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_M");
	this.tLETTER_R = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_R");
	this.tLETTER_F = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_F");
	this.tLETTER_I = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_I");
	this.tLETTER_L = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_L");
	this.tLETTER_E = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_E");
	this.tLETTER_V = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_V");
	this.tLETTER_X = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_X");
	this.tLETTER_OTHER = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.LETTER_OTHER");
	this.tASTERIX = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.ASTERIX");
	this.tDIGITS = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.DIGITS");
	this.tWS = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.WS");
	this.tEOL = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.semver.Semver.EOL");
	this.eVersionComparator = new VersionComparatorElements();
}
 
Example 20
Source File: TypesGrammarAccess.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Inject
public TypesGrammarAccess(GrammarProvider grammarProvider,
		TypeExpressionsGrammarAccess gaTypeExpressions,
		UnicodeGrammarAccess gaUnicode) {
	this.grammar = internalFindGrammar(grammarProvider);
	this.gaTypeExpressions = gaTypeExpressions;
	this.gaUnicode = gaUnicode;
	this.pTypeDefs = new TypeDefsElements();
	this.tSTRING = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.ts.Types.STRING");
	this.tSINGLE_STRING_CHAR = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.n4js.ts.Types.SINGLE_STRING_CHAR");
	this.pTAnnotation = new TAnnotationElements();
	this.pTAnnotationArgument = new TAnnotationArgumentElements();
	this.pTAnnotationStringArgument = new TAnnotationStringArgumentElements();
	this.pTAnnotationTypeRefArgument = new TAnnotationTypeRefArgumentElements();
	this.eTypeAccessModifier = new TypeAccessModifierElements();
	this.eMemberAccessModifier = new MemberAccessModifierElements();
	this.pType = new TypeElements();
	this.pTypeRef = new TypeRefElements();
	this.pPrimitiveType = new PrimitiveTypeElements();
	this.pTypeReferenceName = new TypeReferenceNameElements();
	this.pAnyType = new AnyTypeElements();
	this.pVoidType = new VoidTypeElements();
	this.pUndefinedType = new UndefinedTypeElements();
	this.pNullType = new NullTypeElements();
	this.pTypesIdentifier = new TypesIdentifierElements();
	this.pBindingTypesIdentifier = new BindingTypesIdentifierElements();
	this.pVoidOrBindingIdentifier = new VoidOrBindingIdentifierElements();
	this.pTypesSpecificKeywords = new TypesSpecificKeywordsElements();
	this.pTypesComputedPropertyName = new TypesComputedPropertyNameElements();
	this.pTypesSymbolLiteralComputedName = new TypesSymbolLiteralComputedNameElements();
	this.pTypesStringLiteralComputedName = new TypesStringLiteralComputedNameElements();
	this.pTObjectPrototype = new TObjectPrototypeElements();
	this.pVirtualBaseType = new VirtualBaseTypeElements();
	this.pTClass = new TClassElements();
	this.pTInterface = new TInterfaceElements();
	this.pTypeVariable = new TypeVariableElements();
	this.pTClassOrInterfaceHeader = new TClassOrInterfaceHeaderElements();
	this.pCallableCtor = new CallableCtorElements();
	this.pTFormalParameters = new TFormalParametersElements();
	this.pTMember = new TMemberElements();
	this.pTMethod = new TMethodElements();
	this.pTField = new TFieldElements();
	this.pTGetter = new TGetterElements();
	this.pTSetter = new TSetterElements();
	this.pTFunction = new TFunctionElements();
	this.pTEnum = new TEnumElements();
	this.pTEnumLiteral = new TEnumLiteralElements();
}