projet-mini-genie-logiciel-.../eclipse-workspace/fr.n7.pdl2/src-gen/fr/n7/services/PDL2GrammarAccess.java

487 lines
20 KiB
Java
Raw Normal View History

2021-10-12 16:49:13 +00:00
/*
* generated by Xtext 2.23.0
*/
package fr.n7.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.CrossReference;
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;
import org.eclipse.xtext.service.GrammarProvider;
@Singleton
public class PDL2GrammarAccess extends AbstractElementFinder.AbstractGrammarElementFinder {
public class ProcessElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.Process");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cProcessKeyword_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 Keyword cLeftCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2);
private final Assignment cProcessElementsAssignment_3 = (Assignment)cGroup.eContents().get(3);
private final RuleCall cProcessElementsProcessElementParserRuleCall_3_0 = (RuleCall)cProcessElementsAssignment_3.eContents().get(0);
private final Keyword cRightCurlyBracketKeyword_4 = (Keyword)cGroup.eContents().get(4);
//Process:
// 'process' name=ID '{'
// processElements+=ProcessElement*
// '}';
@Override public ParserRule getRule() { return rule; }
//'process' name=ID '{' processElements+=ProcessElement* '}'
public Group getGroup() { return cGroup; }
//'process'
public Keyword getProcessKeyword_0() { return cProcessKeyword_0; }
//name=ID
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
//ID
public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
//'{'
public Keyword getLeftCurlyBracketKeyword_2() { return cLeftCurlyBracketKeyword_2; }
//processElements+=ProcessElement*
public Assignment getProcessElementsAssignment_3() { return cProcessElementsAssignment_3; }
//ProcessElement
public RuleCall getProcessElementsProcessElementParserRuleCall_3_0() { return cProcessElementsProcessElementParserRuleCall_3_0; }
//'}'
public Keyword getRightCurlyBracketKeyword_4() { return cRightCurlyBracketKeyword_4; }
}
public class ProcessElementElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.ProcessElement");
private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
private final RuleCall cWorkDefinitionParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0);
private final RuleCall cGuidanceParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1);
//ProcessElement:
// WorkDefinition | Guidance;
@Override public ParserRule getRule() { return rule; }
//WorkDefinition | Guidance
public Alternatives getAlternatives() { return cAlternatives; }
//WorkDefinition
public RuleCall getWorkDefinitionParserRuleCall_0() { return cWorkDefinitionParserRuleCall_0; }
//Guidance
public RuleCall getGuidanceParserRuleCall_1() { return cGuidanceParserRuleCall_1; }
}
public class WorkDefinitionElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.WorkDefinition");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cWdKeyword_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 Keyword cLeftCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2);
private final Group cGroup_3 = (Group)cGroup.eContents().get(3);
private final Keyword cStartsKeyword_3_0 = (Keyword)cGroup_3.eContents().get(0);
private final Keyword cIfKeyword_3_1 = (Keyword)cGroup_3.eContents().get(1);
private final Assignment cLinksToPredecessorsAssignment_3_2 = (Assignment)cGroup_3.eContents().get(2);
private final RuleCall cLinksToPredecessorsDependanceStartParserRuleCall_3_2_0 = (RuleCall)cLinksToPredecessorsAssignment_3_2.eContents().get(0);
private final Group cGroup_4 = (Group)cGroup.eContents().get(4);
private final Keyword cFinishesKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0);
private final Keyword cIfKeyword_4_1 = (Keyword)cGroup_4.eContents().get(1);
private final Assignment cLinksToPredecessorsAssignment_4_2 = (Assignment)cGroup_4.eContents().get(2);
private final RuleCall cLinksToPredecessorsDependanceFinishParserRuleCall_4_2_0 = (RuleCall)cLinksToPredecessorsAssignment_4_2.eContents().get(0);
private final Keyword cRightCurlyBracketKeyword_5 = (Keyword)cGroup.eContents().get(5);
//WorkDefinition:
// 'wd' name=ID '{' ('starts' 'if' linksToPredecessors+=DependanceStart+)? ('finishes' 'if'
// linksToPredecessors+=DependanceFinish+)?
// '}';
@Override public ParserRule getRule() { return rule; }
//'wd' name=ID '{' ('starts' 'if' linksToPredecessors+=DependanceStart+)? ('finishes' 'if'
//linksToPredecessors+=DependanceFinish+)? '}'
public Group getGroup() { return cGroup; }
//'wd'
public Keyword getWdKeyword_0() { return cWdKeyword_0; }
//name=ID
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
//ID
public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
//'{'
public Keyword getLeftCurlyBracketKeyword_2() { return cLeftCurlyBracketKeyword_2; }
//('starts' 'if' linksToPredecessors+=DependanceStart+)?
public Group getGroup_3() { return cGroup_3; }
//'starts'
public Keyword getStartsKeyword_3_0() { return cStartsKeyword_3_0; }
//'if'
public Keyword getIfKeyword_3_1() { return cIfKeyword_3_1; }
//linksToPredecessors+=DependanceStart+
public Assignment getLinksToPredecessorsAssignment_3_2() { return cLinksToPredecessorsAssignment_3_2; }
//DependanceStart
public RuleCall getLinksToPredecessorsDependanceStartParserRuleCall_3_2_0() { return cLinksToPredecessorsDependanceStartParserRuleCall_3_2_0; }
//('finishes' 'if' linksToPredecessors+=DependanceFinish+)?
public Group getGroup_4() { return cGroup_4; }
//'finishes'
public Keyword getFinishesKeyword_4_0() { return cFinishesKeyword_4_0; }
//'if'
public Keyword getIfKeyword_4_1() { return cIfKeyword_4_1; }
//linksToPredecessors+=DependanceFinish+
public Assignment getLinksToPredecessorsAssignment_4_2() { return cLinksToPredecessorsAssignment_4_2; }
//DependanceFinish
public RuleCall getLinksToPredecessorsDependanceFinishParserRuleCall_4_2_0() { return cLinksToPredecessorsDependanceFinishParserRuleCall_4_2_0; }
//'}'
public Keyword getRightCurlyBracketKeyword_5() { return cRightCurlyBracketKeyword_5; }
}
public class DependanceStartElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.DependanceStart");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Assignment cPredecessorAssignment_0 = (Assignment)cGroup.eContents().get(0);
private final CrossReference cPredecessorWorkDefinitionCrossReference_0_0 = (CrossReference)cPredecessorAssignment_0.eContents().get(0);
private final RuleCall cPredecessorWorkDefinitionIDTerminalRuleCall_0_0_1 = (RuleCall)cPredecessorWorkDefinitionCrossReference_0_0.eContents().get(1);
private final Assignment cLinkAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cLinkWorkSequenceKindStartParserRuleCall_1_0 = (RuleCall)cLinkAssignment_1.eContents().get(0);
//DependanceStart:
// predecessor=[WorkDefinition] link=WorkSequenceKindStart;
@Override public ParserRule getRule() { return rule; }
//predecessor=[WorkDefinition] link=WorkSequenceKindStart
public Group getGroup() { return cGroup; }
//predecessor=[WorkDefinition]
public Assignment getPredecessorAssignment_0() { return cPredecessorAssignment_0; }
//[WorkDefinition]
public CrossReference getPredecessorWorkDefinitionCrossReference_0_0() { return cPredecessorWorkDefinitionCrossReference_0_0; }
//ID
public RuleCall getPredecessorWorkDefinitionIDTerminalRuleCall_0_0_1() { return cPredecessorWorkDefinitionIDTerminalRuleCall_0_0_1; }
//link=WorkSequenceKindStart
public Assignment getLinkAssignment_1() { return cLinkAssignment_1; }
//WorkSequenceKindStart
public RuleCall getLinkWorkSequenceKindStartParserRuleCall_1_0() { return cLinkWorkSequenceKindStartParserRuleCall_1_0; }
}
public class WorkSequenceKindStartElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.WorkSequenceKindStart");
private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
private final Assignment cStarted2StartAssignment_0 = (Assignment)cAlternatives.eContents().get(0);
private final Keyword cStarted2StartStartedKeyword_0_0 = (Keyword)cStarted2StartAssignment_0.eContents().get(0);
private final Assignment cStarted2FinishAssignment_1 = (Assignment)cAlternatives.eContents().get(1);
private final Keyword cStarted2FinishFinishedKeyword_1_0 = (Keyword)cStarted2FinishAssignment_1.eContents().get(0);
//WorkSequenceKindStart:
// Started2Start='started'
// | Started2Finish='finished';
@Override public ParserRule getRule() { return rule; }
//Started2Start='started' | Started2Finish='finished'
public Alternatives getAlternatives() { return cAlternatives; }
//Started2Start='started'
public Assignment getStarted2StartAssignment_0() { return cStarted2StartAssignment_0; }
//'started'
public Keyword getStarted2StartStartedKeyword_0_0() { return cStarted2StartStartedKeyword_0_0; }
//Started2Finish='finished'
public Assignment getStarted2FinishAssignment_1() { return cStarted2FinishAssignment_1; }
//'finished'
public Keyword getStarted2FinishFinishedKeyword_1_0() { return cStarted2FinishFinishedKeyword_1_0; }
}
public class DependanceFinishElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.DependanceFinish");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Assignment cPredecessorAssignment_0 = (Assignment)cGroup.eContents().get(0);
private final CrossReference cPredecessorWorkDefinitionCrossReference_0_0 = (CrossReference)cPredecessorAssignment_0.eContents().get(0);
private final RuleCall cPredecessorWorkDefinitionIDTerminalRuleCall_0_0_1 = (RuleCall)cPredecessorWorkDefinitionCrossReference_0_0.eContents().get(1);
private final Assignment cLinkAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cLinkWorkSequenceKindFinishParserRuleCall_1_0 = (RuleCall)cLinkAssignment_1.eContents().get(0);
//DependanceFinish:
// predecessor=[WorkDefinition] link=WorkSequenceKindFinish;
@Override public ParserRule getRule() { return rule; }
//predecessor=[WorkDefinition] link=WorkSequenceKindFinish
public Group getGroup() { return cGroup; }
//predecessor=[WorkDefinition]
public Assignment getPredecessorAssignment_0() { return cPredecessorAssignment_0; }
//[WorkDefinition]
public CrossReference getPredecessorWorkDefinitionCrossReference_0_0() { return cPredecessorWorkDefinitionCrossReference_0_0; }
//ID
public RuleCall getPredecessorWorkDefinitionIDTerminalRuleCall_0_0_1() { return cPredecessorWorkDefinitionIDTerminalRuleCall_0_0_1; }
//link=WorkSequenceKindFinish
public Assignment getLinkAssignment_1() { return cLinkAssignment_1; }
//WorkSequenceKindFinish
public RuleCall getLinkWorkSequenceKindFinishParserRuleCall_1_0() { return cLinkWorkSequenceKindFinishParserRuleCall_1_0; }
}
public class WorkSequenceKindFinishElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.WorkSequenceKindFinish");
private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1);
private final Assignment cFinished2StartAssignment_0 = (Assignment)cAlternatives.eContents().get(0);
private final Keyword cFinished2StartStartedKeyword_0_0 = (Keyword)cFinished2StartAssignment_0.eContents().get(0);
private final Assignment cFinished2FinishAssignment_1 = (Assignment)cAlternatives.eContents().get(1);
private final Keyword cFinished2FinishFinishedKeyword_1_0 = (Keyword)cFinished2FinishAssignment_1.eContents().get(0);
//WorkSequenceKindFinish:
// Finished2Start='started'
// | Finished2Finish='finished';
@Override public ParserRule getRule() { return rule; }
//Finished2Start='started' | Finished2Finish='finished'
public Alternatives getAlternatives() { return cAlternatives; }
//Finished2Start='started'
public Assignment getFinished2StartAssignment_0() { return cFinished2StartAssignment_0; }
//'started'
public Keyword getFinished2StartStartedKeyword_0_0() { return cFinished2StartStartedKeyword_0_0; }
//Finished2Finish='finished'
public Assignment getFinished2FinishAssignment_1() { return cFinished2FinishAssignment_1; }
//'finished'
public Keyword getFinished2FinishFinishedKeyword_1_0() { return cFinished2FinishFinishedKeyword_1_0; }
}
public class GuidanceElements extends AbstractParserRuleElementFinder {
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.PDL2.Guidance");
private final Group cGroup = (Group)rule.eContents().get(1);
private final Keyword cNoteKeyword_0 = (Keyword)cGroup.eContents().get(0);
private final Assignment cTexteAssignment_1 = (Assignment)cGroup.eContents().get(1);
private final RuleCall cTexteSTRINGTerminalRuleCall_1_0 = (RuleCall)cTexteAssignment_1.eContents().get(0);
//Guidance:
// 'note' texte=STRING;
@Override public ParserRule getRule() { return rule; }
//'note' texte=STRING
public Group getGroup() { return cGroup; }
//'note'
public Keyword getNoteKeyword_0() { return cNoteKeyword_0; }
//texte=STRING
public Assignment getTexteAssignment_1() { return cTexteAssignment_1; }
//STRING
public RuleCall getTexteSTRINGTerminalRuleCall_1_0() { return cTexteSTRINGTerminalRuleCall_1_0; }
}
private final ProcessElements pProcess;
private final ProcessElementElements pProcessElement;
private final WorkDefinitionElements pWorkDefinition;
private final DependanceStartElements pDependanceStart;
private final WorkSequenceKindStartElements pWorkSequenceKindStart;
private final DependanceFinishElements pDependanceFinish;
private final WorkSequenceKindFinishElements pWorkSequenceKindFinish;
private final GuidanceElements pGuidance;
private final Grammar grammar;
private final TerminalsGrammarAccess gaTerminals;
@Inject
public PDL2GrammarAccess(GrammarProvider grammarProvider,
TerminalsGrammarAccess gaTerminals) {
this.grammar = internalFindGrammar(grammarProvider);
this.gaTerminals = gaTerminals;
this.pProcess = new ProcessElements();
this.pProcessElement = new ProcessElementElements();
this.pWorkDefinition = new WorkDefinitionElements();
this.pDependanceStart = new DependanceStartElements();
this.pWorkSequenceKindStart = new WorkSequenceKindStartElements();
this.pDependanceFinish = new DependanceFinishElements();
this.pWorkSequenceKindFinish = new WorkSequenceKindFinishElements();
this.pGuidance = new GuidanceElements();
}
protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
Grammar grammar = grammarProvider.getGrammar(this);
while (grammar != null) {
if ("fr.n7.PDL2".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;
}
//Process:
// 'process' name=ID '{'
// processElements+=ProcessElement*
// '}';
public ProcessElements getProcessAccess() {
return pProcess;
}
public ParserRule getProcessRule() {
return getProcessAccess().getRule();
}
//ProcessElement:
// WorkDefinition | Guidance;
public ProcessElementElements getProcessElementAccess() {
return pProcessElement;
}
public ParserRule getProcessElementRule() {
return getProcessElementAccess().getRule();
}
//WorkDefinition:
// 'wd' name=ID '{' ('starts' 'if' linksToPredecessors+=DependanceStart+)? ('finishes' 'if'
// linksToPredecessors+=DependanceFinish+)?
// '}';
public WorkDefinitionElements getWorkDefinitionAccess() {
return pWorkDefinition;
}
public ParserRule getWorkDefinitionRule() {
return getWorkDefinitionAccess().getRule();
}
//DependanceStart:
// predecessor=[WorkDefinition] link=WorkSequenceKindStart;
public DependanceStartElements getDependanceStartAccess() {
return pDependanceStart;
}
public ParserRule getDependanceStartRule() {
return getDependanceStartAccess().getRule();
}
//WorkSequenceKindStart:
// Started2Start='started'
// | Started2Finish='finished';
public WorkSequenceKindStartElements getWorkSequenceKindStartAccess() {
return pWorkSequenceKindStart;
}
public ParserRule getWorkSequenceKindStartRule() {
return getWorkSequenceKindStartAccess().getRule();
}
//DependanceFinish:
// predecessor=[WorkDefinition] link=WorkSequenceKindFinish;
public DependanceFinishElements getDependanceFinishAccess() {
return pDependanceFinish;
}
public ParserRule getDependanceFinishRule() {
return getDependanceFinishAccess().getRule();
}
//WorkSequenceKindFinish:
// Finished2Start='started'
// | Finished2Finish='finished';
public WorkSequenceKindFinishElements getWorkSequenceKindFinishAccess() {
return pWorkSequenceKindFinish;
}
public ParserRule getWorkSequenceKindFinishRule() {
return getWorkSequenceKindFinishAccess().getRule();
}
//Guidance:
// 'note' texte=STRING;
public GuidanceElements getGuidanceAccess() {
return pGuidance;
}
public ParserRule getGuidanceRule() {
return getGuidanceAccess().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();
}
}