/* * generated by Xtext */ package net.certware.intent.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 IntentSpecificationGrammarAccess extends AbstractGrammarElementFinder { public class SpecificationElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.Specification"); private final Group cGroup = (Group)rule.eContents().get(1); private final Keyword cSpecificationKeyword_0 = (Keyword)cGroup.eContents().get(0); private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); private final Assignment cRefinementsAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cRefinementsRefinementParserRuleCall_2_0 = (RuleCall)cRefinementsAssignment_2.eContents().get(0); /// * // * An intent specification consists of one or more refinements. // * / Specification: // 'specification' // name=ID // refinements+=Refinement+; @Override public ParserRule getRule() { return rule; } //'specification' name=ID refinements+=Refinement+ public Group getGroup() { return cGroup; } //'specification' public Keyword getSpecificationKeyword_0() { return cSpecificationKeyword_0; } //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } //refinements+=Refinement+ public Assignment getRefinementsAssignment_2() { return cRefinementsAssignment_2; } //Refinement public RuleCall getRefinementsRefinementParserRuleCall_2_0() { return cRefinementsRefinementParserRuleCall_2_0; } } public class RefinementElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.Refinement"); private final Group cGroup = (Group)rule.eContents().get(1); private final Keyword cRefinementKeyword_0 = (Keyword)cGroup.eContents().get(0); private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); private final Assignment cDescAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cDescSTRINGTerminalRuleCall_2_0 = (RuleCall)cDescAssignment_2.eContents().get(0); private final Assignment cIntentsAssignment_3 = (Assignment)cGroup.eContents().get(3); private final RuleCall cIntentsIntentParserRuleCall_3_0 = (RuleCall)cIntentsAssignment_3.eContents().get(0); /// * // * A refinement has no type and consists of one or more intents. // * / Refinement: // 'refinement' // name=ID // desc=STRING // intents+=Intent+; @Override public ParserRule getRule() { return rule; } //'refinement' name=ID desc=STRING intents+=Intent+ public Group getGroup() { return cGroup; } //'refinement' public Keyword getRefinementKeyword_0() { return cRefinementKeyword_0; } //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } //desc=STRING public Assignment getDescAssignment_2() { return cDescAssignment_2; } //STRING public RuleCall getDescSTRINGTerminalRuleCall_2_0() { return cDescSTRINGTerminalRuleCall_2_0; } //intents+=Intent+ public Assignment getIntentsAssignment_3() { return cIntentsAssignment_3; } //Intent public RuleCall getIntentsIntentParserRuleCall_3_0() { return cIntentsIntentParserRuleCall_3_0; } } public class IntentElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.Intent"); private final Group cGroup = (Group)rule.eContents().get(1); private final Assignment cTypeAssignment_0 = (Assignment)cGroup.eContents().get(0); private final RuleCall cTypeIntentTypeParserRuleCall_0_0 = (RuleCall)cTypeAssignment_0.eContents().get(0); private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); private final Assignment cDescAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cDescSTRINGTerminalRuleCall_2_0 = (RuleCall)cDescAssignment_2.eContents().get(0); private final Assignment cDecompositionsAssignment_3 = (Assignment)cGroup.eContents().get(3); private final RuleCall cDecompositionsDecompositionParserRuleCall_3_0 = (RuleCall)cDecompositionsAssignment_3.eContents().get(0); /// * // * An intent has a type and consists of one or more decompositions. // * / Intent: // type=IntentType // name=ID // desc=STRING // decompositions+=Decomposition+; @Override public ParserRule getRule() { return rule; } //type=IntentType name=ID desc=STRING decompositions+=Decomposition+ public Group getGroup() { return cGroup; } //type=IntentType public Assignment getTypeAssignment_0() { return cTypeAssignment_0; } //IntentType public RuleCall getTypeIntentTypeParserRuleCall_0_0() { return cTypeIntentTypeParserRuleCall_0_0; } //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } //desc=STRING public Assignment getDescAssignment_2() { return cDescAssignment_2; } //STRING public RuleCall getDescSTRINGTerminalRuleCall_2_0() { return cDescSTRINGTerminalRuleCall_2_0; } //decompositions+=Decomposition+ public Assignment getDecompositionsAssignment_3() { return cDecompositionsAssignment_3; } //Decomposition public RuleCall getDecompositionsDecompositionParserRuleCall_3_0() { return cDecompositionsDecompositionParserRuleCall_3_0; } } public class IntentTypeElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.IntentType"); private final Assignment cTypeNameAssignment = (Assignment)rule.eContents().get(1); private final Alternatives cTypeNameAlternatives_0 = (Alternatives)cTypeNameAssignment.eContents().get(0); private final Keyword cTypeNameBasicKeyword_0_0 = (Keyword)cTypeNameAlternatives_0.eContents().get(0); private final Keyword cTypeNamePurposeKeyword_0_1 = (Keyword)cTypeNameAlternatives_0.eContents().get(1); private final Keyword cTypeNamePrinciplesKeyword_0_2 = (Keyword)cTypeNameAlternatives_0.eContents().get(2); private final Keyword cTypeNameModelsKeyword_0_3 = (Keyword)cTypeNameAlternatives_0.eContents().get(3); private final Keyword cTypeNameDesignKeyword_0_4 = (Keyword)cTypeNameAlternatives_0.eContents().get(4); private final Keyword cTypeNameImplementationKeyword_0_5 = (Keyword)cTypeNameAlternatives_0.eContents().get(5); private final Keyword cTypeNameOperationKeyword_0_6 = (Keyword)cTypeNameAlternatives_0.eContents().get(6); /// * // * Intent types refer to the different levels of the canonical model. // * The grammar does not enforce their universal containment in a specification. // * A proper intention specification should contain an intent of each type in each refinement. // * / IntentType: // typeName=('basic' | 'purpose' | 'principles' | 'models' | 'design' | 'implementation' | 'operation'); @Override public ParserRule getRule() { return rule; } //typeName=('basic' | 'purpose' | 'principles' | 'models' | 'design' | 'implementation' | 'operation') public Assignment getTypeNameAssignment() { return cTypeNameAssignment; } //('basic' | 'purpose' | 'principles' | 'models' | 'design' | 'implementation' | 'operation') public Alternatives getTypeNameAlternatives_0() { return cTypeNameAlternatives_0; } //'basic' public Keyword getTypeNameBasicKeyword_0_0() { return cTypeNameBasicKeyword_0_0; } //'purpose' public Keyword getTypeNamePurposeKeyword_0_1() { return cTypeNamePurposeKeyword_0_1; } //'principles' public Keyword getTypeNamePrinciplesKeyword_0_2() { return cTypeNamePrinciplesKeyword_0_2; } //'models' public Keyword getTypeNameModelsKeyword_0_3() { return cTypeNameModelsKeyword_0_3; } //'design' public Keyword getTypeNameDesignKeyword_0_4() { return cTypeNameDesignKeyword_0_4; } //'implementation' public Keyword getTypeNameImplementationKeyword_0_5() { return cTypeNameImplementationKeyword_0_5; } //'operation' public Keyword getTypeNameOperationKeyword_0_6() { return cTypeNameOperationKeyword_0_6; } } public class DecompositionElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.Decomposition"); private final Group cGroup = (Group)rule.eContents().get(1); private final Assignment cTypeAssignment_0 = (Assignment)cGroup.eContents().get(0); private final RuleCall cTypeDecompositionTypeParserRuleCall_0_0 = (RuleCall)cTypeAssignment_0.eContents().get(0); private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); private final Assignment cDescAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cDescSTRINGTerminalRuleCall_2_0 = (RuleCall)cDescAssignment_2.eContents().get(0); private final Group cGroup_3 = (Group)cGroup.eContents().get(3); private final Keyword cLeftCurlyBracketKeyword_3_0 = (Keyword)cGroup_3.eContents().get(0); private final Assignment cDocumentsAssignment_3_1 = (Assignment)cGroup_3.eContents().get(1); private final RuleCall cDocumentsDocumentParserRuleCall_3_1_0 = (RuleCall)cDocumentsAssignment_3_1.eContents().get(0); private final Keyword cRightCurlyBracketKeyword_3_2 = (Keyword)cGroup_3.eContents().get(2); private final Group cGroup_4 = (Group)cGroup.eContents().get(4); private final Keyword cLeftSquareBracketKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0); private final Assignment cModelsAssignment_4_1 = (Assignment)cGroup_4.eContents().get(1); private final RuleCall cModelsModelItemParserRuleCall_4_1_0 = (RuleCall)cModelsAssignment_4_1.eContents().get(0); private final Keyword cRightSquareBracketKeyword_4_2 = (Keyword)cGroup_4.eContents().get(2); private final Group cGroup_5 = (Group)cGroup.eContents().get(5); private final Keyword cLeftParenthesisKeyword_5_0 = (Keyword)cGroup_5.eContents().get(0); private final Assignment cItemsAssignment_5_1 = (Assignment)cGroup_5.eContents().get(1); private final RuleCall cItemsListItemParserRuleCall_5_1_0 = (RuleCall)cItemsAssignment_5_1.eContents().get(0); private final Keyword cRightParenthesisKeyword_5_2 = (Keyword)cGroup_5.eContents().get(2); /// * // * A decomposition has a type and consists of one or more models, documents, or items. // * / Decomposition: // type=DecompositionType // name=ID // desc=STRING ('{' documents+=Document* '}')? ('[' models+=ModelItem* ']')? ('(' items+=ListItem* ')')?; @Override public ParserRule getRule() { return rule; } //type=DecompositionType name=ID desc=STRING ('{' documents+=Document* '}')? ('[' models+=ModelItem* ']')? ('(' //items+=ListItem* ')')? public Group getGroup() { return cGroup; } //type=DecompositionType public Assignment getTypeAssignment_0() { return cTypeAssignment_0; } //DecompositionType public RuleCall getTypeDecompositionTypeParserRuleCall_0_0() { return cTypeDecompositionTypeParserRuleCall_0_0; } //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } //desc=STRING public Assignment getDescAssignment_2() { return cDescAssignment_2; } //STRING public RuleCall getDescSTRINGTerminalRuleCall_2_0() { return cDescSTRINGTerminalRuleCall_2_0; } //('{' documents+=Document* '}')? public Group getGroup_3() { return cGroup_3; } //'{' public Keyword getLeftCurlyBracketKeyword_3_0() { return cLeftCurlyBracketKeyword_3_0; } //documents+=Document* public Assignment getDocumentsAssignment_3_1() { return cDocumentsAssignment_3_1; } //Document public RuleCall getDocumentsDocumentParserRuleCall_3_1_0() { return cDocumentsDocumentParserRuleCall_3_1_0; } //'}' public Keyword getRightCurlyBracketKeyword_3_2() { return cRightCurlyBracketKeyword_3_2; } //('[' models+=ModelItem* ']')? public Group getGroup_4() { return cGroup_4; } //'[' public Keyword getLeftSquareBracketKeyword_4_0() { return cLeftSquareBracketKeyword_4_0; } //models+=ModelItem* public Assignment getModelsAssignment_4_1() { return cModelsAssignment_4_1; } //ModelItem public RuleCall getModelsModelItemParserRuleCall_4_1_0() { return cModelsModelItemParserRuleCall_4_1_0; } //']' public Keyword getRightSquareBracketKeyword_4_2() { return cRightSquareBracketKeyword_4_2; } //('(' items+=ListItem* ')')? public Group getGroup_5() { return cGroup_5; } //'(' public Keyword getLeftParenthesisKeyword_5_0() { return cLeftParenthesisKeyword_5_0; } //items+=ListItem* public Assignment getItemsAssignment_5_1() { return cItemsAssignment_5_1; } //ListItem public RuleCall getItemsListItemParserRuleCall_5_1_0() { return cItemsListItemParserRuleCall_5_1_0; } //')' public Keyword getRightParenthesisKeyword_5_2() { return cRightParenthesisKeyword_5_2; } } public class DecompositionTypeElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.DecompositionType"); private final Assignment cTypeNameAssignment = (Assignment)rule.eContents().get(1); private final Alternatives cTypeNameAlternatives_0 = (Alternatives)cTypeNameAssignment.eContents().get(0); private final Keyword cTypeNameEnvironmentKeyword_0_0 = (Keyword)cTypeNameAlternatives_0.eContents().get(0); private final Keyword cTypeNameOperatorKeyword_0_1 = (Keyword)cTypeNameAlternatives_0.eContents().get(1); private final Keyword cTypeNameSystemKeyword_0_2 = (Keyword)cTypeNameAlternatives_0.eContents().get(2); private final Keyword cTypeNameVerificationKeyword_0_3 = (Keyword)cTypeNameAlternatives_0.eContents().get(3); //DecompositionType: // typeName=('environment' | 'operator' | 'system' | 'verification'); @Override public ParserRule getRule() { return rule; } //typeName=('environment' | 'operator' | 'system' | 'verification') public Assignment getTypeNameAssignment() { return cTypeNameAssignment; } //('environment' | 'operator' | 'system' | 'verification') public Alternatives getTypeNameAlternatives_0() { return cTypeNameAlternatives_0; } //'environment' public Keyword getTypeNameEnvironmentKeyword_0_0() { return cTypeNameEnvironmentKeyword_0_0; } //'operator' public Keyword getTypeNameOperatorKeyword_0_1() { return cTypeNameOperatorKeyword_0_1; } //'system' public Keyword getTypeNameSystemKeyword_0_2() { return cTypeNameSystemKeyword_0_2; } //'verification' public Keyword getTypeNameVerificationKeyword_0_3() { return cTypeNameVerificationKeyword_0_3; } } public class DocumentElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.Document"); private final Group cGroup = (Group)rule.eContents().get(1); private final Keyword cLeftCurlyBracketKeyword_0 = (Keyword)cGroup.eContents().get(0); private final Assignment cEntriesAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cEntriesDocItemParserRuleCall_1_0 = (RuleCall)cEntriesAssignment_1.eContents().get(0); private final Keyword cRightCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2); //Document: // '{' entries+=DocItem+ '}'; @Override public ParserRule getRule() { return rule; } //'{' entries+=DocItem+ '}' public Group getGroup() { return cGroup; } //'{' public Keyword getLeftCurlyBracketKeyword_0() { return cLeftCurlyBracketKeyword_0; } //entries+=DocItem+ public Assignment getEntriesAssignment_1() { return cEntriesAssignment_1; } //DocItem public RuleCall getEntriesDocItemParserRuleCall_1_0() { return cEntriesDocItemParserRuleCall_1_0; } //'}' public Keyword getRightCurlyBracketKeyword_2() { return cRightCurlyBracketKeyword_2; } } public class DocItemTypeElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.DocItemType"); private final Assignment cTypeNameAssignment = (Assignment)rule.eContents().get(1); private final Alternatives cTypeNameAlternatives_0 = (Alternatives)cTypeNameAssignment.eContents().get(0); private final Keyword cTypeNameConditionKeyword_0_0 = (Keyword)cTypeNameAlternatives_0.eContents().get(0); private final Keyword cTypeNameFigureKeyword_0_1 = (Keyword)cTypeNameAlternatives_0.eContents().get(1); private final Keyword cTypeNameBreakKeyword_0_2 = (Keyword)cTypeNameAlternatives_0.eContents().get(2); private final Keyword cTypeNameModelKeyword_0_3 = (Keyword)cTypeNameAlternatives_0.eContents().get(3); private final Keyword cTypeNameParagraphKeyword_0_4 = (Keyword)cTypeNameAlternatives_0.eContents().get(4); private final Keyword cTypeNameSectionKeyword_0_5 = (Keyword)cTypeNameAlternatives_0.eContents().get(5); private final Keyword cTypeNameTableKeyword_0_6 = (Keyword)cTypeNameAlternatives_0.eContents().get(6); //DocItemType: // typeName=('condition' | 'figure' | 'break' | 'model' | 'paragraph' | 'section' | 'table'); @Override public ParserRule getRule() { return rule; } //typeName=('condition' | 'figure' | 'break' | 'model' | 'paragraph' | 'section' | 'table') public Assignment getTypeNameAssignment() { return cTypeNameAssignment; } //('condition' | 'figure' | 'break' | 'model' | 'paragraph' | 'section' | 'table') public Alternatives getTypeNameAlternatives_0() { return cTypeNameAlternatives_0; } //'condition' public Keyword getTypeNameConditionKeyword_0_0() { return cTypeNameConditionKeyword_0_0; } //'figure' public Keyword getTypeNameFigureKeyword_0_1() { return cTypeNameFigureKeyword_0_1; } //'break' public Keyword getTypeNameBreakKeyword_0_2() { return cTypeNameBreakKeyword_0_2; } //'model' public Keyword getTypeNameModelKeyword_0_3() { return cTypeNameModelKeyword_0_3; } //'paragraph' public Keyword getTypeNameParagraphKeyword_0_4() { return cTypeNameParagraphKeyword_0_4; } //'section' public Keyword getTypeNameSectionKeyword_0_5() { return cTypeNameSectionKeyword_0_5; } //'table' public Keyword getTypeNameTableKeyword_0_6() { return cTypeNameTableKeyword_0_6; } } public class DocItemElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.DocItem"); private final Group cGroup = (Group)rule.eContents().get(1); private final Assignment cTypeAssignment_0 = (Assignment)cGroup.eContents().get(0); private final RuleCall cTypeDocItemTypeParserRuleCall_0_0 = (RuleCall)cTypeAssignment_0.eContents().get(0); private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); private final Assignment cRefAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cRefSTRINGTerminalRuleCall_2_0 = (RuleCall)cRefAssignment_2.eContents().get(0); private final Keyword cSemicolonKeyword_3 = (Keyword)cGroup.eContents().get(3); //DocItem: // type=DocItemType // name=ID // ref=STRING // ';'; @Override public ParserRule getRule() { return rule; } //type=DocItemType name=ID ref=STRING ';' public Group getGroup() { return cGroup; } //type=DocItemType public Assignment getTypeAssignment_0() { return cTypeAssignment_0; } //DocItemType public RuleCall getTypeDocItemTypeParserRuleCall_0_0() { return cTypeDocItemTypeParserRuleCall_0_0; } //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } //ref=STRING public Assignment getRefAssignment_2() { return cRefAssignment_2; } //STRING public RuleCall getRefSTRINGTerminalRuleCall_2_0() { return cRefSTRINGTerminalRuleCall_2_0; } //';' public Keyword getSemicolonKeyword_3() { return cSemicolonKeyword_3; } } public class ModelTypeElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.ModelType"); private final Assignment cTypeNameAssignment = (Assignment)rule.eContents().get(1); private final Alternatives cTypeNameAlternatives_0 = (Alternatives)cTypeNameAssignment.eContents().get(0); private final Keyword cTypeNameOutputKeyword_0_0 = (Keyword)cTypeNameAlternatives_0.eContents().get(0); private final Keyword cTypeNameModeKeyword_0_1 = (Keyword)cTypeNameAlternatives_0.eContents().get(1); private final Keyword cTypeNameStateKeyword_0_2 = (Keyword)cTypeNameAlternatives_0.eContents().get(2); private final Keyword cTypeNameMacroKeyword_0_3 = (Keyword)cTypeNameAlternatives_0.eContents().get(3); private final Keyword cTypeNameFunctionKeyword_0_4 = (Keyword)cTypeNameAlternatives_0.eContents().get(4); private final Keyword cTypeNameInputKeyword_0_5 = (Keyword)cTypeNameAlternatives_0.eContents().get(5); //ModelType: // typeName=('output' | 'mode' | 'state' | 'macro' | 'function' | 'input'); @Override public ParserRule getRule() { return rule; } //typeName=('output' | 'mode' | 'state' | 'macro' | 'function' | 'input') public Assignment getTypeNameAssignment() { return cTypeNameAssignment; } //('output' | 'mode' | 'state' | 'macro' | 'function' | 'input') public Alternatives getTypeNameAlternatives_0() { return cTypeNameAlternatives_0; } //'output' public Keyword getTypeNameOutputKeyword_0_0() { return cTypeNameOutputKeyword_0_0; } //'mode' public Keyword getTypeNameModeKeyword_0_1() { return cTypeNameModeKeyword_0_1; } //'state' public Keyword getTypeNameStateKeyword_0_2() { return cTypeNameStateKeyword_0_2; } //'macro' public Keyword getTypeNameMacroKeyword_0_3() { return cTypeNameMacroKeyword_0_3; } //'function' public Keyword getTypeNameFunctionKeyword_0_4() { return cTypeNameFunctionKeyword_0_4; } //'input' public Keyword getTypeNameInputKeyword_0_5() { return cTypeNameInputKeyword_0_5; } } public class ModelItemElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.ModelItem"); private final Group cGroup = (Group)rule.eContents().get(1); private final Assignment cTypeAssignment_0 = (Assignment)cGroup.eContents().get(0); private final RuleCall cTypeModelTypeParserRuleCall_0_0 = (RuleCall)cTypeAssignment_0.eContents().get(0); private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); private final Assignment cDescAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cDescSTRINGTerminalRuleCall_2_0 = (RuleCall)cDescAssignment_2.eContents().get(0); private final Keyword cSemicolonKeyword_3 = (Keyword)cGroup.eContents().get(3); //ModelItem: // type=ModelType // name=ID // desc=STRING // ';'; @Override public ParserRule getRule() { return rule; } //type=ModelType name=ID desc=STRING ';' public Group getGroup() { return cGroup; } //type=ModelType public Assignment getTypeAssignment_0() { return cTypeAssignment_0; } //ModelType public RuleCall getTypeModelTypeParserRuleCall_0_0() { return cTypeModelTypeParserRuleCall_0_0; } //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } //desc=STRING public Assignment getDescAssignment_2() { return cDescAssignment_2; } //STRING public RuleCall getDescSTRINGTerminalRuleCall_2_0() { return cDescSTRINGTerminalRuleCall_2_0; } //';' public Keyword getSemicolonKeyword_3() { return cSemicolonKeyword_3; } } public class ListItemTypeElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.ListItemType"); private final Assignment cTypeNameAssignment = (Assignment)rule.eContents().get(1); private final Alternatives cTypeNameAlternatives_0 = (Alternatives)cTypeNameAssignment.eContents().get(0); private final Keyword cTypeNameRequirementKeyword_0_0 = (Keyword)cTypeNameAlternatives_0.eContents().get(0); private final Keyword cTypeNameGoalKeyword_0_1 = (Keyword)cTypeNameAlternatives_0.eContents().get(1); private final Keyword cTypeNameHazardKeyword_0_2 = (Keyword)cTypeNameAlternatives_0.eContents().get(2); private final Keyword cTypeNameConstraintKeyword_0_3 = (Keyword)cTypeNameAlternatives_0.eContents().get(3); //ListItemType: // typeName=('requirement' | 'goal' | 'hazard' | 'constraint'); @Override public ParserRule getRule() { return rule; } //typeName=('requirement' | 'goal' | 'hazard' | 'constraint') public Assignment getTypeNameAssignment() { return cTypeNameAssignment; } //('requirement' | 'goal' | 'hazard' | 'constraint') public Alternatives getTypeNameAlternatives_0() { return cTypeNameAlternatives_0; } //'requirement' public Keyword getTypeNameRequirementKeyword_0_0() { return cTypeNameRequirementKeyword_0_0; } //'goal' public Keyword getTypeNameGoalKeyword_0_1() { return cTypeNameGoalKeyword_0_1; } //'hazard' public Keyword getTypeNameHazardKeyword_0_2() { return cTypeNameHazardKeyword_0_2; } //'constraint' public Keyword getTypeNameConstraintKeyword_0_3() { return cTypeNameConstraintKeyword_0_3; } } public class ListItemElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "net.certware.intent.IntentSpecification.ListItem"); private final Group cGroup = (Group)rule.eContents().get(1); private final Assignment cTypeAssignment_0 = (Assignment)cGroup.eContents().get(0); private final RuleCall cTypeListItemTypeParserRuleCall_0_0 = (RuleCall)cTypeAssignment_0.eContents().get(0); private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); private final Assignment cDescAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cDescSTRINGTerminalRuleCall_2_0 = (RuleCall)cDescAssignment_2.eContents().get(0); private final Group cGroup_3 = (Group)cGroup.eContents().get(3); private final Keyword cLeftCurlyBracketKeyword_3_0 = (Keyword)cGroup_3.eContents().get(0); private final Assignment cDocReferencesAssignment_3_1 = (Assignment)cGroup_3.eContents().get(1); private final CrossReference cDocReferencesDocItemCrossReference_3_1_0 = (CrossReference)cDocReferencesAssignment_3_1.eContents().get(0); private final RuleCall cDocReferencesDocItemIDTerminalRuleCall_3_1_0_1 = (RuleCall)cDocReferencesDocItemCrossReference_3_1_0.eContents().get(1); private final Keyword cRightCurlyBracketKeyword_3_2 = (Keyword)cGroup_3.eContents().get(2); private final Group cGroup_4 = (Group)cGroup.eContents().get(4); private final Keyword cLeftParenthesisKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0); private final Assignment cItemReferencesAssignment_4_1 = (Assignment)cGroup_4.eContents().get(1); private final CrossReference cItemReferencesListItemCrossReference_4_1_0 = (CrossReference)cItemReferencesAssignment_4_1.eContents().get(0); private final RuleCall cItemReferencesListItemIDTerminalRuleCall_4_1_0_1 = (RuleCall)cItemReferencesListItemCrossReference_4_1_0.eContents().get(1); private final Keyword cRightParenthesisKeyword_4_2 = (Keyword)cGroup_4.eContents().get(2); private final Group cGroup_5 = (Group)cGroup.eContents().get(5); private final Keyword cLeftSquareBracketKeyword_5_0 = (Keyword)cGroup_5.eContents().get(0); private final Assignment cModelReferencesAssignment_5_1 = (Assignment)cGroup_5.eContents().get(1); private final CrossReference cModelReferencesModelItemCrossReference_5_1_0 = (CrossReference)cModelReferencesAssignment_5_1.eContents().get(0); private final RuleCall cModelReferencesModelItemIDTerminalRuleCall_5_1_0_1 = (RuleCall)cModelReferencesModelItemCrossReference_5_1_0.eContents().get(1); private final Keyword cRightSquareBracketKeyword_5_2 = (Keyword)cGroup_5.eContents().get(2); private final Keyword cSemicolonKeyword_6 = (Keyword)cGroup.eContents().get(6); /// * // * A list item has a type, description and lists of references. // * / ListItem: // type=ListItemType // name=ID // desc=STRING ('{' docReferences+=[DocItem]+ '}')? ('(' itemReferences+=[ListItem]+ ')')? ('[' // modelReferences+=[ModelItem]+ ']')? // ';'; @Override public ParserRule getRule() { return rule; } //type=ListItemType name=ID desc=STRING ('{' docReferences+=[DocItem]+ '}')? ('(' itemReferences+=[ListItem]+ ')')? ('[' //modelReferences+=[ModelItem]+ ']')? ';' public Group getGroup() { return cGroup; } //type=ListItemType public Assignment getTypeAssignment_0() { return cTypeAssignment_0; } //ListItemType public RuleCall getTypeListItemTypeParserRuleCall_0_0() { return cTypeListItemTypeParserRuleCall_0_0; } //name=ID public Assignment getNameAssignment_1() { return cNameAssignment_1; } //ID public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } //desc=STRING public Assignment getDescAssignment_2() { return cDescAssignment_2; } //STRING public RuleCall getDescSTRINGTerminalRuleCall_2_0() { return cDescSTRINGTerminalRuleCall_2_0; } //('{' docReferences+=[DocItem]+ '}')? public Group getGroup_3() { return cGroup_3; } //'{' public Keyword getLeftCurlyBracketKeyword_3_0() { return cLeftCurlyBracketKeyword_3_0; } //docReferences+=[DocItem]+ public Assignment getDocReferencesAssignment_3_1() { return cDocReferencesAssignment_3_1; } //[DocItem] public CrossReference getDocReferencesDocItemCrossReference_3_1_0() { return cDocReferencesDocItemCrossReference_3_1_0; } //ID public RuleCall getDocReferencesDocItemIDTerminalRuleCall_3_1_0_1() { return cDocReferencesDocItemIDTerminalRuleCall_3_1_0_1; } //'}' public Keyword getRightCurlyBracketKeyword_3_2() { return cRightCurlyBracketKeyword_3_2; } //('(' itemReferences+=[ListItem]+ ')')? public Group getGroup_4() { return cGroup_4; } //'(' public Keyword getLeftParenthesisKeyword_4_0() { return cLeftParenthesisKeyword_4_0; } //itemReferences+=[ListItem]+ public Assignment getItemReferencesAssignment_4_1() { return cItemReferencesAssignment_4_1; } //[ListItem] public CrossReference getItemReferencesListItemCrossReference_4_1_0() { return cItemReferencesListItemCrossReference_4_1_0; } //ID public RuleCall getItemReferencesListItemIDTerminalRuleCall_4_1_0_1() { return cItemReferencesListItemIDTerminalRuleCall_4_1_0_1; } //')' public Keyword getRightParenthesisKeyword_4_2() { return cRightParenthesisKeyword_4_2; } //('[' modelReferences+=[ModelItem]+ ']')? public Group getGroup_5() { return cGroup_5; } //'[' public Keyword getLeftSquareBracketKeyword_5_0() { return cLeftSquareBracketKeyword_5_0; } //modelReferences+=[ModelItem]+ public Assignment getModelReferencesAssignment_5_1() { return cModelReferencesAssignment_5_1; } //[ModelItem] public CrossReference getModelReferencesModelItemCrossReference_5_1_0() { return cModelReferencesModelItemCrossReference_5_1_0; } //ID public RuleCall getModelReferencesModelItemIDTerminalRuleCall_5_1_0_1() { return cModelReferencesModelItemIDTerminalRuleCall_5_1_0_1; } //']' public Keyword getRightSquareBracketKeyword_5_2() { return cRightSquareBracketKeyword_5_2; } //';' public Keyword getSemicolonKeyword_6() { return cSemicolonKeyword_6; } } private final SpecificationElements pSpecification; private final RefinementElements pRefinement; private final IntentElements pIntent; private final IntentTypeElements pIntentType; private final DecompositionElements pDecomposition; private final DecompositionTypeElements pDecompositionType; private final DocumentElements pDocument; private final DocItemTypeElements pDocItemType; private final DocItemElements pDocItem; private final ModelTypeElements pModelType; private final ModelItemElements pModelItem; private final ListItemTypeElements pListItemType; private final ListItemElements pListItem; private final Grammar grammar; private final TerminalsGrammarAccess gaTerminals; @Inject public IntentSpecificationGrammarAccess(GrammarProvider grammarProvider, TerminalsGrammarAccess gaTerminals) { this.grammar = internalFindGrammar(grammarProvider); this.gaTerminals = gaTerminals; this.pSpecification = new SpecificationElements(); this.pRefinement = new RefinementElements(); this.pIntent = new IntentElements(); this.pIntentType = new IntentTypeElements(); this.pDecomposition = new DecompositionElements(); this.pDecompositionType = new DecompositionTypeElements(); this.pDocument = new DocumentElements(); this.pDocItemType = new DocItemTypeElements(); this.pDocItem = new DocItemElements(); this.pModelType = new ModelTypeElements(); this.pModelItem = new ModelItemElements(); this.pListItemType = new ListItemTypeElements(); this.pListItem = new ListItemElements(); } protected Grammar internalFindGrammar(GrammarProvider grammarProvider) { Grammar grammar = grammarProvider.getGrammar(this); while (grammar != null) { if ("net.certware.intent.IntentSpecification".equals(grammar.getName())) { return grammar; } List<Grammar> grammars = grammar.getUsedGrammars(); if (!grammars.isEmpty()) { grammar = grammars.iterator().next(); } else { return null; } } return grammar; } @Override public Grammar getGrammar() { return grammar; } public TerminalsGrammarAccess getTerminalsGrammarAccess() { return gaTerminals; } /// * // * An intent specification consists of one or more refinements. // * / Specification: // 'specification' // name=ID // refinements+=Refinement+; public SpecificationElements getSpecificationAccess() { return pSpecification; } public ParserRule getSpecificationRule() { return getSpecificationAccess().getRule(); } /// * // * A refinement has no type and consists of one or more intents. // * / Refinement: // 'refinement' // name=ID // desc=STRING // intents+=Intent+; public RefinementElements getRefinementAccess() { return pRefinement; } public ParserRule getRefinementRule() { return getRefinementAccess().getRule(); } /// * // * An intent has a type and consists of one or more decompositions. // * / Intent: // type=IntentType // name=ID // desc=STRING // decompositions+=Decomposition+; public IntentElements getIntentAccess() { return pIntent; } public ParserRule getIntentRule() { return getIntentAccess().getRule(); } /// * // * Intent types refer to the different levels of the canonical model. // * The grammar does not enforce their universal containment in a specification. // * A proper intention specification should contain an intent of each type in each refinement. // * / IntentType: // typeName=('basic' | 'purpose' | 'principles' | 'models' | 'design' | 'implementation' | 'operation'); public IntentTypeElements getIntentTypeAccess() { return pIntentType; } public ParserRule getIntentTypeRule() { return getIntentTypeAccess().getRule(); } /// * // * A decomposition has a type and consists of one or more models, documents, or items. // * / Decomposition: // type=DecompositionType // name=ID // desc=STRING ('{' documents+=Document* '}')? ('[' models+=ModelItem* ']')? ('(' items+=ListItem* ')')?; public DecompositionElements getDecompositionAccess() { return pDecomposition; } public ParserRule getDecompositionRule() { return getDecompositionAccess().getRule(); } //DecompositionType: // typeName=('environment' | 'operator' | 'system' | 'verification'); public DecompositionTypeElements getDecompositionTypeAccess() { return pDecompositionType; } public ParserRule getDecompositionTypeRule() { return getDecompositionTypeAccess().getRule(); } //Document: // '{' entries+=DocItem+ '}'; public DocumentElements getDocumentAccess() { return pDocument; } public ParserRule getDocumentRule() { return getDocumentAccess().getRule(); } //DocItemType: // typeName=('condition' | 'figure' | 'break' | 'model' | 'paragraph' | 'section' | 'table'); public DocItemTypeElements getDocItemTypeAccess() { return pDocItemType; } public ParserRule getDocItemTypeRule() { return getDocItemTypeAccess().getRule(); } //DocItem: // type=DocItemType // name=ID // ref=STRING // ';'; public DocItemElements getDocItemAccess() { return pDocItem; } public ParserRule getDocItemRule() { return getDocItemAccess().getRule(); } //ModelType: // typeName=('output' | 'mode' | 'state' | 'macro' | 'function' | 'input'); public ModelTypeElements getModelTypeAccess() { return pModelType; } public ParserRule getModelTypeRule() { return getModelTypeAccess().getRule(); } //ModelItem: // type=ModelType // name=ID // desc=STRING // ';'; public ModelItemElements getModelItemAccess() { return pModelItem; } public ParserRule getModelItemRule() { return getModelItemAccess().getRule(); } //ListItemType: // typeName=('requirement' | 'goal' | 'hazard' | 'constraint'); public ListItemTypeElements getListItemTypeAccess() { return pListItemType; } public ParserRule getListItemTypeRule() { return getListItemTypeAccess().getRule(); } /// * // * A list item has a type, description and lists of references. // * / ListItem: // type=ListItemType // name=ID // desc=STRING ('{' docReferences+=[DocItem]+ '}')? ('(' itemReferences+=[ListItem]+ ')')? ('[' // modelReferences+=[ModelItem]+ ']')? // ';'; public ListItemElements getListItemAccess() { return pListItem; } public ParserRule getListItemRule() { return getListItemAccess().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: // '"' ('\\' . | !('\\' | '"'))* '"' | // "'" ('\\' . | !('\\' | "'"))* "'"; 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(); } }