Skip to content

Commit

Permalink
eclipse-archived#190 In progress TqCL - syntax (insert) and library s…
Browse files Browse the repository at this point in the history
…ervices
  • Loading branch information
rtotaro committed Jan 8, 2017
1 parent 75abcbe commit f35f258
Show file tree
Hide file tree
Showing 32 changed files with 4,822 additions and 2,744 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface TqCLLibraryProvider {

public List<DirectorDescriptor> getDirectors(String library) throws TqCLLibraryException;

public List<String> getParameterTypes(String library) throws TqCLLibraryException;
public List<ParameterDescriptor> getParameterTypes(String library) throws TqCLLibraryException;

public List<String> getPortTypes(String library) throws TqCLLibraryException;

Expand All @@ -38,5 +38,7 @@ public interface TqCLLibraryProvider {
public boolean hasElementInLibrary(String element, String library, String category);

public EntityDescriptor getDirector(String directorClass) throws TqCLLibraryException;

public EntityDescriptor getParameter(String parameterClass);

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.triquetrum.commands.api.services.ActorDescriptor;
import org.eclipse.triquetrum.commands.api.services.DirectorDescriptor;
import org.eclipse.triquetrum.commands.api.services.EntityDescriptor;
import org.eclipse.triquetrum.commands.api.services.ParameterDescriptor;
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryException;
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryProvider;

Expand Down Expand Up @@ -48,7 +49,7 @@ public List<DirectorDescriptor> getDirectors(String library) throws TqCLLibraryE
}

@Override
public List<String> getParameterTypes(String library) throws TqCLLibraryException {
public List<ParameterDescriptor> getParameterTypes(String library) throws TqCLLibraryException {
checkLibrary(library);
return libraryProviders.get(library).getParameterTypes(library);
}
Expand Down Expand Up @@ -126,10 +127,21 @@ public EntityDescriptor getActor(String actorClass) throws TqCLLibraryException
@Override
public EntityDescriptor getDirector(String directorClass) throws TqCLLibraryException {
for (TqCLLibraryProvider provider : libraryProviders.values()) {
EntityDescriptor actor = provider.getDirector(directorClass);
if(actor!=null)
EntityDescriptor director = provider.getDirector(directorClass);
if(director!=null)
{
return actor;
return director;
}
}
return null;
}
@Override
public EntityDescriptor getParameter(String parameterClass) {
for (TqCLLibraryProvider provider : libraryProviders.values()) {
EntityDescriptor parameter = provider.getParameter(parameterClass);
if(parameter!=null)
{
return parameter;
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ protected String getRuleName(AbstractElement element) {
nameMappings = new HashMap<AbstractElement, String>() {
private static final long serialVersionUID = 1L;
{
put(grammarAccess.getCommandAccess().getAlternatives_0(), "rule__Command__Alternatives_0");
put(grammarAccess.getCompositeCommandAccess().getEndAlternatives_2_0(), "rule__CompositeCommand__EndAlternatives_2_0");
put(grammarAccess.getSimpleCommandAccess().getAlternatives_0(), "rule__SimpleCommand__Alternatives_0");
put(grammarAccess.getCommandAccess().getAlternatives(), "rule__Command__Alternatives");
put(grammarAccess.getParameter_idAccess().getAlternatives(), "rule__Parameter_id__Alternatives");
put(grammarAccess.getNamedObjAccess().getAlternatives(), "rule__NamedObj__Alternatives");
put(grammarAccess.getCategoryAccess().getAlternatives(), "rule__Category__Alternatives");
put(grammarAccess.getTriquetrumScriptAccess().getGroup(), "rule__TriquetrumScript__Group__0");
put(grammarAccess.getCommandAccess().getGroup(), "rule__Command__Group__0");
put(grammarAccess.getCompositeCommandAccess().getGroup(), "rule__CompositeCommand__Group__0");
put(grammarAccess.getSimpleCommandAccess().getGroup(), "rule__SimpleCommand__Group__0");
put(grammarAccess.getIncludeAccess().getGroup(), "rule__Include__Group__0");
put(grammarAccess.getLibraryAccess().getGroup(), "rule__Library__Group__0");
put(grammarAccess.getInsertAccess().getGroup(), "rule__Insert__Group__0");
Expand All @@ -59,13 +62,16 @@ protected String getRuleName(AbstractElement element) {
put(grammarAccess.getConnectAccess().getGroup(), "rule__Connect__Group__0");
put(grammarAccess.getConnectAccess().getGroup_2(), "rule__Connect__Group_2__0");
put(grammarAccess.getConnectAccess().getGroup_5(), "rule__Connect__Group_5__0");
put(grammarAccess.getConnectionPortAccess().getGroup(), "rule__ConnectionPort__Group__0");
put(grammarAccess.getGoIntoAccess().getGroup(), "rule__GoInto__Group__0");
put(grammarAccess.getGoOutAccess().getGroup(), "rule__GoOut__Group__0");
put(grammarAccess.getGoTopAccess().getGroup(), "rule__GoTop__Group__0");
put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0");
put(grammarAccess.getConnectionPortAccess().getGroup(), "rule__ConnectionPort__Group__0");
put(grammarAccess.getTriquetrumScriptAccess().getLibrariesAssignment_0(), "rule__TriquetrumScript__LibrariesAssignment_0");
put(grammarAccess.getTriquetrumScriptAccess().getCommandsAssignment_1(), "rule__TriquetrumScript__CommandsAssignment_1");
put(grammarAccess.getCompositeCommandAccess().getStartAssignment_0(), "rule__CompositeCommand__StartAssignment_0");
put(grammarAccess.getCompositeCommandAccess().getCommandsAssignment_1(), "rule__CompositeCommand__CommandsAssignment_1");
put(grammarAccess.getCompositeCommandAccess().getEndAssignment_2(), "rule__CompositeCommand__EndAssignment_2");
put(grammarAccess.getIncludeAccess().getFilenameAssignment_1(), "rule__Include__FilenameAssignment_1");
put(grammarAccess.getLibraryAccess().getNameAssignment_1(), "rule__Library__NameAssignment_1");
put(grammarAccess.getInsertAccess().getCategoryAssignment_1(), "rule__Insert__CategoryAssignment_1");
Expand All @@ -78,14 +84,14 @@ protected String getRuleName(AbstractElement element) {
put(grammarAccess.getConnectAccess().getFromAssignment_2_1(), "rule__Connect__FromAssignment_2_1");
put(grammarAccess.getConnectAccess().getToAssignment_4(), "rule__Connect__ToAssignment_4");
put(grammarAccess.getConnectAccess().getToAssignment_5_1(), "rule__Connect__ToAssignment_5_1");
put(grammarAccess.getConnectionPortAccess().getActorAssignment_0(), "rule__ConnectionPort__ActorAssignment_0");
put(grammarAccess.getConnectionPortAccess().getPortAssignment_2(), "rule__ConnectionPort__PortAssignment_2");
put(grammarAccess.getGoIntoAccess().getDirectionAssignment_1(), "rule__GoInto__DirectionAssignment_1");
put(grammarAccess.getGoIntoAccess().getObjAssignment_2(), "rule__GoInto__ObjAssignment_2");
put(grammarAccess.getGoIntoAccess().getActorAssignment_2(), "rule__GoInto__ActorAssignment_2");
put(grammarAccess.getGoOutAccess().getDirectionAssignment_1(), "rule__GoOut__DirectionAssignment_1");
put(grammarAccess.getGoTopAccess().getDirectionAssignment_1(), "rule__GoTop__DirectionAssignment_1");
put(grammarAccess.getParameterAccess().getIdAssignment_0(), "rule__Parameter__IdAssignment_0");
put(grammarAccess.getParameterAccess().getValueAssignment_2(), "rule__Parameter__ValueAssignment_2");
put(grammarAccess.getConnectionPortAccess().getActorAssignment_0(), "rule__ConnectionPort__ActorAssignment_0");
put(grammarAccess.getConnectionPortAccess().getPortAssignment_2(), "rule__ConnectionPort__PortAssignment_2");
}
};
}
Expand Down
Loading

0 comments on commit f35f258

Please sign in to comment.