projet-genie-logiciel-systeme/workspace/game.ide/src-gen/xtext/ide/contentassist/antlr/GameParser.java

157 lines
11 KiB
Java
Raw Normal View History

2021-11-30 17:25:45 +00:00
/*
* generated by Xtext 2.23.0
*/
package xtext.ide.contentassist.antlr;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Map;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;
import xtext.ide.contentassist.antlr.internal.InternalGameParser;
import xtext.services.GameGrammarAccess;
public class GameParser extends AbstractContentAssistParser {
@Singleton
public static final class NameMappings {
private final Map<AbstractElement, String> mappings;
@Inject
public NameMappings(GameGrammarAccess grammarAccess) {
ImmutableMap.Builder<AbstractElement, String> builder = ImmutableMap.builder();
init(builder, grammarAccess);
this.mappings = builder.build();
}
public String getRuleName(AbstractElement element) {
return mappings.get(element);
}
private static void init(ImmutableMap.Builder<AbstractElement, String> builder, GameGrammarAccess grammarAccess) {
builder.put(grammarAccess.getConditionTestAccess().getAlternatives(), "rule__ConditionTest__Alternatives");
builder.put(grammarAccess.getComparateurAccess().getAlternatives(), "rule__Comparateur__Alternatives");
builder.put(grammarAccess.getJeuAccess().getGroup(), "rule__Jeu__Group__0");
builder.put(grammarAccess.getExplorateurAccess().getGroup(), "rule__Explorateur__Group__0");
builder.put(grammarAccess.getTerritoireAccess().getGroup(), "rule__Territoire__Group__0");
builder.put(grammarAccess.getLieuAccess().getGroup(), "rule__Lieu__Group__0");
builder.put(grammarAccess.getCheminAccess().getGroup(), "rule__Chemin__Group__0");
builder.put(grammarAccess.getObjetAccess().getGroup(), "rule__Objet__Group__0");
builder.put(grammarAccess.getTransformationAccess().getGroup(), "rule__Transformation__Group__0");
builder.put(grammarAccess.getConnaissanceAccess().getGroup(), "rule__Connaissance__Group__0");
builder.put(grammarAccess.getPersonneAccess().getGroup(), "rule__Personne__Group__0");
builder.put(grammarAccess.getInterractionAccess().getGroup(), "rule__Interraction__Group__0");
builder.put(grammarAccess.getActionAccess().getGroup(), "rule__Action__Group__0");
builder.put(grammarAccess.getDescriptionAccess().getGroup(), "rule__Description__Group__0");
builder.put(grammarAccess.getConditionAccess().getGroup(), "rule__Condition__Group__0");
builder.put(grammarAccess.getConditionAccess().getGroup_3(), "rule__Condition__Group_3__0");
builder.put(grammarAccess.getConditionEtAccess().getGroup(), "rule__ConditionEt__Group__0");
builder.put(grammarAccess.getConditionEtAccess().getGroup_2(), "rule__ConditionEt__Group_2__0");
builder.put(grammarAccess.getAntiConditionConnaissanceAccess().getGroup(), "rule__AntiConditionConnaissance__Group__0");
builder.put(grammarAccess.getConditionObjetAccess().getGroup(), "rule__ConditionObjet__Group__0");
builder.put(grammarAccess.getJeuAccess().getExplorateurAssignment_2(), "rule__Jeu__ExplorateurAssignment_2");
builder.put(grammarAccess.getJeuAccess().getTerritoireAssignment_3(), "rule__Jeu__TerritoireAssignment_3");
builder.put(grammarAccess.getJeuAccess().getObjetsAssignment_4(), "rule__Jeu__ObjetsAssignment_4");
builder.put(grammarAccess.getJeuAccess().getConnaissancesAssignment_5(), "rule__Jeu__ConnaissancesAssignment_5");
builder.put(grammarAccess.getJeuAccess().getPersonnesAssignment_6(), "rule__Jeu__PersonnesAssignment_6");
builder.put(grammarAccess.getJeuAccess().getTransformationsAssignment_7(), "rule__Jeu__TransformationsAssignment_7");
builder.put(grammarAccess.getExplorateurAccess().getTailleTotaleMaxAssignment_4(), "rule__Explorateur__TailleTotaleMaxAssignment_4");
builder.put(grammarAccess.getExplorateurAccess().getConnaissancesAssignment_5(), "rule__Explorateur__ConnaissancesAssignment_5");
builder.put(grammarAccess.getExplorateurAccess().getObjetsAssignment_6(), "rule__Explorateur__ObjetsAssignment_6");
builder.put(grammarAccess.getTerritoireAccess().getLieuxAssignment_4(), "rule__Territoire__LieuxAssignment_4");
builder.put(grammarAccess.getTerritoireAccess().getCheminsAssignment_7(), "rule__Territoire__CheminsAssignment_7");
builder.put(grammarAccess.getLieuAccess().getNomAssignment_1(), "rule__Lieu__NomAssignment_1");
builder.put(grammarAccess.getLieuAccess().getConnaissancesAssignment_3(), "rule__Lieu__ConnaissancesAssignment_3");
builder.put(grammarAccess.getLieuAccess().getPersonnesAssignment_4(), "rule__Lieu__PersonnesAssignment_4");
builder.put(grammarAccess.getLieuAccess().getObjetsAssignment_5(), "rule__Lieu__ObjetsAssignment_5");
builder.put(grammarAccess.getLieuAccess().getDeposableAssignment_6(), "rule__Lieu__DeposableAssignment_6");
builder.put(grammarAccess.getLieuAccess().getDescriptionsAssignment_7(), "rule__Lieu__DescriptionsAssignment_7");
builder.put(grammarAccess.getLieuAccess().getDepartAssignment_8(), "rule__Lieu__DepartAssignment_8");
builder.put(grammarAccess.getLieuAccess().getFinAssignment_9(), "rule__Lieu__FinAssignment_9");
builder.put(grammarAccess.getCheminAccess().getLieuInAssignment_2(), "rule__Chemin__LieuInAssignment_2");
builder.put(grammarAccess.getCheminAccess().getLieuOutAssignment_4(), "rule__Chemin__LieuOutAssignment_4");
builder.put(grammarAccess.getCheminAccess().getConnaissancesAssignment_5(), "rule__Chemin__ConnaissancesAssignment_5");
builder.put(grammarAccess.getCheminAccess().getObjetsAssignment_6(), "rule__Chemin__ObjetsAssignment_6");
builder.put(grammarAccess.getCheminAccess().getObjetsConsoAssignment_7(), "rule__Chemin__ObjetsConsoAssignment_7");
builder.put(grammarAccess.getCheminAccess().getOuvertAssignment_8(), "rule__Chemin__OuvertAssignment_8");
builder.put(grammarAccess.getCheminAccess().getFermeAssignment_9(), "rule__Chemin__FermeAssignment_9");
builder.put(grammarAccess.getCheminAccess().getObligatoireAssignment_10(), "rule__Chemin__ObligatoireAssignment_10");
builder.put(grammarAccess.getCheminAccess().getDescriptionsAssignment_11(), "rule__Chemin__DescriptionsAssignment_11");
builder.put(grammarAccess.getObjetAccess().getNomAssignment_1(), "rule__Objet__NomAssignment_1");
builder.put(grammarAccess.getObjetAccess().getTailleAssignment_3(), "rule__Objet__TailleAssignment_3");
builder.put(grammarAccess.getObjetAccess().getVisibleAssignment_4(), "rule__Objet__VisibleAssignment_4");
builder.put(grammarAccess.getObjetAccess().getDescriptionsAssignment_5(), "rule__Objet__DescriptionsAssignment_5");
builder.put(grammarAccess.getTransformationAccess().getConditionAssignment_2(), "rule__Transformation__ConditionAssignment_2");
builder.put(grammarAccess.getTransformationAccess().getObjetSourceAssignment_3(), "rule__Transformation__ObjetSourceAssignment_3");
builder.put(grammarAccess.getTransformationAccess().getObjetsResultatsAssignment_5(), "rule__Transformation__ObjetsResultatsAssignment_5");
builder.put(grammarAccess.getConnaissanceAccess().getNomAssignment_1(), "rule__Connaissance__NomAssignment_1");
builder.put(grammarAccess.getConnaissanceAccess().getVisibleAssignment_3(), "rule__Connaissance__VisibleAssignment_3");
builder.put(grammarAccess.getConnaissanceAccess().getDescriptionsAssignment_4(), "rule__Connaissance__DescriptionsAssignment_4");
builder.put(grammarAccess.getPersonneAccess().getVisibleAssignment_2(), "rule__Personne__VisibleAssignment_2");
builder.put(grammarAccess.getPersonneAccess().getObligatoireAssignment_3(), "rule__Personne__ObligatoireAssignment_3");
builder.put(grammarAccess.getPersonneAccess().getInterractionsAssignment_4(), "rule__Personne__InterractionsAssignment_4");
builder.put(grammarAccess.getInterractionAccess().getActionsAssignment_2(), "rule__Interraction__ActionsAssignment_2");
builder.put(grammarAccess.getInterractionAccess().getConnaissancesAssignment_3(), "rule__Interraction__ConnaissancesAssignment_3");
builder.put(grammarAccess.getInterractionAccess().getObjetsAssignment_4(), "rule__Interraction__ObjetsAssignment_4");
builder.put(grammarAccess.getInterractionAccess().getVisibleAssignment_5(), "rule__Interraction__VisibleAssignment_5");
builder.put(grammarAccess.getActionAccess().getConnaissancesAssignment_2(), "rule__Action__ConnaissancesAssignment_2");
builder.put(grammarAccess.getActionAccess().getObjetsAssignment_3(), "rule__Action__ObjetsAssignment_3");
builder.put(grammarAccess.getActionAccess().getObjetsConsoAssignment_4(), "rule__Action__ObjetsConsoAssignment_4");
builder.put(grammarAccess.getActionAccess().getVisibleAssignment_5(), "rule__Action__VisibleAssignment_5");
builder.put(grammarAccess.getActionAccess().getFinInterractionAssignment_6(), "rule__Action__FinInterractionAssignment_6");
builder.put(grammarAccess.getDescriptionAccess().getTexteAssignment_2(), "rule__Description__TexteAssignment_2");
builder.put(grammarAccess.getDescriptionAccess().getConditionAssignment_3(), "rule__Description__ConditionAssignment_3");
builder.put(grammarAccess.getConditionAccess().getConditionAssignment_2(), "rule__Condition__ConditionAssignment_2");
builder.put(grammarAccess.getConditionAccess().getConditionAssignment_3_1(), "rule__Condition__ConditionAssignment_3_1");
builder.put(grammarAccess.getConditionEtAccess().getConditionTestAssignment_1(), "rule__ConditionEt__ConditionTestAssignment_1");
builder.put(grammarAccess.getConditionEtAccess().getConditonTestAssignment_2_1(), "rule__ConditionEt__ConditonTestAssignment_2_1");
builder.put(grammarAccess.getConditionConnaissanceAccess().getConnaissanceAssignment(), "rule__ConditionConnaissance__ConnaissanceAssignment");
builder.put(grammarAccess.getAntiConditionConnaissanceAccess().getConnaissanceAssignment_1(), "rule__AntiConditionConnaissance__ConnaissanceAssignment_1");
builder.put(grammarAccess.getConditionObjetAccess().getObjetAssignment_0(), "rule__ConditionObjet__ObjetAssignment_0");
builder.put(grammarAccess.getConditionObjetAccess().getComparateurAssignment_1(), "rule__ConditionObjet__ComparateurAssignment_1");
builder.put(grammarAccess.getConditionObjetAccess().getNombreAssignment_2(), "rule__ConditionObjet__NombreAssignment_2");
}
}
@Inject
private NameMappings nameMappings;
@Inject
private GameGrammarAccess grammarAccess;
@Override
protected InternalGameParser createParser() {
InternalGameParser result = new InternalGameParser(null);
result.setGrammarAccess(grammarAccess);
return result;
}
@Override
protected String getRuleName(AbstractElement element) {
return nameMappings.getRuleName(element);
}
@Override
protected String[] getInitialHiddenTokens() {
return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
}
public GameGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}
public void setGrammarAccess(GameGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
public NameMappings getNameMappings() {
return nameMappings;
}
public void setNameMappings(NameMappings nameMappings) {
this.nameMappings = nameMappings;
}
}