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 calculators for simple first order operations
- Loading branch information
1 parent
efb2f11
commit 16d6a02
Showing
7 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.eclipse.epsilon.eol.execute.operations.declarative; | ||
|
||
import org.eclipse.epsilon.eol.execute.operations.ITypeCalculator; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolPrimitiveType; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolType; | ||
|
||
public class BooleanTypeCalculator implements ITypeCalculator { | ||
|
||
@Override | ||
public EolType calculateType(EolType contextType, EolType iteratorType, EolType expressionType) { | ||
return EolPrimitiveType.Boolean; | ||
} | ||
|
||
} |
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
14 changes: 14 additions & 0 deletions
14
...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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.eclipse.epsilon.eol.execute.operations.declarative; | ||
|
||
import org.eclipse.epsilon.eol.execute.operations.ITypeCalculator; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolPrimitiveType; | ||
import org.eclipse.epsilon.eol.staticanalyser.types.EolType; | ||
|
||
public class IntegerTypeCalculator implements ITypeCalculator { | ||
|
||
@Override | ||
public EolType calculateType(EolType contextType, EolType iteratorType, EolType expressionType) { | ||
return EolPrimitiveType.Integer; | ||
} | ||
|
||
} |
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
9 changes: 9 additions & 0 deletions
9
...s/src/org/eclipse/epsilon/eol/staticanalyser/tests/scripts/simpleFirstOrderOperations.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,9 @@ | ||
/*Boolean*/Sequence{0..9}.atLeastNMatch(i:Integer | i < 5, 1); | ||
/*Boolean*/Sequence{0..9}.atMostNMatch(i:Integer | i < 5, 1); | ||
/*Boolean*/Sequence{0..9}.nMatch(i:Integer | i < 5, 1); | ||
/*Boolean*/Sequence{0..9}.exists(i:Integer | i < 5); | ||
/*Boolean*/Sequence{0..9}.forAll(i:Integer | i < 5); | ||
/*Boolean*/Sequence{0..9}.none(i:Integer | i < 5); | ||
/*Boolean*/Sequence{0..9}.one(i:Integer | i < 5); | ||
/*Integer*/Sequence{0..9}.count(i:Integer | i < 5); | ||
|