| /***************************************************************************** |
| * Copyright (c) 2017 CEA LIST. |
| * |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * |
| * Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation |
| * |
| *****************************************************************************/ |
| /* |
| * generated by Xtext 2.11.0 |
| */ |
| package org.eclipse.papyrus.requirements.sysml14.services; |
| |
| import com.google.inject.Inject; |
| import com.google.inject.Singleton; |
| import java.util.List; |
| import org.eclipse.xtext.Alternatives; |
| import org.eclipse.xtext.Assignment; |
| import org.eclipse.xtext.Grammar; |
| import org.eclipse.xtext.GrammarUtil; |
| import org.eclipse.xtext.Group; |
| import org.eclipse.xtext.Keyword; |
| import org.eclipse.xtext.ParserRule; |
| import org.eclipse.xtext.RuleCall; |
| import org.eclipse.xtext.TerminalRule; |
| import org.eclipse.xtext.common.services.TerminalsGrammarAccess; |
| import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder; |
| import org.eclipse.xtext.service.GrammarProvider; |
| |
| @Singleton |
| public class BoilerplateTextGrammarAccess extends AbstractGrammarElementFinder { |
| |
| public class ModelElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.Model"); |
| private final Assignment cModelAssignment = (Assignment)rule.eContents().get(1); |
| private final RuleCall cModelRequirementParserRuleCall_0 = (RuleCall)cModelAssignment.eContents().get(0); |
| |
| //Model: |
| // model=Requirement; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //model=Requirement |
| public Assignment getModelAssignment() { return cModelAssignment; } |
| |
| //Requirement |
| public RuleCall getModelRequirementParserRuleCall_0() { return cModelRequirementParserRuleCall_0; } |
| } |
| public class RequirementElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.Requirement"); |
| private final Group cGroup = (Group)rule.eContents().get(1); |
| private final Group cGroup_0 = (Group)cGroup.eContents().get(0); |
| private final Assignment cPrefixAssignment_0_0 = (Assignment)cGroup_0.eContents().get(0); |
| private final RuleCall cPrefixPrefixParserRuleCall_0_0_0 = (RuleCall)cPrefixAssignment_0_0.eContents().get(0); |
| private final Keyword cCommaKeyword_0_1 = (Keyword)cGroup_0.eContents().get(1); |
| private final Assignment cSystemAssignment_1 = (Assignment)cGroup.eContents().get(1); |
| private final RuleCall cSystemSubjectParserRuleCall_1_0 = (RuleCall)cSystemAssignment_1.eContents().get(0); |
| private final Assignment cPredicateAssignment_2 = (Assignment)cGroup.eContents().get(2); |
| private final RuleCall cPredicatePredicateParserRuleCall_2_0 = (RuleCall)cPredicateAssignment_2.eContents().get(0); |
| |
| //Requirement: |
| // (prefix=Prefix ",")? |
| // system=Subject |
| // predicate=Predicate; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //(prefix=Prefix ",")? system=Subject predicate=Predicate |
| public Group getGroup() { return cGroup; } |
| |
| //(prefix=Prefix ",")? |
| public Group getGroup_0() { return cGroup_0; } |
| |
| //prefix=Prefix |
| public Assignment getPrefixAssignment_0_0() { return cPrefixAssignment_0_0; } |
| |
| //Prefix |
| public RuleCall getPrefixPrefixParserRuleCall_0_0_0() { return cPrefixPrefixParserRuleCall_0_0_0; } |
| |
| //"," |
| public Keyword getCommaKeyword_0_1() { return cCommaKeyword_0_1; } |
| |
| //system=Subject |
| public Assignment getSystemAssignment_1() { return cSystemAssignment_1; } |
| |
| //Subject |
| public RuleCall getSystemSubjectParserRuleCall_1_0() { return cSystemSubjectParserRuleCall_1_0; } |
| |
| //predicate=Predicate |
| public Assignment getPredicateAssignment_2() { return cPredicateAssignment_2; } |
| |
| //Predicate |
| public RuleCall getPredicatePredicateParserRuleCall_2_0() { return cPredicatePredicateParserRuleCall_2_0; } |
| } |
| public class SubjectElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.Subject"); |
| private final Assignment cSystemAssignment = (Assignment)rule.eContents().get(1); |
| private final RuleCall cSystemSTRINGTerminalRuleCall_0 = (RuleCall)cSystemAssignment.eContents().get(0); |
| |
| //Subject: |
| // system=STRING; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //system=STRING |
| public Assignment getSystemAssignment() { return cSystemAssignment; } |
| |
| //STRING |
| public RuleCall getSystemSTRINGTerminalRuleCall_0() { return cSystemSTRINGTerminalRuleCall_0; } |
| } |
| public class PrefixElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.Prefix"); |
| private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); |
| private final RuleCall cIfParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); |
| private final RuleCall cWhileParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); |
| |
| //Prefix: |
| // If | While; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //If | While |
| public Alternatives getAlternatives() { return cAlternatives; } |
| |
| //If |
| public RuleCall getIfParserRuleCall_0() { return cIfParserRuleCall_0; } |
| |
| //While |
| public RuleCall getWhileParserRuleCall_1() { return cWhileParserRuleCall_1; } |
| } |
| public class IfElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.If"); |
| private final Group cGroup = (Group)rule.eContents().get(1); |
| private final Keyword cIfKeyword_0 = (Keyword)cGroup.eContents().get(0); |
| private final Assignment cEventAssignment_1 = (Assignment)cGroup.eContents().get(1); |
| private final RuleCall cEventSTRINGTerminalRuleCall_1_0 = (RuleCall)cEventAssignment_1.eContents().get(0); |
| private final Group cGroup_2 = (Group)cGroup.eContents().get(2); |
| private final Keyword cAndKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); |
| private final Assignment cEventAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1); |
| private final RuleCall cEventSTRINGTerminalRuleCall_2_1_0 = (RuleCall)cEventAssignment_2_1.eContents().get(0); |
| |
| //If: |
| // "if" event+=STRING ("and" event+=STRING)*; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //"if" event+=STRING ("and" event+=STRING)* |
| public Group getGroup() { return cGroup; } |
| |
| //"if" |
| public Keyword getIfKeyword_0() { return cIfKeyword_0; } |
| |
| //event+=STRING |
| public Assignment getEventAssignment_1() { return cEventAssignment_1; } |
| |
| //STRING |
| public RuleCall getEventSTRINGTerminalRuleCall_1_0() { return cEventSTRINGTerminalRuleCall_1_0; } |
| |
| //("and" event+=STRING)* |
| public Group getGroup_2() { return cGroup_2; } |
| |
| //"and" |
| public Keyword getAndKeyword_2_0() { return cAndKeyword_2_0; } |
| |
| //event+=STRING |
| public Assignment getEventAssignment_2_1() { return cEventAssignment_2_1; } |
| |
| //STRING |
| public RuleCall getEventSTRINGTerminalRuleCall_2_1_0() { return cEventSTRINGTerminalRuleCall_2_1_0; } |
| } |
| public class WhileElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.While"); |
| private final Group cGroup = (Group)rule.eContents().get(1); |
| private final Keyword cWhileKeyword_0 = (Keyword)cGroup.eContents().get(0); |
| private final Assignment cStateAssignment_1 = (Assignment)cGroup.eContents().get(1); |
| private final RuleCall cStateSTRINGTerminalRuleCall_1_0 = (RuleCall)cStateAssignment_1.eContents().get(0); |
| |
| //While: |
| // "while" state=STRING; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //"while" state=STRING |
| public Group getGroup() { return cGroup; } |
| |
| //"while" |
| public Keyword getWhileKeyword_0() { return cWhileKeyword_0; } |
| |
| //state=STRING |
| public Assignment getStateAssignment_1() { return cStateAssignment_1; } |
| |
| //STRING |
| public RuleCall getStateSTRINGTerminalRuleCall_1_0() { return cStateSTRINGTerminalRuleCall_1_0; } |
| } |
| public class PredicateElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.Predicate"); |
| private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); |
| private final RuleCall cShallParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); |
| private final RuleCall cShallNotParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); |
| private final RuleCall cShallAllowParserRuleCall_2 = (RuleCall)cAlternatives.eContents().get(2); |
| private final RuleCall cShallNotAllowParserRuleCall_3 = (RuleCall)cAlternatives.eContents().get(3); |
| |
| //Predicate: |
| // Shall | ShallNot | ShallAllow | ShallNotAllow; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //Shall | ShallNot | ShallAllow | ShallNotAllow |
| public Alternatives getAlternatives() { return cAlternatives; } |
| |
| //Shall |
| public RuleCall getShallParserRuleCall_0() { return cShallParserRuleCall_0; } |
| |
| //ShallNot |
| public RuleCall getShallNotParserRuleCall_1() { return cShallNotParserRuleCall_1; } |
| |
| //ShallAllow |
| public RuleCall getShallAllowParserRuleCall_2() { return cShallAllowParserRuleCall_2; } |
| |
| //ShallNotAllow |
| public RuleCall getShallNotAllowParserRuleCall_3() { return cShallNotAllowParserRuleCall_3; } |
| } |
| public class ShallNotAllowElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.ShallNotAllow"); |
| private final Group cGroup = (Group)rule.eContents().get(1); |
| private final Keyword cShallKeyword_0 = (Keyword)cGroup.eContents().get(0); |
| private final Keyword cNotKeyword_1 = (Keyword)cGroup.eContents().get(1); |
| private final Keyword cAllowKeyword_2 = (Keyword)cGroup.eContents().get(2); |
| private final Alternatives cAlternatives_3 = (Alternatives)cGroup.eContents().get(3); |
| private final Assignment cActionAssignment_3_0 = (Assignment)cAlternatives_3.eContents().get(0); |
| private final RuleCall cActionSTRINGTerminalRuleCall_3_0_0 = (RuleCall)cActionAssignment_3_0.eContents().get(0); |
| private final Group cGroup_3_1 = (Group)cAlternatives_3.eContents().get(1); |
| private final Assignment cEntityAssignment_3_1_0 = (Assignment)cGroup_3_1.eContents().get(0); |
| private final RuleCall cEntitySTRINGTerminalRuleCall_3_1_0_0 = (RuleCall)cEntityAssignment_3_1_0.eContents().get(0); |
| private final Keyword cToKeyword_3_1_1 = (Keyword)cGroup_3_1.eContents().get(1); |
| private final Assignment cActionPerformedByEntityAssignment_3_1_2 = (Assignment)cGroup_3_1.eContents().get(2); |
| private final RuleCall cActionPerformedByEntitySTRINGTerminalRuleCall_3_1_2_0 = (RuleCall)cActionPerformedByEntityAssignment_3_1_2.eContents().get(0); |
| |
| //ShallNotAllow: |
| // "shall" -> "not" -> "allow" (action=STRING | entity=STRING "to" actionPerformedByEntity=STRING); |
| @Override public ParserRule getRule() { return rule; } |
| |
| //"shall" -> "not" -> "allow" (action=STRING | entity=STRING "to" actionPerformedByEntity=STRING) |
| public Group getGroup() { return cGroup; } |
| |
| //"shall" |
| public Keyword getShallKeyword_0() { return cShallKeyword_0; } |
| |
| //-> "not" |
| public Keyword getNotKeyword_1() { return cNotKeyword_1; } |
| |
| //-> "allow" |
| public Keyword getAllowKeyword_2() { return cAllowKeyword_2; } |
| |
| //action=STRING | entity=STRING "to" actionPerformedByEntity=STRING |
| public Alternatives getAlternatives_3() { return cAlternatives_3; } |
| |
| //action=STRING |
| public Assignment getActionAssignment_3_0() { return cActionAssignment_3_0; } |
| |
| //STRING |
| public RuleCall getActionSTRINGTerminalRuleCall_3_0_0() { return cActionSTRINGTerminalRuleCall_3_0_0; } |
| |
| //entity=STRING "to" actionPerformedByEntity=STRING |
| public Group getGroup_3_1() { return cGroup_3_1; } |
| |
| //entity=STRING |
| public Assignment getEntityAssignment_3_1_0() { return cEntityAssignment_3_1_0; } |
| |
| //STRING |
| public RuleCall getEntitySTRINGTerminalRuleCall_3_1_0_0() { return cEntitySTRINGTerminalRuleCall_3_1_0_0; } |
| |
| //"to" |
| public Keyword getToKeyword_3_1_1() { return cToKeyword_3_1_1; } |
| |
| //actionPerformedByEntity=STRING |
| public Assignment getActionPerformedByEntityAssignment_3_1_2() { return cActionPerformedByEntityAssignment_3_1_2; } |
| |
| //STRING |
| public RuleCall getActionPerformedByEntitySTRINGTerminalRuleCall_3_1_2_0() { return cActionPerformedByEntitySTRINGTerminalRuleCall_3_1_2_0; } |
| } |
| public class ShallAllowElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.ShallAllow"); |
| private final Group cGroup = (Group)rule.eContents().get(1); |
| private final Keyword cShallKeyword_0 = (Keyword)cGroup.eContents().get(0); |
| private final Keyword cAllowKeyword_1 = (Keyword)cGroup.eContents().get(1); |
| private final Alternatives cAlternatives_2 = (Alternatives)cGroup.eContents().get(2); |
| private final Assignment cActionAssignment_2_0 = (Assignment)cAlternatives_2.eContents().get(0); |
| private final RuleCall cActionSTRINGTerminalRuleCall_2_0_0 = (RuleCall)cActionAssignment_2_0.eContents().get(0); |
| private final Group cGroup_2_1 = (Group)cAlternatives_2.eContents().get(1); |
| private final Assignment cEntityAssignment_2_1_0 = (Assignment)cGroup_2_1.eContents().get(0); |
| private final RuleCall cEntitySTRINGTerminalRuleCall_2_1_0_0 = (RuleCall)cEntityAssignment_2_1_0.eContents().get(0); |
| private final Keyword cToKeyword_2_1_1 = (Keyword)cGroup_2_1.eContents().get(1); |
| private final Assignment cActionPerformedByEntityAssignment_2_1_2 = (Assignment)cGroup_2_1.eContents().get(2); |
| private final RuleCall cActionPerformedByEntitySTRINGTerminalRuleCall_2_1_2_0 = (RuleCall)cActionPerformedByEntityAssignment_2_1_2.eContents().get(0); |
| |
| //ShallAllow: |
| // "shall" -> "allow" (action=STRING | entity=STRING "to" actionPerformedByEntity=STRING); |
| @Override public ParserRule getRule() { return rule; } |
| |
| //"shall" -> "allow" (action=STRING | entity=STRING "to" actionPerformedByEntity=STRING) |
| public Group getGroup() { return cGroup; } |
| |
| //"shall" |
| public Keyword getShallKeyword_0() { return cShallKeyword_0; } |
| |
| //-> "allow" |
| public Keyword getAllowKeyword_1() { return cAllowKeyword_1; } |
| |
| //action=STRING | entity=STRING "to" actionPerformedByEntity=STRING |
| public Alternatives getAlternatives_2() { return cAlternatives_2; } |
| |
| //action=STRING |
| public Assignment getActionAssignment_2_0() { return cActionAssignment_2_0; } |
| |
| //STRING |
| public RuleCall getActionSTRINGTerminalRuleCall_2_0_0() { return cActionSTRINGTerminalRuleCall_2_0_0; } |
| |
| //entity=STRING "to" actionPerformedByEntity=STRING |
| public Group getGroup_2_1() { return cGroup_2_1; } |
| |
| //entity=STRING |
| public Assignment getEntityAssignment_2_1_0() { return cEntityAssignment_2_1_0; } |
| |
| //STRING |
| public RuleCall getEntitySTRINGTerminalRuleCall_2_1_0_0() { return cEntitySTRINGTerminalRuleCall_2_1_0_0; } |
| |
| //"to" |
| public Keyword getToKeyword_2_1_1() { return cToKeyword_2_1_1; } |
| |
| //actionPerformedByEntity=STRING |
| public Assignment getActionPerformedByEntityAssignment_2_1_2() { return cActionPerformedByEntityAssignment_2_1_2; } |
| |
| //STRING |
| public RuleCall getActionPerformedByEntitySTRINGTerminalRuleCall_2_1_2_0() { return cActionPerformedByEntitySTRINGTerminalRuleCall_2_1_2_0; } |
| } |
| public class ShallNotElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.ShallNot"); |
| private final Group cGroup = (Group)rule.eContents().get(1); |
| private final Keyword cShallKeyword_0 = (Keyword)cGroup.eContents().get(0); |
| private final Keyword cNotKeyword_1 = (Keyword)cGroup.eContents().get(1); |
| private final Group cGroup_2 = (Group)cGroup.eContents().get(2); |
| private final Keyword cBeKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); |
| private final Keyword cAbleKeyword_2_1 = (Keyword)cGroup_2.eContents().get(1); |
| private final Keyword cToKeyword_2_2 = (Keyword)cGroup_2.eContents().get(2); |
| private final Assignment cActionAssignment_3 = (Assignment)cGroup.eContents().get(3); |
| private final RuleCall cActionSTRINGTerminalRuleCall_3_0 = (RuleCall)cActionAssignment_3.eContents().get(0); |
| |
| //ShallNot: |
| // "shall" -> "not" ("be" -> "able" -> "to")? action=STRING; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //"shall" -> "not" ("be" -> "able" -> "to")? action=STRING |
| public Group getGroup() { return cGroup; } |
| |
| //"shall" |
| public Keyword getShallKeyword_0() { return cShallKeyword_0; } |
| |
| //-> "not" |
| public Keyword getNotKeyword_1() { return cNotKeyword_1; } |
| |
| //("be" -> "able" -> "to")? |
| public Group getGroup_2() { return cGroup_2; } |
| |
| //"be" |
| public Keyword getBeKeyword_2_0() { return cBeKeyword_2_0; } |
| |
| //-> "able" |
| public Keyword getAbleKeyword_2_1() { return cAbleKeyword_2_1; } |
| |
| //-> "to" |
| public Keyword getToKeyword_2_2() { return cToKeyword_2_2; } |
| |
| //action=STRING |
| public Assignment getActionAssignment_3() { return cActionAssignment_3; } |
| |
| //STRING |
| public RuleCall getActionSTRINGTerminalRuleCall_3_0() { return cActionSTRINGTerminalRuleCall_3_0; } |
| } |
| public class ShallElements extends AbstractParserRuleElementFinder { |
| private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.papyrus.requirements.sysml14.BoilerplateText.Shall"); |
| private final Group cGroup = (Group)rule.eContents().get(1); |
| private final Keyword cShallKeyword_0 = (Keyword)cGroup.eContents().get(0); |
| private final Group cGroup_1 = (Group)cGroup.eContents().get(1); |
| private final Group cGroup_1_0 = (Group)cGroup_1.eContents().get(0); |
| private final Keyword cBeKeyword_1_0_0 = (Keyword)cGroup_1_0.eContents().get(0); |
| private final Keyword cAbleKeyword_1_0_1 = (Keyword)cGroup_1_0.eContents().get(1); |
| private final Keyword cToKeyword_1_0_2 = (Keyword)cGroup_1_0.eContents().get(2); |
| private final Assignment cActionAssignment_2 = (Assignment)cGroup.eContents().get(2); |
| private final RuleCall cActionSTRINGTerminalRuleCall_2_0 = (RuleCall)cActionAssignment_2.eContents().get(0); |
| |
| //Shall: |
| // "shall" -> ("be" -> "able" -> "to")? action=STRING; |
| @Override public ParserRule getRule() { return rule; } |
| |
| //"shall" -> ("be" -> "able" -> "to")? action=STRING |
| public Group getGroup() { return cGroup; } |
| |
| //"shall" |
| public Keyword getShallKeyword_0() { return cShallKeyword_0; } |
| |
| //-> ("be" -> "able" -> "to")? |
| public Group getGroup_1() { return cGroup_1; } |
| |
| //"be" -> "able" -> "to" |
| public Group getGroup_1_0() { return cGroup_1_0; } |
| |
| //"be" |
| public Keyword getBeKeyword_1_0_0() { return cBeKeyword_1_0_0; } |
| |
| //-> "able" |
| public Keyword getAbleKeyword_1_0_1() { return cAbleKeyword_1_0_1; } |
| |
| //-> "to" |
| public Keyword getToKeyword_1_0_2() { return cToKeyword_1_0_2; } |
| |
| //action=STRING |
| public Assignment getActionAssignment_2() { return cActionAssignment_2; } |
| |
| //STRING |
| public RuleCall getActionSTRINGTerminalRuleCall_2_0() { return cActionSTRINGTerminalRuleCall_2_0; } |
| } |
| |
| |
| private final ModelElements pModel; |
| private final RequirementElements pRequirement; |
| private final SubjectElements pSubject; |
| private final PrefixElements pPrefix; |
| private final IfElements pIf; |
| private final WhileElements pWhile; |
| private final PredicateElements pPredicate; |
| private final ShallNotAllowElements pShallNotAllow; |
| private final ShallAllowElements pShallAllow; |
| private final ShallNotElements pShallNot; |
| private final ShallElements pShall; |
| |
| private final Grammar grammar; |
| |
| private final TerminalsGrammarAccess gaTerminals; |
| |
| @Inject |
| public BoilerplateTextGrammarAccess(GrammarProvider grammarProvider, |
| TerminalsGrammarAccess gaTerminals) { |
| this.grammar = internalFindGrammar(grammarProvider); |
| this.gaTerminals = gaTerminals; |
| this.pModel = new ModelElements(); |
| this.pRequirement = new RequirementElements(); |
| this.pSubject = new SubjectElements(); |
| this.pPrefix = new PrefixElements(); |
| this.pIf = new IfElements(); |
| this.pWhile = new WhileElements(); |
| this.pPredicate = new PredicateElements(); |
| this.pShallNotAllow = new ShallNotAllowElements(); |
| this.pShallAllow = new ShallAllowElements(); |
| this.pShallNot = new ShallNotElements(); |
| this.pShall = new ShallElements(); |
| } |
| |
| protected Grammar internalFindGrammar(GrammarProvider grammarProvider) { |
| Grammar grammar = grammarProvider.getGrammar(this); |
| while (grammar != null) { |
| if ("org.eclipse.papyrus.requirements.sysml14.BoilerplateText".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; |
| } |
| |
| |
| //Model: |
| // model=Requirement; |
| public ModelElements getModelAccess() { |
| return pModel; |
| } |
| |
| public ParserRule getModelRule() { |
| return getModelAccess().getRule(); |
| } |
| |
| //Requirement: |
| // (prefix=Prefix ",")? |
| // system=Subject |
| // predicate=Predicate; |
| public RequirementElements getRequirementAccess() { |
| return pRequirement; |
| } |
| |
| public ParserRule getRequirementRule() { |
| return getRequirementAccess().getRule(); |
| } |
| |
| //Subject: |
| // system=STRING; |
| public SubjectElements getSubjectAccess() { |
| return pSubject; |
| } |
| |
| public ParserRule getSubjectRule() { |
| return getSubjectAccess().getRule(); |
| } |
| |
| //Prefix: |
| // If | While; |
| public PrefixElements getPrefixAccess() { |
| return pPrefix; |
| } |
| |
| public ParserRule getPrefixRule() { |
| return getPrefixAccess().getRule(); |
| } |
| |
| //If: |
| // "if" event+=STRING ("and" event+=STRING)*; |
| public IfElements getIfAccess() { |
| return pIf; |
| } |
| |
| public ParserRule getIfRule() { |
| return getIfAccess().getRule(); |
| } |
| |
| //While: |
| // "while" state=STRING; |
| public WhileElements getWhileAccess() { |
| return pWhile; |
| } |
| |
| public ParserRule getWhileRule() { |
| return getWhileAccess().getRule(); |
| } |
| |
| //Predicate: |
| // Shall | ShallNot | ShallAllow | ShallNotAllow; |
| public PredicateElements getPredicateAccess() { |
| return pPredicate; |
| } |
| |
| public ParserRule getPredicateRule() { |
| return getPredicateAccess().getRule(); |
| } |
| |
| //ShallNotAllow: |
| // "shall" -> "not" -> "allow" (action=STRING | entity=STRING "to" actionPerformedByEntity=STRING); |
| public ShallNotAllowElements getShallNotAllowAccess() { |
| return pShallNotAllow; |
| } |
| |
| public ParserRule getShallNotAllowRule() { |
| return getShallNotAllowAccess().getRule(); |
| } |
| |
| //ShallAllow: |
| // "shall" -> "allow" (action=STRING | entity=STRING "to" actionPerformedByEntity=STRING); |
| public ShallAllowElements getShallAllowAccess() { |
| return pShallAllow; |
| } |
| |
| public ParserRule getShallAllowRule() { |
| return getShallAllowAccess().getRule(); |
| } |
| |
| //ShallNot: |
| // "shall" -> "not" ("be" -> "able" -> "to")? action=STRING; |
| public ShallNotElements getShallNotAccess() { |
| return pShallNot; |
| } |
| |
| public ParserRule getShallNotRule() { |
| return getShallNotAccess().getRule(); |
| } |
| |
| //Shall: |
| // "shall" -> ("be" -> "able" -> "to")? action=STRING; |
| public ShallElements getShallAccess() { |
| return pShall; |
| } |
| |
| public ParserRule getShallRule() { |
| return getShallAccess().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(); |
| } |
| } |