Skip to content

Commit aba7380

Browse files
authored
Handling of type annotations
1 parent 9875744 commit aba7380

File tree

1 file changed

+62
-13
lines changed

1 file changed

+62
-13
lines changed

cg/python2UML.cstl

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,7 @@ _1 _2 |--> execute (_2`third /: _1)<when> _1 atom, _2`second discard
721721
_1 _2 |--> execute (_2`third <: _1)<when> _1 atom, _2`second update
722722
_1 _2 |--> execute (_2`third /<: _1)<when> _1 atom, _2`second difference_update
723723
_1 _2 |--> execute ((_1 - _2`third) /<: _1)<when> _1 atom, _2`second intersection_update
724-
_1 _2 |--> execute (_1 /<: _1)<when> _1 atom, _2`second clear
725-
724+
/* _1 _2 |--> execute (_1 /<: _1)<when> _1 atom, _2`second clear */
726725

727726
_1 _2 |--> _1`removeAtomBrackets := _1_2`trailerUpdateForm<when> _1 atom, _2 trailer, _2`isUpdating true
728727

@@ -921,6 +920,7 @@ _1 : float |--> attribute _1 : double;\n<action> _1 real
921920
_1 : dict |--> attribute _1 : Map(String,OclAny);\n<action> _1 Map
922921
_1 : str |--> attribute _1 : String;\n<action> _1 String
923922
_1 : list |--> attribute _1 : Sequence(OclAny);\n<action> _1 Sequence
923+
_1 : tuple |--> attribute _1 : Sequence(OclAny);\n<action> _1 Sequence
924924
_1 : set |--> attribute _1 : Set(OclAny);\n<action> _1 Set
925925

926926
_1 : SortedSet |--> attribute _1 : SortedSet(OclAny);\n<action> _1 Set
@@ -957,9 +957,58 @@ _1 : float |-->_1 : double<action> _1 real
957957
_1 : dict |-->_1 : Map(String,OclAny)<action> _1 Map
958958
_1 : str |-->_1 : String<action> _1 String
959959
_1 : list |-->_1 : Sequence(OclAny)<action> _1 Sequence
960+
_1 : tuple |-->_1 : Sequence(OclAny)<action> _1 Sequence
960961
_1 : set |-->_1 : Set(OclAny)<action> _1 Set
961962

962-
_1 : _2 |-->_1 : _2<action> _1 _2
963+
_1 : _2 |-->_1 : _2`indicator2OCL<action> _1 _2`indicatorType
964+
965+
966+
indicator2OCL::
967+
list _1 |-->Sequence(_1`indicator2OCL)
968+
dict _1 |-->Map(_1`indicator2OCL)
969+
set _1 |-->Set(_1`indicator2OCL)
970+
Optional _1 |-->_1`indicator2OCL
971+
str |-->String
972+
bool |-->boolean
973+
float |-->double
974+
int |-->int
975+
976+
_1 , _2 |-->_1`indicator2OCL, _2`indicator2OCL
977+
978+
[ _1 ] |-->_1`indicator2OCL
979+
980+
_1 |-->_1`indicator2OCL<when> _1 test
981+
_1 |-->_1`indicator2OCL<when> _1 logical_test
982+
_1 |-->_1`indicator2OCL<when> _1 comparison
983+
_1 |-->_1`indicator2OCL<when> _1 expr
984+
_1 |-->_1`indicator2OCL<when> _1 arguments
985+
_1 |-->_1`indicator2OCL<when> _1 subscriptlist
986+
_1 |-->_1`indicator2OCL<when> _1 subscript
987+
988+
_1 |-->_1
989+
990+
991+
indicatorType::
992+
list _1 |-->Sequence
993+
dict _1 |-->Map
994+
set _1 |-->Set
995+
Optional _1 |-->_1`indicatorType
996+
str |-->String
997+
bool |-->boolean
998+
float |-->double
999+
int |-->int
1000+
1001+
[ _1 ] |-->_1`indicatorType
1002+
1003+
_1 |-->_1`indicatorType<when> _1 test
1004+
_1 |-->_1`indicatorType<when> _1 logical_test
1005+
_1 |-->_1`indicatorType<when> _1 comparison
1006+
_1 |-->_1`indicatorType<when> _1 expr
1007+
_1 |-->_1`indicatorType<when> _1 arguments
1008+
_1 |-->_1`indicatorType<when> _1 subscriptlist
1009+
_1 |-->_1`indicatorType<when> _1 subscript
1010+
1011+
_1 |-->_1
9631012

9641013

9651014
parameterName::
@@ -2320,7 +2369,7 @@ _1 _2 |--> _1 _2<when> _2`equalAssign true, _1 matches .*\..*
23202369
_1 _2 |--> _1 _2<when> _2`equalAssign true, _1 matches .*\[.*
23212370
_1 _2 |--> _1 _2<when> _2`equalAssign true, _1`hasTrailer true
23222371

2323-
_1 _2 |--> var _1 : _2`ocltype _2<when> _2`equalAssign true <action> _1`defined true, _1 _2`ocltype
2372+
_1 _2 |--> var _1 : _2`indicator2OCL _2<when> _2`equalAssign true <action> _1`defined true, _1 _2`indicatorType
23242373

23252374
_1 _2 |--> _1 := _1_2<when> _2 assign_part
23262375

@@ -2531,8 +2580,8 @@ _* |-->false
25312580

25322581

25332582
assign_part::
2534-
: _1 = _2 |-->: _1`ocltype := _2
2535-
: _1 |-->: _1`ocltype
2583+
: _1 = _2 |-->: _1`indicator2OCL := _2
2584+
: _1 |-->: _1`indicator2OCL
25362585

25372586
= _1 = _2 |-->:= _2; _1 := _2<when> _1`defined true
25382587
= _1 = _2 |-->:= _2; var _1 : _2`ocltype := _2<action> _1`defined true
@@ -2972,17 +3021,17 @@ _* |-->
29723021

29733022

29743023
funcdef::
2975-
async def _1 ( _2 ) -> _3 : _4 |--> operation _1(_2) : _3`ocltype\n pre: true post: true\n activity:\n_2`defaultParamSettings_4;\n\n
2976-
def _1 ( _2 ) -> _3 : _4 |--> operation _1(_2) : _3`ocltype\n pre: true post: true\n activity:\n_2`defaultParamSettings_4;\n\n
3024+
async def _1 ( _2 ) -> _3 : _4 |--> operation _1(_2) : _3`indicator2OCL\n pre: true post: true\n activity:\n_2`defaultParamSettings_4;\n\n
3025+
def _1 ( _2 ) -> _3 : _4 |--> operation _1(_2) : _3`indicator2OCL\n pre: true post: true\n activity:\n_2`defaultParamSettings_4;\n\n
29773026

29783027
async def _1 ( _2 ) : _3 |--> operation _1(_2) : OclAny\n pre: true post: true\n activity:\n_2`defaultParamSettings_3;\n\n<when> _3`hasValueReturn true
29793028
async def _1 ( _2 ) : _3 |--> operation _1(_2)\n pre: true post: true\n activity:\n_2`defaultParamSettings_3;\n\n
29803029

29813030
def _1 ( _2 ) : _3 |--> operation _1(_2) : OclAny\n pre: true post: true\n activity:\n_2`defaultParamSettings_3;\n\n<when> _3`hasValueReturn true
29823031
def _1 ( _2 ) : _3 |--> operation _1(_2)\n pre: true post: true\n activity:\n_2`defaultParamSettings_3;\n\n
29833032

2984-
async def _1 ( ) -> _2 : _3 |--> operation _1() : _2`ocltype\n pre: true post: true\n activity:\n_3;\n\n
2985-
def _1 ( ) -> _2 : _3 |--> operation _1() : _2`ocltype\n pre: true post: true\n activity:\n_3;\n\n
3033+
async def _1 ( ) -> _2 : _3 |--> operation _1() : _2`indicator2OCL\n pre: true post: true\n activity:\n_3;\n\n
3034+
def _1 ( ) -> _2 : _3 |--> operation _1() : _2`indicator2OCL\n pre: true post: true\n activity:\n_3;\n\n
29863035

29873036
async def _1 ( ) : _2 |--> operation _1() : OclAny\n pre: true post: true\n activity:\n_2;\n\n<when> _2`hasValueReturn true
29883037
async def _1 ( ) : _2 |--> operation _1()\n pre: true post: true\n activity:\n_2;\n\n
@@ -3000,13 +3049,13 @@ _* |-->
30003049
methodDefinition::
30013050
def __init__ ( _1 ) : _2 |-->_2`attributeDefinitions\n operation initialise(_1`parametersTail) : _$\n pre: true post: true\n activity:\n_2;\n return self;\n\n
30023051

3003-
def _1 ( _2 ) -> _3 : _4 |-->\n operation _1(_2`parametersTail) : _3`ocltype\n pre: true post: true\n activity:\n_4;\n\n
3052+
def _1 ( _2 ) -> _3 : _4 |-->\n operation _1(_2`parametersTail) : _3`indicator2OCL\n pre: true post: true\n activity:\n_4;\n\n
30043053

30053054
def _1 ( _2 ) : _3 |-->\n operation _1(_2`parametersTail) : OclAny\n pre: true post: true\n activity:\n_3;\n\n<when> _3`hasValueReturn true
30063055

30073056
def _1 ( _2 ) : _3 |-->\n operation _1(_2`parametersTail)\n pre: true post: true\n activity:\n_3;\n\n
30083057

3009-
def _1 ( ) -> _2 : _3 |-->\n static operation _1() : _2`ocltype\n pre: true post: true\n activity:\n_3;\n\n
3058+
def _1 ( ) -> _2 : _3 |-->\n static operation _1() : _2`indicator2OCL\n pre: true post: true\n activity:\n_3;\n\n
30103059

30113060
def _1 ( ) : _2 |-->\n static operation _1() : OclAny\n pre: true post: true\n activity:\n_2;\n\n<when> _2`hasValueReturn true
30123061

@@ -3083,7 +3132,7 @@ _1 |-->_1`classcontent<when> _1 compound_stmt
30833132
_1 |-->_1`methodDefinition<when> _1 funcdef
30843133
_1 |-->_1`innerclassConstructor<when> _1 classdef
30853134

3086-
_1 _2 |--> static attribute _1 : _2`ocltype _2;\n<when> _2 assign_part <action> _1 _2`ocltype
3135+
_1 _2 |--> static attribute _1 : _2`indicator2OCL _2;\n<when> _2 assign_part <action> _1 _2`indicatorType
30873136

30883137
_1 |-->
30893138
_* |-->

0 commit comments

Comments
 (0)