Skip to content

Commit b498399

Browse files
authored
Extended Pascal abstractor
1 parent 22bd1e6 commit b498399

File tree

8 files changed

+486
-52
lines changed

8 files changed

+486
-52
lines changed

cg/JS2UML.cstl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,8 @@ _1 |-->_1
933933
_* |-->_
934934

935935
numericLiteral::
936+
_1 |-->("_1"->toReal())<when> _1 matches .*E.*
937+
_1 |-->("_1"->toReal())<when> _1 matches .*e.*
936938
_1 |-->_1
937939

938940
bigintLiteral::

cg/cobol2UML.cstl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,20 +1592,21 @@ _1 _* TO _3 |--> _3 := (_3 + _1 + _*`sum)_3`roundFunction ;\n
15921592

15931593

15941594
addToGivingStatement::
1595-
_1 TO _2 GIVING _3 |--> _2 := _2 + _1 ;\n _3 := _2_3`roundFunction;\n
1596-
_1 _* TO _3 GIVING _4 |--> _3 := _3 + (_1 + _*`sum);\n _4 := _3_4`roundFunction;\n
1595+
_1 TO _2 GIVING _3 |--> _3 := (_1 + _2)_3`roundFunction;\n
1596+
_1 _* TO _3 GIVING _4 |--> _4 := _3 + (_1 + _*`sum)_4`roundFunction;\n
15971597
_1 _* TO _3 GIVING _4 _+ |--> (var _addGivingTmp : double ; _addGivingTmp := _3 + (_1 + _*`sum) ;\n _4 := _addGivingTmp_4`roundFunction;\n_+`addGivingAssigns skip) ;\n
15981598
_1 _* GIVING _3 _+ |--> (var _addGivingTmp : double ; _addGivingTmp := _1 + _*`sum ;\n _3 := _addGivingTmp_3`roundFunction ; \n_+`addGivingAssigns skip) ;\n
15991599
_1 _* GIVING _3 |--> _3 := (_1 + _*`sum)_3`roundFunction ;\n
16001600

16011601

16021602
overflowTest::
1603-
_1 TO _2 GIVING _3 |-->MathLib.isIntegerOverflow(_2, _2`integerWidth) or MathLib.isIntegerOverflow(_3, _3`integerWidth)
1604-
_1 _* TO _3 GIVING _4 |-->MathLib.isIntegerOverflow(_3, _3`integerWidth) or MathLib.isIntegerOverflow(_4, _4`integerWidth)
1605-
_1 _* TO _3 GIVING _4 _+ |-->MathLib.isIntegerOverflow(_3, _3`integerWidth) or MathLib.isIntegerOverflow(_4, _4`integerWidth)_+`overflowItemTest
1603+
_1 TO _2 GIVING _3 |-->MathLib.isIntegerOverflow(_3, _3`integerWidth)
1604+
_1 _* TO _3 GIVING _4 |-->MathLib.isIntegerOverflow(_4, _4`integerWidth)
1605+
_1 _* TO _3 GIVING _4 _+ |-->MathLib.isIntegerOverflow(_4, _4`integerWidth)_+`overflowItemTest
16061606
_1 _* GIVING _3 _+ |-->MathLib.isIntegerOverflow(_3, _3`integerWidth)_+`overflowItemTest
16071607
_1 _* GIVING _3 |-->MathLib.isIntegerOverflow(_3, _3`integerWidth)
16081608

1609+
16091610
overflowItemTest::
16101611
_1 |--> or MathLib.isIntegerOverflow(_1, _1`integerWidth)
16111612

cg/mathocl2ocl.cstl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ max ( _1 ) |-->(_1)->max()
373373

374374
var ( _1 ) |-->_1.variance()
375375

376+
len ( _1 ) |-->(_1)->size()
377+
376378
Date ( _1 ) |-->OclDate.newOclDate_String(_1)
377379
Time ( _1 ) |-->OclDate.newOclDate_Time(_1)
378380

@@ -381,6 +383,8 @@ Binomial ( _1 ) |-->Excel.Binom_Dist_Range(_1`third,_1`last,_1`first,_1`third)
381383
bondPrice ( _1 ) |-->FinanceLib.bondPrice(_1)
382384
bondPriceClean ( _1 ) |-->FinanceLib.bondPriceClean(_1)
383385

386+
determinant ( _1 ) |-->MatrixLib.determinant(_1)
387+
384388
_1 ( _2 ) |-->_1(_2)
385389
_1 ( ) |-->_1()
386390

0 commit comments

Comments
 (0)