forked from eclipse-epsilon/epsilon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify user-defined operations and simple contributed operations
- Loading branch information
1 parent
6404fc7
commit b85e0b6
Showing
5 changed files
with
106 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...psilon.eol.staticanalyser/src/org/eclipse/epsilon/eol/staticanalyser/SimpleOperation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.eclipse.epsilon.eol.staticanalyser; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.eclipse.epsilon.eol.dom.Operation; | ||
import org.eclipse.epsilon.eol.dom.Parameter; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolType; | ||
|
||
public class SimpleOperation implements IStaticOperation { | ||
private String name; | ||
private EolType contextType; | ||
private EolType returnType; | ||
private List<EolType> parameterTypes; | ||
|
||
public SimpleOperation(Operation op) { | ||
name = op.getName(); | ||
contextType = (EolType) op.getData().get("contextType"); | ||
returnType = (EolType) op.getData().get("returnType"); | ||
this.parameterTypes = new ArrayList<EolType>(); | ||
for (Parameter p: op.getFormalParameters()) { | ||
EolType parameterType = (EolType) p.getTypeExpression().getData().get("resolvedType"); | ||
parameterTypes.add(parameterType); | ||
} | ||
} | ||
|
||
public SimpleOperation(String name, EolType contextType, EolType returnType, List<EolType> parameterTypes) { | ||
this.name = name; | ||
this.contextType = contextType; | ||
this.returnType = returnType; | ||
this.parameterTypes = parameterTypes; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public EolType getContextType() { | ||
return contextType; | ||
} | ||
|
||
@Override | ||
public EolType getReturnType() { | ||
return returnType; | ||
} | ||
|
||
@Override | ||
public List<EolType> getParameterTypes() { | ||
return parameterTypes; | ||
} | ||
|
||
} |
42 changes: 0 additions & 42 deletions
42
...n.eol.staticanalyser/src/org/eclipse/epsilon/eol/staticanalyser/UserDefinedOperation.java
This file was deleted.
Oops, something went wrong.