Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider 67fe653c rédigé par Erwan Bousse's avatar Erwan Bousse
Parcourir les fichiers

Tp codegen: add generated code

parent 25dd08bc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 12074 ajouts et 0 suppression
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fr.univnantes.idm.robotdsl.xtext.ide</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Automatic-Module-Name: fr.univnantes.idm.robotdsl.xtext.ide
Bundle-ManifestVersion: 2
Bundle-Name: fr.univnantes.idm.robotdsl.xtext.ide
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: fr.univnantes.idm.robotdsl.xtext.ide; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: fr.univnantes.idm.robotdsl.xtext,
fr.univnantes.idm.robotdsl.abstractsyntax,
org.eclipse.xtext.ide,
org.eclipse.xtext.xbase.ide,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: fr.univnantes.idm.ide.contentassist.antlr.internal,
fr.univnantes.idm.ide.contentassist.antlr
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
fr.univnantes.idm.ide.RobotDSLIdeSetup
/*
* generated by Xtext 2.16.0
*/
package fr.univnantes.idm.ide;
import com.google.inject.Binder;
import com.google.inject.name.Names;
import fr.univnantes.idm.ide.contentassist.antlr.RobotDSLParser;
import fr.univnantes.idm.ide.contentassist.antlr.internal.InternalRobotDSLLexer;
import org.eclipse.xtext.ide.DefaultIdeModule;
import org.eclipse.xtext.ide.LexerIdeBindings;
import org.eclipse.xtext.ide.editor.contentassist.FQNPrefixMatcher;
import org.eclipse.xtext.ide.editor.contentassist.IPrefixMatcher;
import org.eclipse.xtext.ide.editor.contentassist.IProposalConflictHelper;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AntlrProposalConflictHelper;
import org.eclipse.xtext.ide.editor.contentassist.antlr.IContentAssistParser;
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer;
import org.eclipse.xtext.ide.refactoring.IRenameStrategy2;
import org.eclipse.xtext.ide.server.rename.IRenameService;
import org.eclipse.xtext.ide.server.rename.RenameService;
/**
* Manual modifications go to {@link RobotDSLIdeModule}.
*/
@SuppressWarnings("all")
public abstract class AbstractRobotDSLIdeModule extends DefaultIdeModule {
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public void configureContentAssistLexer(Binder binder) {
binder.bind(Lexer.class)
.annotatedWith(Names.named(LexerIdeBindings.CONTENT_ASSIST))
.to(InternalRobotDSLLexer.class);
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IContentAssistParser> bindIContentAssistParser() {
return RobotDSLParser.class;
}
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
public Class<? extends IProposalConflictHelper> bindIProposalConflictHelper() {
return AntlrProposalConflictHelper.class;
}
// contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2
public Class<? extends IPrefixMatcher> bindIPrefixMatcher() {
return FQNPrefixMatcher.class;
}
// contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2
public Class<? extends IRenameService> bindIRenameService() {
return RenameService.class;
}
// contributed by org.eclipse.xtext.xtext.generator.ui.refactoring.RefactorElementNameFragment2
public Class<? extends IRenameStrategy2> bindIRenameStrategy2() {
return IRenameStrategy2.DefaultImpl.class;
}
}
/*
* generated by Xtext 2.16.0
*/
package fr.univnantes.idm.ide.contentassist.antlr;
import java.util.Collection;
import java.util.Collections;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.ide.editor.contentassist.antlr.FollowElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
import org.eclipse.xtext.ide.editor.partialEditing.IPartialEditingContentAssistParser;
import org.eclipse.xtext.util.PolymorphicDispatcher;
public class PartialRobotDSLContentAssistParser extends RobotDSLParser implements IPartialEditingContentAssistParser {
private AbstractRule rule;
@Override
public void initializeFor(AbstractRule rule) {
this.rule = rule;
}
@Override
protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
if (rule == null || rule.eIsProxy())
return Collections.emptyList();
String methodName = "entryRule" + rule.getName();
PolymorphicDispatcher<Collection<FollowElement>> dispatcher =
new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser));
dispatcher.invoke();
return parser.getFollowElements();
}
}
/*
* generated by Xtext 2.16.0
*/
package fr.univnantes.idm.ide.contentassist.antlr;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import fr.univnantes.idm.ide.contentassist.antlr.internal.InternalRobotDSLParser;
import fr.univnantes.idm.services.RobotDSLGrammarAccess;
import java.util.Map;
import org.eclipse.xtext.AbstractElement;
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;
public class RobotDSLParser extends AbstractContentAssistParser {
@Singleton
public static final class NameMappings {
private final Map<AbstractElement, String> mappings;
@Inject
public NameMappings(RobotDSLGrammarAccess 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, RobotDSLGrammarAccess grammarAccess) {
builder.put(grammarAccess.getComponentAccess().getAlternatives(), "rule__Component__Alternatives");
builder.put(grammarAccess.getCommandAccess().getAlternatives_0(), "rule__Command__Alternatives_0");
builder.put(grammarAccess.getEStringAccess().getAlternatives(), "rule__EString__Alternatives");
builder.put(grammarAccess.getLightColorAccess().getAlternatives(), "rule__LightColor__Alternatives");
builder.put(grammarAccess.getRobotSimulationAccess().getGroup(), "rule__RobotSimulation__Group__0");
builder.put(grammarAccess.getRobotSimulationAccess().getGroup_4(), "rule__RobotSimulation__Group_4__0");
builder.put(grammarAccess.getRobotSimulationAccess().getGroup_4_1(), "rule__RobotSimulation__Group_4_1__0");
builder.put(grammarAccess.getRobotSimulationAccess().getGroup_5(), "rule__RobotSimulation__Group_5__0");
builder.put(grammarAccess.getRobotSimulationAccess().getGroup_5_1(), "rule__RobotSimulation__Group_5_1__0");
builder.put(grammarAccess.getFQNAccess().getGroup(), "rule__FQN__Group__0");
builder.put(grammarAccess.getFQNAccess().getGroup_1(), "rule__FQN__Group_1__0");
builder.put(grammarAccess.getCommandAccess().getGroup(), "rule__Command__Group__0");
builder.put(grammarAccess.getRobotAccess().getGroup(), "rule__Robot__Group__0");
builder.put(grammarAccess.getRobotAccess().getGroup_4(), "rule__Robot__Group_4__0");
builder.put(grammarAccess.getRobotAccess().getGroup_4_1(), "rule__Robot__Group_4_1__0");
builder.put(grammarAccess.getRobotProgramAccess().getGroup(), "rule__RobotProgram__Group__0");
builder.put(grammarAccess.getRobotProgramAccess().getGroup_6(), "rule__RobotProgram__Group_6__0");
builder.put(grammarAccess.getLightAccess().getGroup(), "rule__Light__Group__0");
builder.put(grammarAccess.getMotorAccess().getGroup(), "rule__Motor__Group__0");
builder.put(grammarAccess.getEIntAccess().getGroup(), "rule__EInt__Group__0");
builder.put(grammarAccess.getSetLightColorAccess().getGroup(), "rule__SetLightColor__Group__0");
builder.put(grammarAccess.getMoveForwardAccess().getGroup(), "rule__MoveForward__Group__0");
builder.put(grammarAccess.getRotateAccess().getGroup(), "rule__Rotate__Group__0");
builder.put(grammarAccess.getRobotSimulationAccess().getNameAssignment_2(), "rule__RobotSimulation__NameAssignment_2");
builder.put(grammarAccess.getRobotSimulationAccess().getRobotsAssignment_4_0(), "rule__RobotSimulation__RobotsAssignment_4_0");
builder.put(grammarAccess.getRobotSimulationAccess().getRobotsAssignment_4_1_1(), "rule__RobotSimulation__RobotsAssignment_4_1_1");
builder.put(grammarAccess.getRobotSimulationAccess().getProgramsAssignment_5_0(), "rule__RobotSimulation__ProgramsAssignment_5_0");
builder.put(grammarAccess.getRobotSimulationAccess().getProgramsAssignment_5_1_1(), "rule__RobotSimulation__ProgramsAssignment_5_1_1");
builder.put(grammarAccess.getRobotAccess().getNameAssignment_2(), "rule__Robot__NameAssignment_2");
builder.put(grammarAccess.getRobotAccess().getComponentsAssignment_4_0(), "rule__Robot__ComponentsAssignment_4_0");
builder.put(grammarAccess.getRobotAccess().getComponentsAssignment_4_1_1(), "rule__Robot__ComponentsAssignment_4_1_1");
builder.put(grammarAccess.getRobotProgramAccess().getNameAssignment_2(), "rule__RobotProgram__NameAssignment_2");
builder.put(grammarAccess.getRobotProgramAccess().getRobotAssignment_4(), "rule__RobotProgram__RobotAssignment_4");
builder.put(grammarAccess.getRobotProgramAccess().getCommandsAssignment_6_0(), "rule__RobotProgram__CommandsAssignment_6_0");
builder.put(grammarAccess.getRobotProgramAccess().getCommandsAssignment_6_1(), "rule__RobotProgram__CommandsAssignment_6_1");
builder.put(grammarAccess.getLightAccess().getNameAssignment_2(), "rule__Light__NameAssignment_2");
builder.put(grammarAccess.getMotorAccess().getNameAssignment_2(), "rule__Motor__NameAssignment_2");
builder.put(grammarAccess.getMotorAccess().getPowerAssignment_4(), "rule__Motor__PowerAssignment_4");
builder.put(grammarAccess.getSetLightColorAccess().getLightAssignment_3(), "rule__SetLightColor__LightAssignment_3");
builder.put(grammarAccess.getSetLightColorAccess().getColorAssignment_5(), "rule__SetLightColor__ColorAssignment_5");
builder.put(grammarAccess.getMoveForwardAccess().getDistanceAssignment_2(), "rule__MoveForward__DistanceAssignment_2");
builder.put(grammarAccess.getRotateAccess().getAngleAssignment_2(), "rule__Rotate__AngleAssignment_2");
}
}
@Inject
private NameMappings nameMappings;
@Inject
private RobotDSLGrammarAccess grammarAccess;
@Override
protected InternalRobotDSLParser createParser() {
InternalRobotDSLParser result = new InternalRobotDSLParser(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 RobotDSLGrammarAccess getGrammarAccess() {
return this.grammarAccess;
}
public void setGrammarAccess(RobotDSLGrammarAccess grammarAccess) {
this.grammarAccess = grammarAccess;
}
public NameMappings getNameMappings() {
return nameMappings;
}
public void setNameMappings(NameMappings nameMappings) {
this.nameMappings = nameMappings;
}
}
'('=27
')'=28
','=19
'-'=29
'.'=20
';'=21
'BLUE'=13
'GREEN'=11
'NONE'=15
'RED'=12
'YELLOW'=14
'for'=24
'light'=25
'motor'=26
'moveForward'=33
'of'=31
'program'=23
'robot'=22
'rotate'=34
'setLightColor'=30
'simulation'=16
'to'=32
'{'=17
'}'=18
RULE_ANY_OTHER=10
RULE_ID=5
RULE_INT=6
RULE_ML_COMMENT=7
RULE_SL_COMMENT=8
RULE_STRING=4
RULE_WS=9
T__11=11
T__12=12
T__13=13
T__14=14
T__15=15
T__16=16
T__17=17
T__18=18
T__19=19
T__20=20
T__21=21
T__22=22
T__23=23
T__24=24
T__25=25
T__26=26
T__27=27
T__28=28
T__29=29
T__30=30
T__31=31
T__32=32
T__33=33
T__34=34
/*
* generated by Xtext 2.15.0
*/
package fr.univnantes.idm.ide
/**
* Use this class to register ide components.
*/
class RobotDSLIdeModule extends AbstractRobotDSLIdeModule {
}
/*
* generated by Xtext 2.15.0
*/
package fr.univnantes.idm.ide
import com.google.inject.Guice
import fr.univnantes.idm.RobotDSLRuntimeModule
import fr.univnantes.idm.RobotDSLStandaloneSetup
import org.eclipse.xtext.util.Modules2
/**
* Initialization support for running Xtext languages as language servers.
*/
class RobotDSLIdeSetup extends RobotDSLStandaloneSetup {
override createInjector() {
Guice.createInjector(Modules2.mixin(new RobotDSLRuntimeModule, new RobotDSLIdeModule))
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="test-bin" path="src">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="test-bin" path="src-gen">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="test-bin" path="xtend-gen">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fr.univnantes.idm.robotdsl.xtext.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter