/*
* generated by Xtext
*/
package org.xtext.example.mydsl.services;

import com.google.inject.Singleton;
import com.google.inject.Inject;

import java.util.List;

import org.eclipse.xtext.*;
import org.eclipse.xtext.service.GrammarProvider;
import org.eclipse.xtext.service.AbstractElementFinder.*;

import org.eclipse.xtext.common.services.TerminalsGrammarAccess;

@Singleton
public class MyDslGrammarAccess extends AbstractGrammarElementFinder {
	
	
	public class ContentModelElements extends AbstractParserRuleElementFinder {
		private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "ContentModel");
		private final Group cGroup = (Group)rule.eContents().get(1);
		private final Keyword cContentModelKeyword_0 = (Keyword)cGroup.eContents().get(0);
		private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
		private final RuleCall cNameQualifiedNameParserRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
		private final Keyword cLeftCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2);
		private final Keyword cDisplayNameKeyword_3 = (Keyword)cGroup.eContents().get(3);
		private final Keyword cEqualsSignKeyword_4 = (Keyword)cGroup.eContents().get(4);
		private final Assignment cDisplayNameAssignment_5 = (Assignment)cGroup.eContents().get(5);
		private final RuleCall cDisplayNameSTRINGTerminalRuleCall_5_0 = (RuleCall)cDisplayNameAssignment_5.eContents().get(0);
		private final Group cGroup_6 = (Group)cGroup.eContents().get(6);
		private final Keyword cDescriptionKeyword_6_0 = (Keyword)cGroup_6.eContents().get(0);
		private final Keyword cEqualsSignKeyword_6_1 = (Keyword)cGroup_6.eContents().get(1);
		private final Assignment cDescriptionAssignment_6_2 = (Assignment)cGroup_6.eContents().get(2);
		private final RuleCall cDescriptionSTRINGTerminalRuleCall_6_2_0 = (RuleCall)cDescriptionAssignment_6_2.eContents().get(0);
		private final Assignment cOwnedWebAssignment_7 = (Assignment)cGroup.eContents().get(7);
		private final RuleCall cOwnedWebWebParserRuleCall_7_0 = (RuleCall)cOwnedWebAssignment_7.eContents().get(0);
		private final Keyword cRightCurlyBracketKeyword_8 = (Keyword)cGroup.eContents().get(8);
		
		//ContentModel:
		//
		//	"ContentModel" name=QualifiedName "{" "displayName" "=" displayName=STRING ("description" "=" description=STRING)?
		//
		//	ownedWeb=Web "}";
		public ParserRule getRule() { return rule; }

		//"ContentModel" name=QualifiedName "{" "displayName" "=" displayName=STRING ("description" "=" description=STRING)?
		//
		//ownedWeb=Web "}"
		public Group getGroup() { return cGroup; }

		//"ContentModel"
		public Keyword getContentModelKeyword_0() { return cContentModelKeyword_0; }

		//name=QualifiedName
		public Assignment getNameAssignment_1() { return cNameAssignment_1; }

		//QualifiedName
		public RuleCall getNameQualifiedNameParserRuleCall_1_0() { return cNameQualifiedNameParserRuleCall_1_0; }

		//"{"
		public Keyword getLeftCurlyBracketKeyword_2() { return cLeftCurlyBracketKeyword_2; }

		//"displayName"
		public Keyword getDisplayNameKeyword_3() { return cDisplayNameKeyword_3; }

		//"="
		public Keyword getEqualsSignKeyword_4() { return cEqualsSignKeyword_4; }

		//displayName=STRING
		public Assignment getDisplayNameAssignment_5() { return cDisplayNameAssignment_5; }

		//STRING
		public RuleCall getDisplayNameSTRINGTerminalRuleCall_5_0() { return cDisplayNameSTRINGTerminalRuleCall_5_0; }

		//("description" "=" description=STRING)?
		public Group getGroup_6() { return cGroup_6; }

		//"description"
		public Keyword getDescriptionKeyword_6_0() { return cDescriptionKeyword_6_0; }

		//"="
		public Keyword getEqualsSignKeyword_6_1() { return cEqualsSignKeyword_6_1; }

		//description=STRING
		public Assignment getDescriptionAssignment_6_2() { return cDescriptionAssignment_6_2; }

		//STRING
		public RuleCall getDescriptionSTRINGTerminalRuleCall_6_2_0() { return cDescriptionSTRINGTerminalRuleCall_6_2_0; }

		//ownedWeb=Web
		public Assignment getOwnedWebAssignment_7() { return cOwnedWebAssignment_7; }

		//Web
		public RuleCall getOwnedWebWebParserRuleCall_7_0() { return cOwnedWebWebParserRuleCall_7_0; }

		//"}"
		public Keyword getRightCurlyBracketKeyword_8() { return cRightCurlyBracketKeyword_8; }
	}

	public class ContentUnitElements extends AbstractParserRuleElementFinder {
		private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "ContentUnit");
		private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
		private final RuleCall cContentModelParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
		private final RuleCall cWebParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1);
		
		//ContentUnit:
		//
		//	ContentModel | Web;
		public ParserRule getRule() { return rule; }

		//ContentModel | Web
		public Alternatives getAlternatives() { return cAlternatives; }

		//ContentModel
		public RuleCall getContentModelParserRuleCall_0() { return cContentModelParserRuleCall_0; }

		//Web
		public RuleCall getWebParserRuleCall_1() { return cWebParserRuleCall_1; }
	}

	public class WebElements extends AbstractParserRuleElementFinder {
		private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Web");
		private final Group cGroup = (Group)rule.eContents().get(1);
		private final Keyword cWebKeyword_0 = (Keyword)cGroup.eContents().get(0);
		private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
		private final RuleCall cNameQualifiedNameParserRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
		private final Keyword cLeftCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2);
		private final Keyword cGuIDKeyword_3 = (Keyword)cGroup.eContents().get(3);
		private final Keyword cEqualsSignKeyword_4 = (Keyword)cGroup.eContents().get(4);
		private final Assignment cGuIDAssignment_5 = (Assignment)cGroup.eContents().get(5);
		private final RuleCall cGuIDSTRINGTerminalRuleCall_5_0 = (RuleCall)cGuIDAssignment_5.eContents().get(0);
		private final Keyword cDisplayNameKeyword_6 = (Keyword)cGroup.eContents().get(6);
		private final Keyword cEqualsSignKeyword_7 = (Keyword)cGroup.eContents().get(7);
		private final Assignment cDisplayNameAssignment_8 = (Assignment)cGroup.eContents().get(8);
		private final RuleCall cDisplayNameSTRINGTerminalRuleCall_8_0 = (RuleCall)cDisplayNameAssignment_8.eContents().get(0);
		private final Group cGroup_9 = (Group)cGroup.eContents().get(9);
		private final Keyword cDescriptionKeyword_9_0 = (Keyword)cGroup_9.eContents().get(0);
		private final Keyword cEqualsSignKeyword_9_1 = (Keyword)cGroup_9.eContents().get(1);
		private final Assignment cDescriptionAssignment_9_2 = (Assignment)cGroup_9.eContents().get(2);
		private final RuleCall cDescriptionSTRINGTerminalRuleCall_9_2_0 = (RuleCall)cDescriptionAssignment_9_2.eContents().get(0);
		private final Group cGroup_10 = (Group)cGroup.eContents().get(10);
		private final Keyword cSitePermissionKeyword_10_0 = (Keyword)cGroup_10.eContents().get(0);
		private final Keyword cEqualsSignKeyword_10_1 = (Keyword)cGroup_10.eContents().get(1);
		private final Assignment cSitePermissionAssignment_10_2 = (Assignment)cGroup_10.eContents().get(2);
		private final CrossReference cSitePermissionSitePermissionCrossReference_10_2_0 = (CrossReference)cSitePermissionAssignment_10_2.eContents().get(0);
		private final RuleCall cSitePermissionSitePermissionQualifiedNameParserRuleCall_10_2_0_1 = (RuleCall)cSitePermissionSitePermissionCrossReference_10_2_0.eContents().get(1);
		private final Group cGroup_11 = (Group)cGroup.eContents().get(11);
		private final Keyword cWebsKeyword_11_0 = (Keyword)cGroup_11.eContents().get(0);
		private final Keyword cLeftCurlyBracketKeyword_11_1 = (Keyword)cGroup_11.eContents().get(1);
		private final Assignment cOwnedWebAssignment_11_2 = (Assignment)cGroup_11.eContents().get(2);
		private final RuleCall cOwnedWebWebParserRuleCall_11_2_0 = (RuleCall)cOwnedWebAssignment_11_2.eContents().get(0);
		private final Assignment cOwnedWebAssignment_11_3 = (Assignment)cGroup_11.eContents().get(3);
		private final RuleCall cOwnedWebWebParserRuleCall_11_3_0 = (RuleCall)cOwnedWebAssignment_11_3.eContents().get(0);
		private final Keyword cRightCurlyBracketKeyword_11_4 = (Keyword)cGroup_11.eContents().get(4);
		private final Keyword cRightCurlyBracketKeyword_12 = (Keyword)cGroup.eContents().get(12);
		
		//Web:
		//
		//	"Web" name=QualifiedName "{" "guID" "=" guID=STRING "displayName" "=" displayName=STRING ("description" "="
		//
		//	description=STRING)? ("sitePermission" "=" sitePermission=[user::SitePermission|QualifiedName])? ("Webs" "{"
		//
		//	ownedWeb+=Web ownedWeb+=Web* "}")? "}";
		public ParserRule getRule() { return rule; }

		//"Web" name=QualifiedName "{" "guID" "=" guID=STRING "displayName" "=" displayName=STRING ("description" "="
		//
		//description=STRING)? ("sitePermission" "=" sitePermission=[user::SitePermission|QualifiedName])? ("Webs" "{"
		//
		//ownedWeb+=Web ownedWeb+=Web* "}")? "}"
		public Group getGroup() { return cGroup; }

		//"Web"
		public Keyword getWebKeyword_0() { return cWebKeyword_0; }

		//name=QualifiedName
		public Assignment getNameAssignment_1() { return cNameAssignment_1; }

		//QualifiedName
		public RuleCall getNameQualifiedNameParserRuleCall_1_0() { return cNameQualifiedNameParserRuleCall_1_0; }

		//"{"
		public Keyword getLeftCurlyBracketKeyword_2() { return cLeftCurlyBracketKeyword_2; }

		//"guID"
		public Keyword getGuIDKeyword_3() { return cGuIDKeyword_3; }

		//"="
		public Keyword getEqualsSignKeyword_4() { return cEqualsSignKeyword_4; }

		//guID=STRING
		public Assignment getGuIDAssignment_5() { return cGuIDAssignment_5; }

		//STRING
		public RuleCall getGuIDSTRINGTerminalRuleCall_5_0() { return cGuIDSTRINGTerminalRuleCall_5_0; }

		//"displayName"
		public Keyword getDisplayNameKeyword_6() { return cDisplayNameKeyword_6; }

		//"="
		public Keyword getEqualsSignKeyword_7() { return cEqualsSignKeyword_7; }

		//displayName=STRING
		public Assignment getDisplayNameAssignment_8() { return cDisplayNameAssignment_8; }

		//STRING
		public RuleCall getDisplayNameSTRINGTerminalRuleCall_8_0() { return cDisplayNameSTRINGTerminalRuleCall_8_0; }

		//("description" "=" description=STRING)?
		public Group getGroup_9() { return cGroup_9; }

		//"description"
		public Keyword getDescriptionKeyword_9_0() { return cDescriptionKeyword_9_0; }

		//"="
		public Keyword getEqualsSignKeyword_9_1() { return cEqualsSignKeyword_9_1; }

		//description=STRING
		public Assignment getDescriptionAssignment_9_2() { return cDescriptionAssignment_9_2; }

		//STRING
		public RuleCall getDescriptionSTRINGTerminalRuleCall_9_2_0() { return cDescriptionSTRINGTerminalRuleCall_9_2_0; }

		//("sitePermission" "=" sitePermission=[user::SitePermission|QualifiedName])?
		public Group getGroup_10() { return cGroup_10; }

		//"sitePermission"
		public Keyword getSitePermissionKeyword_10_0() { return cSitePermissionKeyword_10_0; }

		//"="
		public Keyword getEqualsSignKeyword_10_1() { return cEqualsSignKeyword_10_1; }

		//sitePermission=[user::SitePermission|QualifiedName]
		public Assignment getSitePermissionAssignment_10_2() { return cSitePermissionAssignment_10_2; }

		//[user::SitePermission|QualifiedName]
		public CrossReference getSitePermissionSitePermissionCrossReference_10_2_0() { return cSitePermissionSitePermissionCrossReference_10_2_0; }

		//QualifiedName
		public RuleCall getSitePermissionSitePermissionQualifiedNameParserRuleCall_10_2_0_1() { return cSitePermissionSitePermissionQualifiedNameParserRuleCall_10_2_0_1; }

		//("Webs" "{" ownedWeb+=Web ownedWeb+=Web* "}")?
		public Group getGroup_11() { return cGroup_11; }

		//"Webs"
		public Keyword getWebsKeyword_11_0() { return cWebsKeyword_11_0; }

		//"{"
		public Keyword getLeftCurlyBracketKeyword_11_1() { return cLeftCurlyBracketKeyword_11_1; }

		//ownedWeb+=Web
		public Assignment getOwnedWebAssignment_11_2() { return cOwnedWebAssignment_11_2; }

		//Web
		public RuleCall getOwnedWebWebParserRuleCall_11_2_0() { return cOwnedWebWebParserRuleCall_11_2_0; }

		//ownedWeb+=Web*
		public Assignment getOwnedWebAssignment_11_3() { return cOwnedWebAssignment_11_3; }

		//Web
		public RuleCall getOwnedWebWebParserRuleCall_11_3_0() { return cOwnedWebWebParserRuleCall_11_3_0; }

		//"}"
		public Keyword getRightCurlyBracketKeyword_11_4() { return cRightCurlyBracketKeyword_11_4; }

		//"}"
		public Keyword getRightCurlyBracketKeyword_12() { return cRightCurlyBracketKeyword_12; }
	}

	public class QualifiedNameElements extends AbstractParserRuleElementFinder {
		private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "QualifiedName");
		private final Group cGroup = (Group)rule.eContents().get(1);
		private final RuleCall cIDTerminalRuleCall_0 = (RuleCall)cGroup.eContents().get(0);
		private final Group cGroup_1 = (Group)cGroup.eContents().get(1);
		private final Keyword cFullStopKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0);
		private final RuleCall cIDTerminalRuleCall_1_1 = (RuleCall)cGroup_1.eContents().get(1);
		
		//QualifiedName:
		//
		//	ID ("." ID)*;
		public ParserRule getRule() { return rule; }

		//ID ("." ID)*
		public Group getGroup() { return cGroup; }

		//ID
		public RuleCall getIDTerminalRuleCall_0() { return cIDTerminalRuleCall_0; }

		//("." ID)*
		public Group getGroup_1() { return cGroup_1; }

		//"."
		public Keyword getFullStopKeyword_1_0() { return cFullStopKeyword_1_0; }

		//ID
		public RuleCall getIDTerminalRuleCall_1_1() { return cIDTerminalRuleCall_1_1; }
	}
	
	
	private ContentModelElements pContentModel;
	private ContentUnitElements pContentUnit;
	private WebElements pWeb;
	private QualifiedNameElements pQualifiedName;
	
	private final Grammar grammar;

	private TerminalsGrammarAccess gaTerminals;

	@Inject
	public MyDslGrammarAccess(GrammarProvider grammarProvider,
		TerminalsGrammarAccess gaTerminals) {
		this.grammar = internalFindGrammar(grammarProvider);
		this.gaTerminals = gaTerminals;
	}
	
	protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
		Grammar grammar = grammarProvider.getGrammar(this);
		while (grammar != null) {
			if ("org.xtext.example.mydsl.MyDsl".equals(grammar.getName())) {
				return grammar;
			}
			List<Grammar> grammars = grammar.getUsedGrammars();
			if (!grammars.isEmpty()) {
				grammar = grammars.iterator().next();
			} else {
				return null;
			}
		}
		return grammar;
	}
	
	
	public Grammar getGrammar() {
		return grammar;
	}
	

	public TerminalsGrammarAccess getTerminalsGrammarAccess() {
		return gaTerminals;
	}

	
	//ContentModel:
	//
	//	"ContentModel" name=QualifiedName "{" "displayName" "=" displayName=STRING ("description" "=" description=STRING)?
	//
	//	ownedWeb=Web "}";
	public ContentModelElements getContentModelAccess() {
		return (pContentModel != null) ? pContentModel : (pContentModel = new ContentModelElements());
	}
	
	public ParserRule getContentModelRule() {
		return getContentModelAccess().getRule();
	}

	//ContentUnit:
	//
	//	ContentModel | Web;
	public ContentUnitElements getContentUnitAccess() {
		return (pContentUnit != null) ? pContentUnit : (pContentUnit = new ContentUnitElements());
	}
	
	public ParserRule getContentUnitRule() {
		return getContentUnitAccess().getRule();
	}

	//Web:
	//
	//	"Web" name=QualifiedName "{" "guID" "=" guID=STRING "displayName" "=" displayName=STRING ("description" "="
	//
	//	description=STRING)? ("sitePermission" "=" sitePermission=[user::SitePermission|QualifiedName])? ("Webs" "{"
	//
	//	ownedWeb+=Web ownedWeb+=Web* "}")? "}";
	public WebElements getWebAccess() {
		return (pWeb != null) ? pWeb : (pWeb = new WebElements());
	}
	
	public ParserRule getWebRule() {
		return getWebAccess().getRule();
	}

	//QualifiedName:
	//
	//	ID ("." ID)*;
	public QualifiedNameElements getQualifiedNameAccess() {
		return (pQualifiedName != null) ? pQualifiedName : (pQualifiedName = new QualifiedNameElements());
	}
	
	public ParserRule getQualifiedNameRule() {
		return getQualifiedNameAccess().getRule();
	}

	//terminal ID:
	//
	//	"^"? ("a".."z" | "A".."Z" | "_") ("a".."z" | "A".."Z" | "_" | "0".."9")*;
	public TerminalRule getIDRule() {
		return gaTerminals.getIDRule();
	} 

	//terminal INT returns ecore::EInt:
	//
	//	"0".."9"+;
	public TerminalRule getINTRule() {
		return gaTerminals.getINTRule();
	} 

	//terminal STRING:
	//
	//	"\"" ("\\" ("b" | "t" | "n" | "f" | "r" | "u" | "\"" | "\'" | "\\") | !("\\" | "\""))* "\"" | "\'" ("\\" ("b" | "t" |
	//
	//	"n" | "f" | "r" | "u" | "\"" | "\'" | "\\") | !("\\" | "\'"))* "\'";
	public TerminalRule getSTRINGRule() {
		return gaTerminals.getSTRINGRule();
	} 

	//terminal ML_COMMENT:
	//
	//	"/ *"->"* /";
	public TerminalRule getML_COMMENTRule() {
		return gaTerminals.getML_COMMENTRule();
	} 

	//terminal SL_COMMENT:
	//
	//	"//" !("\n" | "\r")* ("\r"? "\n")?;
	public TerminalRule getSL_COMMENTRule() {
		return gaTerminals.getSL_COMMENTRule();
	} 

	//terminal WS:
	//
	//	(" " | "\t" | "\r" | "\n")+;
	public TerminalRule getWSRule() {
		return gaTerminals.getWSRule();
	} 

	//terminal ANY_OTHER:
	//
	//	.;
	public TerminalRule getANY_OTHERRule() {
		return gaTerminals.getANY_OTHERRule();
	} 
}
