Skip to content

Commit

Permalink
eclipse-archived#190 In progress TqCL-syntax and library services
Browse files Browse the repository at this point in the history
  • Loading branch information
rtotaro committed Jan 4, 2017
1 parent 44277cc commit 01305c1
Show file tree
Hide file tree
Showing 22 changed files with 901 additions and 779 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.eclipse.triquetrum.commands.api.services;

public class ActorDescriptor extends EntityDescriptor {

public ActorDescriptor(String displayName, String clazz, String icon) {
super(displayName, clazz, icon);
}

@Override
public String getCategory() {
return "Actor";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.eclipse.triquetrum.commands.api.services;

public class DirectorDescriptor extends EntityDescriptor {

public DirectorDescriptor(String displayName, String clazz, String icon) {
super(displayName, clazz, icon);
// TODO Auto-generated constructor stub
}

@Override
public String getCategory() {
return "Director";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.eclipse.triquetrum.commands.api.services;

public abstract class EntityDescriptor {

private String clazz;

private String displayName;

private String icon;

public EntityDescriptor(String displayName, String clazz, String icon) {
super();
this.displayName = displayName;
this.clazz = clazz;
this.icon = icon;
}

public String getClazz() {
return clazz;
}

public String getDisplayName() {
return displayName;
}

public String getIcon() {
return icon;
}

public abstract String getCategory();



}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

public interface TqCLLibraryProvider {

public List<String> getActors(String library) throws TqCLLibraryException;
public List<ActorDescriptor> getActors(String library) throws TqCLLibraryException;

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.util.Map;
import java.util.Set;

import org.eclipse.triquetrum.commands.api.services.ActorDescriptor;
import org.eclipse.triquetrum.commands.api.services.DirectorDescriptor;
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryException;
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryProvider;

Expand All @@ -26,7 +28,7 @@ public class TcQLLibraryProviderProxy implements TqCLLibraryProvider {


@Override
public List<String> getActors(String library) throws TqCLLibraryException {
public List<ActorDescriptor> getActors(String library) throws TqCLLibraryException {
checkLibrary(library);
return libraryProviders.get(library).getActors(library);
}
Expand All @@ -39,7 +41,7 @@ private void checkLibrary(String library) throws TqCLLibraryException {
}

@Override
public List<String> getDirectors(String library) throws TqCLLibraryException {
public List<DirectorDescriptor> getDirectors(String library) throws TqCLLibraryException {
checkLibrary(library);
return libraryProviders.get(library).getDirectors(library);
}
Expand Down Expand Up @@ -95,11 +97,6 @@ public boolean hasElement(String element) {
return false;
}

public void setLibraryProviders(Collection<TqCLLibraryProvider> libraryProviders) {
for (TqCLLibraryProvider tqCLLibraryProvider : libraryProviders) {
addLibraryProvider(tqCLLibraryProvider);
}
}

public void addLibraryProvider(TqCLLibraryProvider tqCLLibraryProvider) {
Set<String> libraryNames = tqCLLibraryProvider.getLibraryNames();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,25 +941,25 @@ rule__Category__Alternatives
:
(
{ before(grammarAccess.getCategoryAccess().getActorEnumLiteralDeclaration_0()); }
('actor')
('Actor')
{ after(grammarAccess.getCategoryAccess().getActorEnumLiteralDeclaration_0()); }
)
|
(
{ before(grammarAccess.getCategoryAccess().getParameterEnumLiteralDeclaration_1()); }
('parameter')
('Parameter')
{ after(grammarAccess.getCategoryAccess().getParameterEnumLiteralDeclaration_1()); }
)
|
(
{ before(grammarAccess.getCategoryAccess().getPortEnumLiteralDeclaration_2()); }
('port')
('Port')
{ after(grammarAccess.getCategoryAccess().getPortEnumLiteralDeclaration_2()); }
)
|
(
{ before(grammarAccess.getCategoryAccess().getDirectorEnumLiteralDeclaration_3()); }
('director')
('Director')
{ after(grammarAccess.getCategoryAccess().getDirectorEnumLiteralDeclaration_3()); }
)
;
Expand Down Expand Up @@ -4114,9 +4114,9 @@ rule__Insert__NameAssignment_4
}
:
(
{ before(grammarAccess.getInsertAccess().getNameNamedObjParserRuleCall_4_0()); }
ruleNamedObj
{ after(grammarAccess.getInsertAccess().getNameNamedObjParserRuleCall_4_0()); }
{ before(grammarAccess.getInsertAccess().getNameSTRINGTerminalRuleCall_4_0()); }
RULE_STRING
{ after(grammarAccess.getInsertAccess().getNameSTRINGTerminalRuleCall_4_0()); }
)
;
finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
'=>'=29
'>'=33
'?'=34
'Actor'=10
'Director'=13
'Parameter'=11
'Port'=12
'['=27
']'=28
'actor'=10
'as'=18
'connect'=22
'director'=13
'extends'=35
'extension'=43
'go'=24
Expand All @@ -25,8 +27,6 @@
'into'=40
'library'=16
'out'=41
'parameter'=11
'port'=12
'set'=21
'static'=42
'super'=37
Expand Down
Loading

0 comments on commit 01305c1

Please sign in to comment.