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.
add type calculator for aggregate operation
- Loading branch information
1 parent
98a3f66
commit 512c8d6
Showing
12 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
...se.epsilon.eol.engine/src/org/eclipse/epsilon/eol/execute/operations/ITypeCalculator.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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
package org.eclipse.epsilon.eol.execute.operations; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.epsilon.eol.staticanalyser.types.EolType; | ||
|
||
public interface ITypeCalculator { | ||
public EolType calculateType(EolType contextType, EolType iteratorType, EolType expressionType); | ||
public EolType calculateType(EolType contextType, EolType iteratorType, List<EolType> expressionTypes); | ||
} |
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
16 changes: 16 additions & 0 deletions
16
...e/src/org/eclipse/epsilon/eol/execute/operations/declarative/AggregateTypeCalculator.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,16 @@ | ||
package org.eclipse.epsilon.eol.execute.operations.declarative; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.epsilon.eol.execute.operations.ITypeCalculator; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolMapType; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolType; | ||
|
||
public class AggregateTypeCalculator implements ITypeCalculator { | ||
|
||
@Override | ||
public EolType calculateType(EolType contextType, EolType iteratorType, List<EolType> expressionTypes) { | ||
return new EolMapType(expressionTypes.get(0), expressionTypes.get(1)); | ||
} | ||
|
||
} |
4 changes: 3 additions & 1 deletion
4
...ine/src/org/eclipse/epsilon/eol/execute/operations/declarative/BooleanTypeCalculator.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
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
4 changes: 3 additions & 1 deletion
4
...ine/src/org/eclipse/epsilon/eol/execute/operations/declarative/IntegerTypeCalculator.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
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
4 changes: 3 additions & 1 deletion
4
...e/src/org/eclipse/epsilon/eol/execute/operations/declarative/SelectOneTypeCalculator.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
4 changes: 3 additions & 1 deletion
4
...gine/src/org/eclipse/epsilon/eol/execute/operations/declarative/SelectTypeCalculator.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
5 changes: 3 additions & 2 deletions
5
...gine/src/org/eclipse/epsilon/eol/execute/operations/declarative/SortByTypeCalculator.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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package org.eclipse.epsilon.eol.execute.operations.declarative; | ||
|
||
import java.util.List; | ||
|
||
import org.eclipse.epsilon.eol.execute.operations.ITypeCalculator; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolCollectionType; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolType; | ||
|
||
public class SortByTypeCalculator implements ITypeCalculator { | ||
|
||
@Override | ||
public EolType calculateType(EolType contextType, EolType iteratorType, EolType expressionType) { | ||
public EolType calculateType(EolType contextType, EolType iteratorType, List<EolType> expressionTypes) { | ||
return new EolCollectionType("Sequence", iteratorType); | ||
} | ||
|
||
} |
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
4 changes: 4 additions & 0 deletions
4
...aticanalyser.tests/src/org/eclipse/epsilon/eol/staticanalyser/tests/scripts/aggregate.eol
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,4 @@ | ||
/*Map<Integer, Integer>*/Bag{0..9}.aggregate(i:Integer|i,i); | ||
/*Map<Integer, Integer>*/Sequence{0..9}.aggregate(i:Integer|i,i); | ||
/*Map<Integer, Integer>*/Set{0..9}.aggregate(i:Integer|i,i); | ||
/*Map<Integer, Integer>*/OrderedSet{0..9}.aggregate(i:Integer|i,i); |